Difference between revisions of "Template:Blockquote paragraphs"

From D&D 5e
Jump to: navigation, search
(typo)
(typo)
Line 5: Line 5:
 
Line 2&lt;br/><br />
 
Line 2&lt;br/><br />
 
Line 3&lt;br/><br />
 
Line 3&lt;br/><br />
Line 4.}}</code></blockquote>
+
Line 4}}</code></blockquote>
 
Which results in the oddly spaced:
 
Which results in the oddly spaced:
 
{{<includeonly>{{BASEPAGENAME}}</includeonly><noinclude>bq</noinclude>|Line 1<br/>
 
{{<includeonly>{{BASEPAGENAME}}</includeonly><noinclude>bq</noinclude>|Line 1<br/>
 
Line 2<br/>
 
Line 2<br/>
 
Line 3<br/>
 
Line 3<br/>
Line 4.}}
+
Line 4}}
  
 
The {{em|only}} solution for this is to use unbroken markup with {{tag|p}} or {{tag|br|single}} elements:
 
The {{em|only}} solution for this is to use unbroken markup with {{tag|p}} or {{tag|br|single}} elements:

Revision as of 18:01, 2 February 2012

Due to the utterly intractable MediaWiki bug reported at Template:Bugzilla, block quoting cannot handle freeform linebreaking for paragraphs and poems and the like.

The problem in action:

{{bq|Line 1<br/>

Line 2<br/>
Line 3<br/>

Line 4}}</code>

Which results in the oddly spaced: Template:Bq

The Template:Em solution for this is to use unbroken markup with {{#if:|

|<code style="white-space:nowrap">

}}{{#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:

Template:Tnull

Which results in the expected: Template:Bq

However there is an HTML-comment workaround for readability that lets you do whatever you want, and is even indentable with *, : and # markup:

{{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.}}

Either which results in the expected:

Template:Bq

50px Template documentation[create]