• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item4485: WYSIWYG plugin adds script lines at the end of the topic.

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension ToolTipPlugin Normal Confirmed   n/a  

Edit Form Data

Reported By:
Applies To:
Current State:
Waiting For:
Target Release:
Released In:


The WYSIWYG plugin adds the following text repeatedly at the end of the topic, after every WYSIWYG edit-save cycle (ignore the verbatim tags in this post).

<script src="http://cadweb.bri.st.com/twiki/pub/TWiki/ToolTipPlugin/wz_tooltip.js" type="text/javascript"></script>

It could be I've set the template up incorrectly, but if so, I can't see how.

-- TWiki:Main/SteveJonesST - 22 Aug 2007

I have seen similar from RevCommentPlugin. Not all the time. Depends on what else is in the topic. I have not found a pattern. But once it is added, one more line is added with the same after each save. This is on the Wysiwyg shipped with 4.1.2.

-- TWiki:Main.KennethLavrsen - 22 Aug 2007

I can't reproduce this. What plugins? Which editor? (Kupu or TinyMCE)


This is with Kupu (I can't test with TinyMCE, as I'm still on 4.0.5), and I confirm it does occur with the latest Wysiwyg plugin. This script line corrupts the rest of the page, so the left bar goes missing, and users are very confused by it. I have a set of users who can't adopt without Wysiwyg, so they are not participating at the moment.

-- TWiki:Main.SteveJonesST - 04 Sep 2007

Some more info. This is added by the ToolTipPlugin, which has the following in its postRenderingHandler:

$_[0] =~ s|(</body>)|<script type="text/javascript" src="$TWiki::cfg{DefaultUrlHost}$TWiki::cfg{PubUrlPath}/$TWiki::cfg{SystemWebName}/$pluginName/wz_tooltip.
Somehow this is interpreted by Wysiwyg as part of the topic text, and it gets saved along with the topic. The presence of this script line in the topic breaks the view of all topics edited with Wysiwyg, and is now the main barrier to adoption of Wysiwyg on our site.

Should this be fixed in the ToolTipPlugin, or should it be handled properly by the Wysiwyg plugin ? We need both, so I have to find a solution somewhere.

Hope this helps.

-- TWiki:Main.SteveJonesST - 04 Sep 2007

My workaround is to comment the line from the postRenderingHandler in ToolTipPlugin, and add the following to the body.pattern.template, just before the final closing body tag:

<script type="text/javascript" src="%PUBURLPATH%/%TWIKIWEB%/ToolTipPlugin/wz_tooltip.js"></script>

This allows both the Wysiwyg and ToolTip plugins to coexist in my installation.

I believe we should understand where this should be fixed however, in case it's a more general case which could affect Wysiwyg proliferation.

-- TWiki:Main.SteveJonesST - 04 Sep 2007

You should be able to use TinyMCE with 4.0.5.

From what you describe here, this is a really horrible hack in the ToolTopPlugin. So I'm passing the buck; it should be fixed there.

-- CrawfordCurrie - 04 Sep 2007

I have not observed this problem with the current 4.2.2 TWiki. The ToolTipPlugin still inserts the javascript file in the post rendering handler. Note that I did change the plugin to only add the javascript when a tooltip is found on the page. I don't see why every page should get the .js file if tooltips are not in use.

-- TWiki:Main.GeorgeClark - 29 Aug 2008

I tried to change the TWiki:Plugins.ToolTipPlugin to use the TWiki::Func::addToHEAD API to add the wz_tooltip.js to the page. Unfortunately the .js file checks and enforces a requirement that the .js file be loaded in the <body> of the page. addToHEAD won't work for this script.

-- TWiki:Main.GeorgeClark - 01 Sep 2008

Is anyone still running into this problem or can this item be closed?

-- TWiki:Main.GeorgeClark - 20 Sep 2008

Summary WYSIWYG plugin adds script lines at the end of the topic.
ReportedBy TWiki:Main.SteveJonesST
Codebase 4.0.5
SVN Range TWiki-4.2.0, Wed, 22 Aug 2007, build 14581
AppliesTo Extension
Component ToolTipPlugin
Priority Normal
CurrentState Confirmed


TargetRelease n/a

Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r9 - 2008-09-20 - GeorgeClark
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback