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

Item5127: fix for extra BRs on save in Wysiwyg

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension WysiwygPlugin Normal Closed   n/a  

Edit Form Data

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


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 &lt;br /&gt; 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 />
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

Summary fix for extra BRs on save in Wysiwyg
ReportedBy TWiki:Main.ColasNahaboo
Codebase 4.2.0
SVN Range TWiki-4.3.0, Sun, 25 Nov 2007, build 15790
AppliesTo Extension
Component WysiwygPlugin
Priority Normal
CurrentState Closed

Checkins TWikirev:15990 TWikirev:15991
TargetRelease n/a

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r5 - 2007-12-15 - ColasNahaboo
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback