I have a few templates to which I pass extended blocks of text. These can be multi-paragraph with new lines in them that are supposed to break into paragraphs.
The template looks like this:
<div class="wmd-cite-heading"> ==='''[{{{web link}}} {{{title}}} - {{{date}}}]''' {{ #if: {{{author|}}}|by [[{{{author}}}]]}} - [[{{{source}}}]]=== {{ #if: {{{extract|}}}|<div class="wmd-cite"><span class="wmd-cite-sechead">Extract:</span>{{{extract}}}</div>}} </div>
When I pass {{{extract}}} I seem to get unpredictable behaviour. Sometimes the blank lines between paragraphs turn into paragraphs with <p> ... </p> tags and sometimes they don't. I've tracked down the issue and it seems to be that I need to pass at least three paragraphs! If I pass two (exactly) then they run together:
{{Web citation |web link=http://www.google.com |title=Test |author=Me |date=Month dd, YYYY |source=none |wmdsays= |extract=para1
para2}}
{{Web citation |web link=http://www.google.com |title=another test |author=someone else |date=July 1, 2002 |source=Some place on the net |extract=A longer para1.
Para2
Para3}}
Gives:
<div class="wmd-cite"><span class="wmd-cite-sechead">Extract:</span>para1 para2</div>
and <div class="wmd-cite"><span class="wmd-cite-sechead">Extract:</span>A longer para1. <p>Para2
</p> Para3</div>
OK... Para1 and Para3 are not inside <p></p> but I'll cope but why must I have 3 paras not 2?
Bit of an esoteric question but I'd love to know.
Gadgetdoctor
Is there some speciall secret when passing multi line parameters?
Have you tried putting a new line before the first paragraph:
|extract= para1
para2 }}
I can't see why it would make any difference, but then I can't see why having 3 paras, not 2 makes any difference, so it might be worth a try.
I tried just about every variation of line breaks and spacing known to man (including what you suggest) and that was just to find out that 2 para bad 3 para good.
OK... it remains a mystery unless anyone else would care to step up!
On 9/21/07, Thomas Dalton thomas.dalton@gmail.com wrote:
Have you tried putting a new line before the first paragraph:
|extract= para1
para2 }}
I can't see why it would make any difference, but then I can't see why having 3 paras, not 2 makes any difference, so it might be worth a try.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org