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