Item5337: WYSIWYG edit mode breaks <pre> text
Priority: Normal
Current State: No Action Required
Released In:
Target Release: n/a
A <pre> block gets mangled by switching between the Wysiwyg and text editors, so that line breaks are lost. To reproduce, use the old-style text editor to make a wiki page containing
<pre>
hello
there
</pre>
Save the page. As expected, it shows a block of preformatted text with two lines.
Now go to Edit. The page appears in the Wysiwyg editor. (I am using the default template and preferences that come with TWiki-4.2.0.) Press the icepick icon to switch to the old-style text editor.
Expected result: the text is there exactly as I entered it last time, with line breaks in the <pre> section.
Actual result: the line breaks have been lost so it now reads
hello there
In general, the text editor should always show exactly the code that was entered last time. It shouldn't get altered in any way between one edit and the next.
--
TWiki:Main/EdAvis - 07 Feb 2008
I am able to reproduce this, many thanks for the detailed instructions. Confirmed.
Later: I wrote a unit test for this, and the translator correctly handles the newlines in the pre block. Therefore the problem lies somewhere in
TinyMCE
Changed attribution to
TinyMCEPlugin.
--
CrawfordCurrie - 27 Mar 2008
As far as I can determine, Tiny MCE does not respect newlines in pre blocks. It's definitely the editor that is eating them, and nothing to do with the mapping to and from TML.
--
TWiki:Main.CrawfordCurrie - 27 Mar 2008
Same for verbatim and code beautifier blocks. So they would need to fix this in
TinyMCE?
--
TWiki:Main.GordonTerrell - 01 Jul 2008
Yup.
--
TWiki:Main.CrawfordCurrie - 04 Jul 2008
verbatim works
It is only pre blocks that get lines merged.
A work around is to put sticky tags around (protect forever in Wysiwyg)
--
TWiki:Main.KennethLavrsen - 27 Jul 2008
Just checked this in
TinyMCE 3.2.2, and it's fixed, so should be good from the next minor release or Foswiki (1.1).
--
CrawfordCurrie - 16 Mar 2009