Difference between revisions of "User:GarveyPatrickD/Combining the nowiki and pre tags"
(Stated conclusion) |
(Added "Surrounding a Universal Record Locator (URL)" section) |
||
Line 1: | Line 1: | ||
These are a series of tests of combining the <nowiki><nowiki></nowiki> and <nowiki><pre></nowiki> tags. This is motivated by the results seen after a migration utility was used on pages encoded in another wiki syntax for use in a replacement MediaWiki. The most important question is, is there a reason to use both of these tags together? If so, what is the effect of various nestings of the two tags? |
These are a series of tests of combining the <nowiki><nowiki></nowiki> and <nowiki><pre></nowiki> tags. This is motivated by the results seen after a migration utility was used on pages encoded in another wiki syntax for use in a replacement MediaWiki. The most important question is, is there a reason to use both of these tags together? If so, what is the effect of various nestings of the two tags? |
||
__TOC__ |
__TOC__ |
||
+ | =Surrounding arbitrary text= |
||
− | =Using only one tag= |
||
+ | ==Using only one tag== |
||
− | ==Placing all the tokens on one line in the source== |
+ | ===Placing all the tokens on one line in the source=== |
− | ===No leading or trailing white space=== |
+ | ====No leading or trailing white space==== |
− | ====<nowiki><nowiki></nowiki></nowiki> alone==== |
+ | =====<nowiki><nowiki></nowiki></nowiki> alone===== |
Source:<br /> |
Source:<br /> |
||
<b><nowiki><nowiki></nowiki></b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<b><nowiki></nowiki></nowiki></b> |
<b><nowiki><nowiki></nowiki></b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<b><nowiki></nowiki></nowiki></b> |
||
Line 13: | Line 14: | ||
<nowiki>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</nowiki> |
<nowiki>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</nowiki> |
||
− | ====<nowiki><pre></pre></nowiki> alone==== |
+ | =====<nowiki><pre></pre></nowiki> alone===== |
Source:<br /> |
Source:<br /> |
||
<b><nowiki><pre></nowiki></b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<b><nowiki></pre></nowiki></b> |
<b><nowiki><pre></nowiki></b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<b><nowiki></pre></nowiki></b> |
||
Line 20: | Line 21: | ||
<pre>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</pre> |
<pre>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</pre> |
||
− | ===Leading and trailing white space=== |
+ | ====Leading and trailing white space==== |
− | ====<nowiki><nowiki></nowiki></nowiki> alone==== |
+ | =====<nowiki><nowiki></nowiki></nowiki> alone===== |
Source:<br /> |
Source:<br /> |
||
<b><nowiki><nowiki></nowiki></b> Lorem ipsum dolor sit amet, consectetur adipiscing elit. <b><nowiki></nowiki></nowiki></b> |
<b><nowiki><nowiki></nowiki></b> Lorem ipsum dolor sit amet, consectetur adipiscing elit. <b><nowiki></nowiki></nowiki></b> |
||
Line 29: | Line 30: | ||
<br /> |
<br /> |
||
Note: minimum white space is used in the result. |
Note: minimum white space is used in the result. |
||
− | ====<nowiki><pre></pre></nowiki> alone==== |
+ | =====<nowiki><pre></pre></nowiki> alone===== |
Source:<br /> |
Source:<br /> |
||
<b><nowiki><pre></nowiki></b> Lorem ipsum dolor sit amet, consectetur adipiscing elit. <b><nowiki></pre></nowiki></b> |
<b><nowiki><pre></nowiki></b> Lorem ipsum dolor sit amet, consectetur adipiscing elit. <b><nowiki></pre></nowiki></b> |
||
Line 37: | Line 38: | ||
Note: white space is preserved in the result |
Note: white space is preserved in the result |
||
− | ==Placing each token on a separate line in the source== |
+ | ===Placing each token on a separate line in the source=== |
− | ===No leading or trailing white space=== |
+ | ====No leading or trailing white space==== |
− | ====<nowiki><nowiki></nowiki></nowiki> alone==== |
+ | =====<nowiki><nowiki></nowiki></nowiki> alone===== |
Source:<br /> |
Source:<br /> |
||
<b> |
<b> |
||
Line 70: | Line 71: | ||
Note: the result is the same as placing all the tokens on one line in the source. |
Note: the result is the same as placing all the tokens on one line in the source. |
||
− | ====<nowiki><pre></pre></nowiki> alone==== |
+ | =====<nowiki><pre></pre></nowiki> alone===== |
Source:<br /> |
Source:<br /> |
||
<b> |
<b> |
||
Line 100: | Line 101: | ||
Note: each token between the tags is placed on a separate line. |
Note: each token between the tags is placed on a separate line. |
||
− | ===Leading and trailing white space=== |
+ | ====Leading and trailing white space==== |
− | ====<nowiki><nowiki></nowiki></nowiki> alone==== |
+ | =====<nowiki><nowiki></nowiki></nowiki> alone===== |
Source:<br /> |
Source:<br /> |
||
<b> |
<b> |
||
Line 136: | Line 137: | ||
Note: the result is the same as placing all the tokens on one line in the source. |
Note: the result is the same as placing all the tokens on one line in the source. |
||
− | ====<nowiki><pre></pre></nowiki> alone==== |
+ | =====<nowiki><pre></pre></nowiki> alone===== |
Source:<br /> |
Source:<br /> |
||
<b> |
<b> |
||
Line 170: | Line 171: | ||
Note: each token between the tags is placed on a separate line with, at least, leading white space, including vertical white space. |
Note: each token between the tags is placed on a separate line with, at least, leading white space, including vertical white space. |
||
− | =Using both tags= |
+ | ==Using both tags== |
− | ==Placing all the tokens on one line in the source== |
+ | ===Placing all the tokens on one line in the source=== |
− | ===No leading or trailing white space=== |
+ | ====No leading or trailing white space==== |
− | ====<nowiki><nowiki></nowiki> first, then <nowiki><pre></nowiki>==== |
+ | =====<nowiki><nowiki></nowiki> first, then <nowiki><pre></nowiki>===== |
Source:<br /> |
Source:<br /> |
||
<b><nowiki><nowiki><pre></nowiki></b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<b><nowiki></pre></nowiki></nowiki></b> |
<b><nowiki><nowiki><pre></nowiki></b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<b><nowiki></pre></nowiki></nowiki></b> |
||
Line 181: | Line 182: | ||
<br /> |
<br /> |
||
Note: the <b><nowiki><pre></nowiki></b> tag is displayed rather than consumed. |
Note: the <b><nowiki><pre></nowiki></b> tag is displayed rather than consumed. |
||
− | ====<nowiki><pre></nowiki> first, then <nowiki><nowiki></nowiki>==== |
+ | =====<nowiki><pre></nowiki> first, then <nowiki><nowiki></nowiki>===== |
Source:<br /> |
Source:<br /> |
||
<b><nowiki><pre><nowiki></nowiki></b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<b><nowiki></nowiki></nowiki><nowiki></pre></nowiki></b> |
<b><nowiki><pre><nowiki></nowiki></b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<b><nowiki></nowiki></nowiki><nowiki></pre></nowiki></b> |
||
Line 189: | Line 190: | ||
Note: both tags are consumed. |
Note: both tags are consumed. |
||
− | ===Leading and trailing white space=== |
+ | ====Leading and trailing white space==== |
− | ====<nowiki><nowiki></nowiki> first, then <nowiki><pre></nowiki>==== |
+ | =====<nowiki><nowiki></nowiki> first, then <nowiki><pre></nowiki>===== |
Source:<br /> |
Source:<br /> |
||
<b><nowiki><nowiki><pre></nowiki></b> Lorem ipsum dolor sit amet, consectetur adipiscing elit. <b><nowiki></pre></nowiki></nowiki></b> |
<b><nowiki><nowiki><pre></nowiki></b> Lorem ipsum dolor sit amet, consectetur adipiscing elit. <b><nowiki></pre></nowiki></nowiki></b> |
||
Line 198: | Line 199: | ||
<br /> |
<br /> |
||
Note: the <b><nowiki><pre></nowiki></b> tag is displayed rather than consumed and the white space after the tag is minimized. |
Note: the <b><nowiki><pre></nowiki></b> tag is displayed rather than consumed and the white space after the tag is minimized. |
||
− | ====<nowiki><pre></nowiki> first, then <nowiki><nowiki></nowiki>==== |
+ | =====<nowiki><pre></nowiki> first, then <nowiki><nowiki></nowiki>===== |
Source:<br /> |
Source:<br /> |
||
<b><nowiki><pre><nowiki></nowiki></b> Lorem ipsum dolor sit amet, consectetur adipiscing elit. <b><nowiki></nowiki></nowiki><nowiki></pre></nowiki></b> |
<b><nowiki><pre><nowiki></nowiki></b> Lorem ipsum dolor sit amet, consectetur adipiscing elit. <b><nowiki></nowiki></nowiki><nowiki></pre></nowiki></b> |
||
Line 206: | Line 207: | ||
Note: both tags are consumed and the white space is preserved. |
Note: both tags are consumed and the white space is preserved. |
||
− | ==Placing each token on a separate line in the source== |
+ | ===Placing each token on a separate line in the source=== |
− | ===No leading or trailing white space=== |
+ | ====No leading or trailing white space==== |
− | ====<nowiki><nowiki></nowiki> first, then <nowiki><pre></nowiki>==== |
+ | =====<nowiki><nowiki></nowiki> first, then <nowiki><pre></nowiki>===== |
Source:<br /> |
Source:<br /> |
||
<b> |
<b> |
||
Line 245: | Line 246: | ||
Note: the <b><nowiki><pre></nowiki></b> tag is displayed rather than consumed and white space is used between the tag and the next/previous token. |
Note: the <b><nowiki><pre></nowiki></b> tag is displayed rather than consumed and white space is used between the tag and the next/previous token. |
||
− | ====<nowiki><pre></nowiki> first, then <nowiki><nowiki></nowiki>==== |
+ | =====<nowiki><pre></nowiki> first, then <nowiki><nowiki></nowiki>===== |
Source:<br /> |
Source:<br /> |
||
<b> |
<b> |
||
Line 280: | Line 281: | ||
Note: the additional vertical spacing in the result. |
Note: the additional vertical spacing in the result. |
||
− | ===Leading and trailing white space=== |
+ | ====Leading and trailing white space==== |
− | ====<nowiki><nowiki></nowiki> first, then <nowiki><pre></nowiki>==== |
+ | =====<nowiki><nowiki></nowiki> first, then <nowiki><pre></nowiki>===== |
Source:<br /> |
Source:<br /> |
||
<b> |
<b> |
||
Line 312: | Line 313: | ||
Note: the <b><nowiki><pre></nowiki></b> tag is displayed rather than consumed and white space is used between the tag and the next/previous token. |
Note: the <b><nowiki><pre></nowiki></b> tag is displayed rather than consumed and white space is used between the tag and the next/previous token. |
||
− | ====<nowiki><pre></nowiki> first, then <nowiki><nowiki></nowiki>==== |
+ | =====<nowiki><pre></nowiki> first, then <nowiki><nowiki></nowiki>===== |
+ | Source:<br /> |
||
+ | <b> |
||
+ | <nowiki><pre></nowiki> |
||
+ | <br /> |
||
+ | <nowiki><nowiki></nowiki> |
||
+ | </b> |
||
+ | |||
+ | <br /> Lorem |
||
+ | <br /> ipsum |
||
+ | <br /> dolor |
||
+ | <br /> sit |
||
+ | <br /> amet, |
||
+ | <br /> consectetur |
||
+ | <br /> adipiscing |
||
+ | <br /> elit. |
||
+ | |||
+ | <b> |
||
+ | <br /></nowiki> |
||
+ | <br /></pre> |
||
+ | </b> |
||
+ | <br /> |
||
+ | Display:<br /> |
||
+ | <pre> |
||
+ | <nowiki> |
||
+ | Lorem |
||
+ | ipsum |
||
+ | dolor |
||
+ | sit |
||
+ | amet, |
||
+ | consectetur |
||
+ | adipiscing |
||
+ | elit. |
||
+ | </nowiki> |
||
+ | </pre> |
||
+ | Note: the additional vertical spacing and preserved horizontal spacing in the result. |
||
+ | |||
+ | =Surrounding a Universal Record Locator (URL)= |
||
+ | ==Using only one tag== |
||
+ | |||
+ | ===Placing all the tokens on one line in the source=== |
||
+ | |||
+ | ====No leading or trailing white space==== |
||
+ | =====<nowiki><nowiki></nowiki></nowiki> alone===== |
||
+ | Source:<br /> |
||
+ | <b><nowiki><nowiki></nowiki></b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<b><nowiki></nowiki></nowiki></b> |
||
+ | <br /> |
||
+ | Display:<br /> |
||
+ | <nowiki>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</nowiki> |
||
+ | |||
+ | =====<nowiki><pre></pre></nowiki> alone===== |
||
+ | Source:<br /> |
||
+ | <b><nowiki><pre></nowiki></b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<b><nowiki></pre></nowiki></b> |
||
+ | <br /> |
||
+ | Display:<br /> |
||
+ | <pre>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</pre> |
||
+ | |||
+ | ====Leading and trailing white space==== |
||
+ | =====<nowiki><nowiki></nowiki></nowiki> alone===== |
||
+ | Source:<br /> |
||
+ | <b><nowiki><nowiki></nowiki></b> Lorem ipsum dolor sit amet, consectetur adipiscing elit. <b><nowiki></nowiki></nowiki></b> |
||
+ | <br /> |
||
+ | Display:<br /> |
||
+ | <nowiki> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </nowiki> |
||
+ | <br /> |
||
+ | Note: minimum white space is used in the result. |
||
+ | =====<nowiki><pre></pre></nowiki> alone===== |
||
+ | Source:<br /> |
||
+ | <b><nowiki><pre></nowiki></b> Lorem ipsum dolor sit amet, consectetur adipiscing elit. <b><nowiki></pre></nowiki></b> |
||
+ | <br /> |
||
+ | Display:<br /> |
||
+ | <pre> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </pre> |
||
+ | Note: white space is preserved in the result |
||
+ | |||
+ | ===Placing each token on a separate line in the source=== |
||
+ | ====No leading or trailing white space==== |
||
+ | =====<nowiki><nowiki></nowiki></nowiki> alone===== |
||
+ | Source:<br /> |
||
+ | <b> |
||
+ | <nowiki><nowiki></nowiki> |
||
+ | </b> |
||
+ | <br />Lorem |
||
+ | <br />ipsum |
||
+ | <br />dolor |
||
+ | <br />sit |
||
+ | <br />amet, |
||
+ | <br />consectetur |
||
+ | <br />adipiscing |
||
+ | <br />elit. |
||
+ | <b> |
||
+ | <br /></nowiki> |
||
+ | </b> |
||
+ | <br /> |
||
+ | Display:<br /> |
||
+ | <nowiki> |
||
+ | Lorem |
||
+ | ipsum |
||
+ | dolor |
||
+ | sit |
||
+ | amet, |
||
+ | consectetur |
||
+ | adipiscing |
||
+ | elit. |
||
+ | </nowiki> |
||
+ | <br /> |
||
+ | Note: the result is the same as placing all the tokens on one line in the source. |
||
+ | |||
+ | =====<nowiki><pre></pre></nowiki> alone===== |
||
+ | Source:<br /> |
||
+ | <b> |
||
+ | <nowiki><pre></nowiki> |
||
+ | </b> |
||
+ | <br />Lorem |
||
+ | <br />ipsum |
||
+ | <br />dolor |
||
+ | <br />sit |
||
+ | <br />amet, |
||
+ | <br />consectetur |
||
+ | <br />adipiscing |
||
+ | <br />elit. |
||
+ | <b> |
||
+ | <br /></pre> |
||
+ | </b> |
||
+ | <br /> |
||
+ | Display:<br /> |
||
+ | <pre> |
||
+ | Lorem |
||
+ | ipsum |
||
+ | dolor |
||
+ | sit |
||
+ | amet, |
||
+ | consectetur |
||
+ | adipiscing |
||
+ | elit. |
||
+ | </pre> |
||
+ | Note: each token between the tags is placed on a separate line. |
||
+ | |||
+ | ====Leading and trailing white space==== |
||
+ | =====<nowiki><nowiki></nowiki></nowiki> alone===== |
||
+ | Source:<br /> |
||
+ | <b> |
||
+ | <nowiki><nowiki></nowiki> |
||
+ | </b> |
||
+ | |||
+ | <br /> Lorem |
||
+ | <br /> ipsum |
||
+ | <br /> dolor |
||
+ | <br /> sit |
||
+ | <br /> amet, |
||
+ | <br /> consectetur |
||
+ | <br /> adipiscing |
||
+ | <br /> elit. |
||
+ | |||
+ | <b> |
||
+ | <br /></nowiki> |
||
+ | </b> |
||
+ | <br /> |
||
+ | Display:<br /> |
||
+ | <nowiki> |
||
+ | |||
+ | Lorem |
||
+ | ipsum |
||
+ | dolor |
||
+ | sit |
||
+ | amet, |
||
+ | consectetur |
||
+ | adipiscing |
||
+ | elit. |
||
+ | |||
+ | </nowiki> |
||
+ | <br /> |
||
+ | Note: the result is the same as placing all the tokens on one line in the source. |
||
+ | |||
+ | =====<nowiki><pre></pre></nowiki> alone===== |
||
+ | Source:<br /> |
||
+ | <b> |
||
+ | <nowiki><pre></nowiki> |
||
+ | </b> |
||
+ | |||
+ | <br /> Lorem |
||
+ | <br /> ipsum |
||
+ | <br /> dolor |
||
+ | <br /> sit |
||
+ | <br /> amet, |
||
+ | <br /> consectetur |
||
+ | <br /> adipiscing |
||
+ | <br /> elit. |
||
+ | |||
+ | <b> |
||
+ | <br /></pre> |
||
+ | </b> |
||
+ | <br /> |
||
+ | Display:<br /> |
||
+ | <pre> |
||
+ | |||
+ | Lorem |
||
+ | ipsum |
||
+ | dolor |
||
+ | sit |
||
+ | amet, |
||
+ | consectetur |
||
+ | adipiscing |
||
+ | elit. |
||
+ | |||
+ | </pre> |
||
+ | Note: each token between the tags is placed on a separate line with, at least, leading white space, including vertical white space. |
||
+ | |||
+ | ==Using both tags== |
||
+ | ===Placing all the tokens on one line in the source=== |
||
+ | ====No leading or trailing white space==== |
||
+ | =====<nowiki><nowiki></nowiki> first, then <nowiki><pre></nowiki>===== |
||
+ | Source:<br /> |
||
+ | <b><nowiki><nowiki><pre></nowiki></b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<b><nowiki></pre></nowiki></nowiki></b> |
||
+ | <br /> |
||
+ | Display:<br /> |
||
+ | <nowiki><pre>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</pre></nowiki> |
||
+ | <br /> |
||
+ | Note: the <b><nowiki><pre></nowiki></b> tag is displayed rather than consumed. |
||
+ | =====<nowiki><pre></nowiki> first, then <nowiki><nowiki></nowiki>===== |
||
+ | Source:<br /> |
||
+ | <b><nowiki><pre><nowiki></nowiki></b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<b><nowiki></nowiki></nowiki><nowiki></pre></nowiki></b> |
||
+ | <br /> |
||
+ | Display:<br /> |
||
+ | <pre><nowiki>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</nowiki></pre> |
||
+ | Note: both tags are consumed. |
||
+ | |||
+ | ====Leading and trailing white space==== |
||
+ | =====<nowiki><nowiki></nowiki> first, then <nowiki><pre></nowiki>===== |
||
+ | Source:<br /> |
||
+ | <b><nowiki><nowiki><pre></nowiki></b> Lorem ipsum dolor sit amet, consectetur adipiscing elit. <b><nowiki></pre></nowiki></nowiki></b> |
||
+ | <br /> |
||
+ | Display:<br /> |
||
+ | <nowiki><pre> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </pre></nowiki> |
||
+ | <br /> |
||
+ | Note: the <b><nowiki><pre></nowiki></b> tag is displayed rather than consumed and the white space after the tag is minimized. |
||
+ | =====<nowiki><pre></nowiki> first, then <nowiki><nowiki></nowiki>===== |
||
+ | Source:<br /> |
||
+ | <b><nowiki><pre><nowiki></nowiki></b> Lorem ipsum dolor sit amet, consectetur adipiscing elit. <b><nowiki></nowiki></nowiki><nowiki></pre></nowiki></b> |
||
+ | <br /> |
||
+ | Display:<br /> |
||
+ | <pre><nowiki> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </nowiki></pre> |
||
+ | Note: both tags are consumed and the white space is preserved. |
||
+ | |||
+ | ===Placing each token on a separate line in the source=== |
||
+ | ====No leading or trailing white space==== |
||
+ | =====<nowiki><nowiki></nowiki> first, then <nowiki><pre></nowiki>===== |
||
+ | Source:<br /> |
||
+ | <b> |
||
+ | <nowiki><nowiki></nowiki> |
||
+ | <br /> |
||
+ | <nowiki><pre></nowiki> |
||
+ | </b> |
||
+ | <br />Lorem |
||
+ | <br />ipsum |
||
+ | <br />dolor |
||
+ | <br />sit |
||
+ | <br />amet, |
||
+ | <br />consectetur |
||
+ | <br />adipiscing |
||
+ | <br />elit. |
||
+ | <b> |
||
+ | <br /> |
||
+ | <nowiki></pre></nowiki> |
||
+ | <br /></nowiki> |
||
+ | </b> |
||
+ | <br /> |
||
+ | Display:<br /> |
||
+ | <nowiki> |
||
+ | <pre> |
||
+ | Lorem |
||
+ | ipsum |
||
+ | dolor |
||
+ | sit |
||
+ | amet, |
||
+ | consectetur |
||
+ | adipiscing |
||
+ | elit. |
||
+ | </pre> |
||
+ | </nowiki> |
||
+ | <br /> |
||
+ | Note: the <b><nowiki><pre></nowiki></b> tag is displayed rather than consumed and white space is used between the tag and the next/previous token. |
||
+ | |||
+ | =====<nowiki><pre></nowiki> first, then <nowiki><nowiki></nowiki>===== |
||
+ | Source:<br /> |
||
+ | <b> |
||
+ | <nowiki><pre></nowiki> |
||
+ | <br /> |
||
+ | <nowiki><nowiki></nowiki> |
||
+ | </b> |
||
+ | <br />Lorem |
||
+ | <br />ipsum |
||
+ | <br />dolor |
||
+ | <br />sit |
||
+ | <br />amet, |
||
+ | <br />consectetur |
||
+ | <br />adipiscing |
||
+ | <br />elit. |
||
+ | <b> |
||
+ | <br /></nowiki> |
||
+ | <br /></pre> |
||
+ | </b> |
||
+ | <br /> |
||
+ | Display:<br /> |
||
+ | <pre> |
||
+ | <nowiki> |
||
+ | Lorem |
||
+ | ipsum |
||
+ | dolor |
||
+ | sit |
||
+ | amet, |
||
+ | consectetur |
||
+ | adipiscing |
||
+ | elit. |
||
+ | </nowiki> |
||
+ | </pre> |
||
+ | Note: the additional vertical spacing in the result. |
||
+ | |||
+ | ====Leading and trailing white space==== |
||
+ | =====<nowiki><nowiki></nowiki> first, then <nowiki><pre></nowiki>===== |
||
+ | Source:<br /> |
||
+ | <b> |
||
+ | <nowiki><nowiki></nowiki> |
||
+ | <br /> |
||
+ | <nowiki><pre></nowiki> |
||
+ | </b> |
||
+ | |||
+ | <br /> Lorem |
||
+ | <br /> ipsum |
||
+ | <br /> dolor |
||
+ | <br /> sit |
||
+ | <br /> amet, |
||
+ | <br /> consectetur |
||
+ | <br /> adipiscing |
||
+ | <br /> elit. |
||
+ | |||
+ | <b> |
||
+ | <br /><nowiki></pre></nowiki> |
||
+ | <br /></nowiki> |
||
+ | </b> |
||
+ | <br /> |
||
+ | Display:<br /> |
||
+ | <nowiki> |
||
+ | <pre> |
||
+ | Lorem ipsum dolor sit amet, consectetur adipiscing elit. |
||
+ | </pre> |
||
+ | </nowiki> |
||
+ | <br /> |
||
+ | Note: the <b><nowiki><pre></nowiki></b> tag is displayed rather than consumed and white space is used between the tag and the next/previous token. |
||
+ | |||
+ | =====<nowiki><pre></nowiki> first, then <nowiki><nowiki></nowiki>===== |
||
Source:<br /> |
Source:<br /> |
||
<b> |
<b> |
Revision as of 22:38, 30 November 2011
These are a series of tests of combining the <nowiki> and <pre> tags. This is motivated by the results seen after a migration utility was used on pages encoded in another wiki syntax for use in a replacement MediaWiki. The most important question is, is there a reason to use both of these tags together? If so, what is the effect of various nestings of the two tags?
Contents
- 1 Surrounding arbitrary text
- 2 Surrounding a Universal Record Locator (URL)
- 3 Conclusion
Surrounding arbitrary text
Using only one tag
Placing all the tokens on one line in the source
No leading or trailing white space
<nowiki></nowiki> alone
Source:
<nowiki>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</nowiki>
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
<pre></pre> alone
Source:
<pre>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</pre>
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Leading and trailing white space
<nowiki></nowiki> alone
Source:
<nowiki> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </nowiki>
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Note: minimum white space is used in the result.
<pre></pre> alone
Source:
<pre> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </pre>
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Note: white space is preserved in the result
Placing each token on a separate line in the source
No leading or trailing white space
<nowiki></nowiki> alone
Source:
<nowiki>
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
</nowiki>
Display:
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
Note: the result is the same as placing all the tokens on one line in the source.
<pre></pre> alone
Source:
<pre>
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Note: each token between the tags is placed on a separate line.
Leading and trailing white space
<nowiki></nowiki> alone
Source:
<nowiki>
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
</nowiki>
Display:
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
Note: the result is the same as placing all the tokens on one line in the source.
<pre></pre> alone
Source:
<pre>
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Note: each token between the tags is placed on a separate line with, at least, leading white space, including vertical white space.
Using both tags
Placing all the tokens on one line in the source
No leading or trailing white space
<nowiki> first, then <pre>
Source:
<nowiki><pre>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</pre></nowiki>
Display:
<pre>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</pre>
Note: the <pre> tag is displayed rather than consumed.
<pre> first, then <nowiki>
Source:
<pre><nowiki>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</nowiki></pre>
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Note: both tags are consumed.
Leading and trailing white space
<nowiki> first, then <pre>
Source:
<nowiki><pre> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </pre></nowiki>
Display:
<pre> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </pre>
Note: the <pre> tag is displayed rather than consumed and the white space after the tag is minimized.
<pre> first, then <nowiki>
Source:
<pre><nowiki> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </nowiki></pre>
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Note: both tags are consumed and the white space is preserved.
Placing each token on a separate line in the source
No leading or trailing white space
<nowiki> first, then <pre>
Source:
<nowiki>
<pre>
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
</pre>
</nowiki>
Display:
<pre>
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
</pre>
Note: the <pre> tag is displayed rather than consumed and white space is used between the tag and the next/previous token.
<pre> first, then <nowiki>
Source:
<pre>
<nowiki>
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
</nowiki>
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Note: the additional vertical spacing in the result.
Leading and trailing white space
<nowiki> first, then <pre>
Source:
<nowiki>
<pre>
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
</pre>
</nowiki>
Display:
<pre>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</pre>
Note: the <pre> tag is displayed rather than consumed and white space is used between the tag and the next/previous token.
<pre> first, then <nowiki>
Source:
<pre>
<nowiki>
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
</nowiki>
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Note: the additional vertical spacing and preserved horizontal spacing in the result.
Surrounding a Universal Record Locator (URL)
Using only one tag
Placing all the tokens on one line in the source
No leading or trailing white space
<nowiki></nowiki> alone
Source:
<nowiki>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</nowiki>
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
<pre></pre> alone
Source:
<pre>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</pre>
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Leading and trailing white space
<nowiki></nowiki> alone
Source:
<nowiki> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </nowiki>
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Note: minimum white space is used in the result.
<pre></pre> alone
Source:
<pre> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </pre>
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Note: white space is preserved in the result
Placing each token on a separate line in the source
No leading or trailing white space
<nowiki></nowiki> alone
Source:
<nowiki>
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
</nowiki>
Display:
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
Note: the result is the same as placing all the tokens on one line in the source.
<pre></pre> alone
Source:
<pre>
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Note: each token between the tags is placed on a separate line.
Leading and trailing white space
<nowiki></nowiki> alone
Source:
<nowiki>
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
</nowiki>
Display:
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
Note: the result is the same as placing all the tokens on one line in the source.
<pre></pre> alone
Source:
<pre>
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Note: each token between the tags is placed on a separate line with, at least, leading white space, including vertical white space.
Using both tags
Placing all the tokens on one line in the source
No leading or trailing white space
<nowiki> first, then <pre>
Source:
<nowiki><pre>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</pre></nowiki>
Display:
<pre>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</pre>
Note: the <pre> tag is displayed rather than consumed.
<pre> first, then <nowiki>
Source:
<pre><nowiki>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</nowiki></pre>
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Note: both tags are consumed.
Leading and trailing white space
<nowiki> first, then <pre>
Source:
<nowiki><pre> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </pre></nowiki>
Display:
<pre> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </pre>
Note: the <pre> tag is displayed rather than consumed and the white space after the tag is minimized.
<pre> first, then <nowiki>
Source:
<pre><nowiki> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </nowiki></pre>
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Note: both tags are consumed and the white space is preserved.
Placing each token on a separate line in the source
No leading or trailing white space
<nowiki> first, then <pre>
Source:
<nowiki>
<pre>
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
</pre>
</nowiki>
Display:
<pre>
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
</pre>
Note: the <pre> tag is displayed rather than consumed and white space is used between the tag and the next/previous token.
<pre> first, then <nowiki>
Source:
<pre>
<nowiki>
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
</nowiki>
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Note: the additional vertical spacing in the result.
Leading and trailing white space
<nowiki> first, then <pre>
Source:
<nowiki>
<pre>
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
</pre>
</nowiki>
Display:
<pre>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</pre>
Note: the <pre> tag is displayed rather than consumed and white space is used between the tag and the next/previous token.
<pre> first, then <nowiki>
Source:
<pre>
<nowiki>
Lorem
ipsum
dolor
sit
amet,
consectetur
adipiscing
elit.
</nowiki>
Display:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Note: the additional vertical spacing and preserved horizontal spacing in the result.
Conclusion
Using the <nowiki></nowiki> tag pair inside a <pre></pre> tag pair has no additional effect.