• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7700 for generic doc work for TWiki-6.0.2. Use View topic Item7703 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.

Suddenly TWiki generates <p />s in html pages corresponding to newlines in the template.

For instance in twiki.pattern.tmpl:

%TMPL:DEF{"page"}%
%TMPL:P{"htmldoctype"}%
%TMPL:P{"head"}%
%TMPL:P{"bodystart"}%
%TMPL:P{"main"}%
%TMPL:P{"bodyend"}%%TMPL:END%
After each %TMPL:P{}% a <p /> is created.

AC

That might have been introduced by change Item1640, Don't strip newlines from the front of TMPL:DEFs.

-- PTh

There are even gaps in attachment table rows. See for instance Item685.-- AC


my fault, fixed in SVN 8836

CC


What are the new rules? I see that tables do have newlines with each tr or td. When not to use a newline?

AC

The rule is that everything between TMPL:DEF and TMPL:END is taken into the definition. Previously it would skip any leading newlines, which was very confusing.

So, given:

%TMPL:DEF{blah}%
Fred
%TMPL:END%
previously blah would expand to Fred\n. Now it expands to \nFred\n, exactly as written.

You have to think about how TWiki works. In Cairo, if I did this:

%TMPL:DEF{row}%

Salix Orthomania%TMPL:END%
then
X%TMPL:P{row}%%TMPL:P{row}%Y
would expand to
XSalix OrthomaniaSalix OrthomaniaY
i.e. the leading (intended) <p /> would be eaten. Now it will expand to
X

Salix Orthomania

Salix OrthomaniaY
i.e. the leading P is retained. WYSIWYG.

It took me ages to figure out how to do CommentPlugin under the old rules, and I never quite got it right. This puts it right.

CC

ItemTemplate
Summary TWiki generates <p />s when parsing templates
ReportedBy TWiki:Main.ArthurClemens
Codebase

SVN Range Tue, 14 Feb 2006 build 8800
AppliesTo Engine
Component

Priority Urgent
CurrentState Closed
WaitingFor

TargetRelease major
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2006-02-20 - CrawfordCurrie
 
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