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

Item5295: Use inline CSS instead of font tag to avoid malformed HTML for common user input

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Normal Closed   patch 5.0.0

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

At the moment TWiki implements colour directives like %RED% with the <font> tag. But because HTML restricts the places font can appear, this can lead to malformed HTML being produced. For example the user might enter

<pre class="code">

Hello %RED% there %ENDCOLOR%.

</pre>

With TWiki 4.2.0, this generates a <font> inside the <pre> element, which is not permitted by the HTML DTD. The output is therefore malformed HTML. But if instead TWiki used <span style="font: #ff0000">, it would be legal HTML.

Since the <font> element is deprecated anyway it would be a good idea to move away from it towards <span style="..."> or <div style="...">.

I think this is a bug, not an enhancement, because of the malformed HTML currently being produced.

-- TWiki:Main/EdAvis - 28 Jan 2008

Currently the colours are defined in the TWikiPreferences topic. What negative and non compatible result could come out of changing to <span tags with CSS ?

-- TWiki:Main.KennethLavrsen - 28 Jan 2008

We've left the time of Netscape 4 support behind us, I think. But then even Netscape supported span color tags.

-- TWiki:Main.ArthurClemens - 28 Jan 2008

Yes, it should be safe to use: http://www.richinstyle.com/bugs/netscape4.html

-- TWiki:Main.ArthurClemens - 29 Jan 2008

This is now implemented in trunk

-- TWiki:Main.PeterThoeny - 08 May 2010

ItemTemplate
Summary Use inline CSS instead of font tag to avoid malformed HTML for common user input
ReportedBy TWiki:Main.EdAvis
Codebase 4.1.2, 4.2.0, ~twiki4
SVN Range TWiki-5.0.0, Wed, 23 Jan 2008, build 16283
AppliesTo Engine
Component

Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:18611
TargetRelease patch
ReleasedIn 5.0.0
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2010-05-31 - PeterThoeny
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback