I think I have found a fix for the remaining bug of the Wysiwyg plugin (with Tinymce editor): in many cases, what messes up the TML in a page are extra <br />
for instance I spent some minutes undertanding why my new skin "foo" was not working: it was because the line ended up as
* Set SKIN = foo<br />
and twiki was taking the br as part of the skin name... By looking at other cases, it seems to me that we can isolate the problem to the specific case of having the <br /> as the last thing on a line. I added the line
$text =~ s/<br( \/)?>\n/\n/g; # Remove BR just before EOLs
in
lib/TWiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm
at line 330, just before the last return statement of .rootGenerate This seems to cure all the problems I had, and I did not stumble on bad side effects.
tested on 4.2.0rc2, distrib + plugins at SVN version 15984
IMHO, I think this is really an important fix for the user experience of Freetown, and it should go into the release. But I would understand not including it due to its late arrival
--
TWiki:Main/ColasNahaboo - 13 Dec 2007
Checked in and merged; thanks Colas! (IRC discussion in logs)
--
CrawfordCurrie - 13 Dec 2007
Just a note: the potential problem mentionned in irc logs do not actually happen: if you write by hand:
a<br />
b
TinyMCE will actually remove the \n after the BR for editing, thus processing it properly and saving back the BR, as
a<br ./> b
So no problem, it works!
--
TWiki:Main.ColasNahaboo - 15 Dec 2007