• 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.

Item5862: WysiwygPlugin converts protected text incorrectly

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension WysiwygPlugin Normal No Action Required TWiki:Main.KennethLavrsen major  

Edit Form Data

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


Note: I marked this as urgent, as the plugin destroys topics due to this bug.

If you have text such as


this plugin changes that text to

<span class="WYSIWYG_TT"><abc/></span> 

If a plugin triggers on the tag abc, then bad things may happen.

It is unacceptable that a plugin changes user text in this manner. There was a reason why the user used the escape character.

-- TWiki:Main/ThomasWeigert - 01 Aug 2008

I cannot reproduce this problem

Are you talking about what you see from a plugin or as a user?

I can use the entity syntax in raw edit and Wysiwyg edit and all is fine.

And I can paste the same text into Wysiwyg and it is fine

We have had quite a long fight to get a decent working compromize with the Wysiwyg. And it is finally a pretty good experience to use the Wysiwyg editor now.

I am close to saying - with an ironic and friendly tone - that if Crawford changes this behavior again I will kill him with a base ball club. wink

Can you clarify exactly what it is you do that creates mysterious WYSIWYG_TT class junk in the topic when saved?

-- KennethLavrsen - 01 Aug 2008

This is what I did (as normal user):

  • I started a new page with some text in it, which happened to include some tag protected by using < so it would not be interpreted
  • Then I went into edit mode using the WysiwygPlugin
  • I did nothing but saved the page
  • After that there was this "mysterious" new span tag in the text, but the original tag was exposed and interpreted.

-- ThomasWeigert - 01 Aug 2008

Interestingly, I tried this on develop.twiki.org and got a different behavior: Here the text is also changed but to

which is of course much less problematic, but still not perfect.

The behavior described above was with a install of WysiwygPlugin from two weeks ago at my own machine...

-- ThomasWeigert - 01 Aug 2008

On 4.2.0 or on 4.2.1 or trunk?

Setting to no action as I cannot see what the problem is in the above behavior. We know Wysiwyg with TMCE alters HTML. Is always will. Unless you put protection tags around.

-- TWiki:Main.KennethLavrsen - 01 Aug 2008

And with what other plugins/contribs installed?

-- TWiki:Main.CrawfordCurrie - 01 Aug 2008

Guys, I set this back to "New" as you can see from above edits that things are not right.

I had inserted text: &< and done this in raw edit. Then somebody edited this topic in WysiwygPlugin and now we have <. I'll spell it out as another edit might loose this again: First we had

  • "Ampersand symbol" followed by the letters "amp;" followed by the letters "lt;"

but after Wysiwyg editing we have

  • "Ampersand symbol" followed by the letters "lt;"

which changes the meaning of what was written.This is not some equivalent text that is just rendered different. This is totally different text.

-- ThomasWeigert - 01 Aug 2008

The Wysiwyg turns single > and < into html entities. And it keeps the as a tag.

This is what Crawford and I found was an acceptable compromize back when we were fighting with getting a reasonable spec.

If you enter > and < in Raw Edit and save. And then do a round trip in Wysiwyg the gt and lt turns into their html entities.

As expected. We cannot ask the TMCE editor to think for us. Every time you edit a page the TML is turned into HTML. And then the TMCE saves it all back in HTML and this is then turned into TML. And unfortunately the TMCE is made to encode > and < into entities.

It would be to open a can of worms to re-design this once again. In the 4.2.0 and maybe also the 4.1.2 version I had to define %GT% and %LT% variables to enable my engineers to be able to write visible syntax like Hello Hello Because the editor keps on turning the entities back into the raw > and <. I do not want to fight this problem again.

If you need to protect some HTML in an application then you can put This is some > sticky < text around. (see in raw what I mean)

-- KennethLavrsen - 01 Aug 2008

Right. TWiki converts TML to HTML using a "lossy" scheme, whereby an ampersand gets recoded as &amp; for display. So if you are going to offer WYSIWYG, you have to do the same. However, there are two ways to generate &amp; from TML. You can write an &amp; into the topic, or you can write &. Both have the same display representation. When converting back from HTML to TML, you have no way of knowing which of the source representations was used to generate which ampersand. If you always convert back to the entity, people who write this&that will get annoyed. If you convert back to a single ampersand, then people who write encoded entities into topics, as you have done, will get annoyed. The WysiwygPlugin is damned either way. We decided on balance that is was better to annoy people who encoded entities, rather than the larger and less well educated set of & users.

-- CrawfordCurrie - 01 Aug 2008

Summary WysiwygPlugin converts protected text incorrectly
ReportedBy TWiki:Main.ThomasWeigert
SVN Range TWiki-5.0.0, Sun, 27 Jul 2008, build 17148
AppliesTo Extension
Component WysiwygPlugin
Priority Normal
CurrentState No Action Required
WaitingFor TWiki:Main.KennethLavrsen
TargetRelease major
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2008-08-01 - CrawfordCurrie
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback