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

Item4790: Wysiwyg edit removes font tags, inserts spaces.

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension WysiwygPlugin Enhancement No Action Required   n/a  

Edit Form Data

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


The Wysiwyg plugin is fully capable of handling <font> tags, but is set up to delete them by default when it need not modify them at all. There is a setting to change this deep in the code, but no (documented) user interface to this. Using this trivial patch, I was able to enable the full font and color capabilities of the TinyMCEPlugin.

Use case:

var ious te x t he re

Patch: twiki/lib/TWiki/Plugins/WysiwygPlugin/HTML2TML.pm (line 100):

    my $opts = 0;
    $opts = $WC::VERY_CLEAN
      if ( $options->{very_clean} );
+    #buck.golemon 9.7.2007
+    $opts = $WC::KEEP_WS;

-- TWiki:Main/BuckGolemon - 09 Oct 2007

That's true, and your patch is correct insofar as it goes. The reason it removes font tags is that when you import content from editors such as Word and Openoffice, the font tags are widely and liberally scattered, making the raw text unreadable after conversion. We tried converting recognisable tags to the %RED%..%ENDCOLOR% form, but thatr didn't help much and caused other, more obscure, errors. So, while keeping font tags is possible, as you have discovered, it is not good enough to justify default inclusion. I am setting this as an Enhancement, and when someone comes up with a complete solution to this problem they can attach it here.


I think you can close this ticket if you could just add an interface to this behavior in the WysiwygPlugin preferences. No need to change the default.

I really don't think you should be concerned about readability of converted Word documents. Windows users don't know the meaning of 'source'. Maybe that's just my opinion...

-- TWiki:Main.BuckGolemon - 09 Oct 2007

I agree with Crawford that it is important that people can copy / paste from the most common business applications such a MS Word and MS Excel and Outlook and not end up with a load of garbage which is impossible to work further on.

We have to remember the basic TWiki mission: TWiki - the Open Source Wiki for the Enterprise. Our main target for TWiki is the business customers (that is also where the money is) and the reason for having a Wysiwyg editor is exactly for them. And they need to be able to copy paste from the most common everyday tools. We are not talking about converted docs here. When you simply copy and paste from Word or Outlook rich text into TMCE in Internet Explorer - then you get a lot of extra garbage. Especially loads and loads of font tags. So it is a good thing to try and laundry out some of that so it is possible later to edit things - even in the raw edit when needed. We cannot clean out all the garbage but we get a good bit of the way by filtering out plain font tags.

-- TWiki:Main.KennethLavrsen - 09 Oct 2007

I also agree that you should be able to paste from enterprise applications. My dissagreement is that the resulting document should look as close to what was copied as possible, regardless of how 'messy' the produced raw source is, especially since the function of the Wysiwyg is to remove the need to work with raw source, and handle more complicated formatting easily.

The enterprise customer pasting from MS expects to see his fancy markup reflected in the Wysiwyg editor and not disappear on save. He'll then probably add even more markup later, and not care what the source looks like as long as the rendered document is what he wants (you never ever see the source of the file when working with MS).

If they see plain text where they pasted where they pasted styled text, they'll be dissapointed and not use the "wysiwyg" tool; they'll either go back to the raw editor or attach the MS document.

The goal of the Wysiwyg is a replacement for the raw edit, and as such the raw edit should be considered a perk and an emergency operation. The raw edit has no requirements of being pretty or simple when used in conjunction with Wysiwyg.

If you guys don't agree, I'll just maintain my patches separately. Its a small set so far: about 5 lines total.

-- TWiki:Main.BuckGolemon - 10 Oct 2007

Collected with other similar reports in Item4831 - see there for progress tracking.


Summary Wysiwyg edit removes font tags, inserts spaces.
ReportedBy TWiki:Main.BuckGolemon

SVN Range TWiki-4.3.0, Sat, 06 Oct 2007, build 15172
AppliesTo Extension
Component WysiwygPlugin
Priority Enhancement
CurrentState No Action Required


TargetRelease n/a

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