Difference between revisions of "Template:Blockquote paragraphs"
(update) |
(tweaks) |
||
Line 1: | Line 1: | ||
− | Due to the utterly intractable [[MediaWiki]] bug reported at {{bugzilla|6200}}, and still unfixed {{as of|February 2012|lc=y}}, block quoting on Wikipedia, with or without a template, cannot handle freeform linebreaking for paragraphs and poems and the like. | + | Due to the utterly intractable [[MediaWiki]] bug reported at {{bugzilla|6200}}, and still unfixed {{as of|February 2012|lc=y}}, block quoting on Wikipedia, with or without a template, cannot handle freeform linebreaking for paragraphs and poems and the like, unless formatted one very specific (and annoying) way. |
− | The problem in action: | + | {{collapse top|title=The problem in action: test cases that seem like they should work but fail}}<div class="collapse-workaround"> |
The intuitive choice: | The intuitive choice: | ||
Line 74: | Line 74: | ||
<p>Line 3</p> | <p>Line 3</p> | ||
<p>Line 4</p>}} | <p>Line 4</p>}} | ||
+ | {{collapse bottom}}</div> | ||
− | + | {{As of|February 2012}}, the {{em|only}} solution for the problem is to use {{em|unbroken markup}} with {{tag|p}} or {{tag|br|single}} elements (or others, like nested blockquotes and lists): | |
:{{tnull|<includeonly>{{BASEPAGENAME}}</includeonly><noinclude>bq</noinclude>|Line 1<br/>Line 2<br/>Line 3<br/>Line 4.}} | :{{tnull|<includeonly>{{BASEPAGENAME}}</includeonly><noinclude>bq</noinclude>|Line 1<br/>Line 2<br/>Line 3<br/>Line 4.}} |
Revision as of 22:46, 2 February 2012
Due to the utterly intractable MediaWiki bug reported at Template:Bugzilla, and still unfixed Template:As of, block quoting on Wikipedia, with or without a template, cannot handle freeform linebreaking for paragraphs and poems and the like, unless formatted one very specific (and annoying) way.
Template:Collapse topThe intuitive choice:
{{bq|Line 1
Line 2
Line 3
Line 4}}
results in the mangled:
Blank lines seem to work at first:
{{bq|Line 1
Line 2
Line 3
Line 4}}
though with quite tall spacing between the content blocks (lines, in our test cases):
Yet this markup fails with wiki ":" indentation:
Just trying to use {{#if:|
|
}}{{#switch:pair
|c|close = |s|single |o|open |p|pair = <p{{#if:| {{{params}}}}}
}}{{#switch:pair
|c|close = |s|single = /> |o|open = > |p|pair = >...
}}{{#switch:pair
|s|single |o|open = |c|close |p|pair = </p>
}}{{#if:|
|
}} or {{#if:|
|
}}{{#switch:single
|c|close = |s|single |o|open |p|pair = <br{{#if:| {{{params}}}}}
}}{{#switch:single
|c|close = |s|single = /> |o|open = > |p|pair = >...
}}{{#switch:single
|s|single |o|open = |c|close |p|pair = </br>
}}{{#if:|
|
}} markup won't solve all the problems:
{{bq|Line 1<br/>
Line 2<br/>
Line 3<br/>
Line 4}}
results in odd spacing, with the middle blocks too close together:
Meanwhile this version again seems ok:
but again can't be indented:
Template:Collapse bottomTemplate:As of, the Template:Em solution for the problem is to use Template:Em with {{#if:|
|
}}{{#switch:pair
|c|close = |s|single |o|open |p|pair = <p{{#if:| {{{params}}}}}
}}{{#switch:pair
|c|close = |s|single = /> |o|open = > |p|pair = >...
}}{{#switch:pair
|s|single |o|open = |c|close |p|pair = </p>
}}{{#if:|
|
}} or {{#if:|
|
}}{{#switch:single
|c|close = |s|single |o|open |p|pair = <br{{#if:| {{{params}}}}}
}}{{#switch:single
|c|close = |s|single = /> |o|open = > |p|pair = >...
}}{{#switch:single
|s|single |o|open = |c|close |p|pair = </br>
}}{{#if:|
|
}} elements (or others, like nested blockquotes and lists):
which, while hard to read, especially for long content, results in the expected:
And Template:Em be indented:
Happily, there is an HTML-comment workaround for readability that lets you do whatever you want:
{{bq|1=<!--
-->Line 1<br/><!--
-->Line 2<br/><!--
-->Line 3<br/><!--
-->Line 4.}}
or even:
{{bq|1=<!--
-->Line 1<br/><!--
-->Line 2<br/><!--
-->Line 3<br/><!--
-->Line 4.}}
which results in the expected:
They Template:Em indentable:
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |