You are here: Foswiki>Tasks Web>Item8929 (25 Jun 2010, MichaelDaum)Edit Attach

Item8929: urls in CDATA break xml

pencil
Priority: Urgent
Current State: No Action Required
Released In:
Target Release: n/a
Applies To: Engine
Component:
Branches:
Reported By: MichaelDaum
Waiting For:
Last Change By: MichaelDaum
This is what happens in Render::getRenderedVersion:

Input:
<![CDATA[http://foo.bar]]>

Output:
<![CDATA[<a href="http://foo.bar]]>" target="_top">http://foo.bar]]></a>

Should be:
<![CDATA[<a href="http://foo.bar" target="_top">http://foo.bar</a>]]>

... which is illegal.

-- MichaelDaum - 19 Apr 2010

<literal><![CDATA[</literal>
http://foo.bar
<literal>]]></literal>

produces

<![CDATA[
<a href="http://foo.bar" target="_top">http://foo.bar</a>
]]>

It didn't work when I tried it all on one line. Perhaps there is a greedy regex somewhere?

-- MichaelTempest - 19 Apr 2010

I had a similar problem that fixed itself with unwanted <dd><dt> tags in JSON. See Item8797

-- PaulHarvey - 19 Apr 2010

Note, that adding an extra white space behind the url already fixes it. There's some regex foo going on there :/

-- MichaelDaum - 20 Apr 2010

That behaviour is what I'd expect from all the examples given above, I think. I tried the obvious step of putting literal tags around the entire CDATA block, and it works fine. Can you give a specific example how to reproduce this?

-- CrawfordCurrie - 27 May 2010

See above?

-- MichaelDaum - 27 May 2010

I see the above, but I don't understand what is preventing you simply putting literal tags around the CDATA block. CDATA is not part of the definition of TML, so if you don't want the TML engine to process it, you have to protect it. Adding CDATA to the TML spec is most definitely an enhancement, but AFAICT there's a simple workaround to the problem reported here.

-- CrawfordCurrie - 30 May 2010

I simply haddn't the idea that literal would do the trick. Thanks for the hint.

-- MichaelDaum - 25 Jun 2010
 

ItemTemplate edit

Summary urls in CDATA break xml
ReportedBy MichaelDaum
Codebase trunk
SVN Range
AppliesTo Engine
Component
Priority Urgent
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn
Topic revision: r8 - 25 Jun 2010, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy