r3 - 29 Apr 2006 - 13:09:24 - SamHaslerYou are here: TWiki >  Codev Web > ExtraNewlinePrefixesTEXT
Tags:
, create new tag

Patch Proposal: <p/> prefixed to %TEXT% tag

Description

When the %TEXT% tag is replaced by TWiki::Render::View.pm it somehow added an extra newline to the beginning of the topic text. Substitution is done by cutting of a leading <DOCTYPE...> tag that is prevented from being piped thru the rendering process. Later on, it is added to the return value again. But actually the code that extracted the $doctype used $1 in a flawed way: if the regexp doesn't match, the $doctype variable still set to $1 not being undefined but still holding an arbitrary value ... actually a newline.

This patch initializes $doctype first with the empty string and only assigns something else to it if actually needed.

Maybe the rest of TWiki has to be audited for the same coding pattern, which not always shows up as an error but needs to be fixed.

-- MichaelDaum - 26 Mar 2005


Discussion:

OK, applied the patch. Will check in when the SVN store is back.

-- CrawfordCurrie - 26 Mar 2005

I'm assuming from the above that this made it into Dakar so I'm upgrading it to ChangeProposalForm and marking it as such.

-- SamHasler - 29 Apr 2006

Topic attachments
I Attachment Action Size Date Who Comment
elsediff Render.diff manage 0.5 K 26 Mar 2005 - 10:24 MichaelDaum  
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r3 < r2 < r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback SourceForge.net Logo