<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.limswiki.org/index.php?action=history&amp;feed=atom&amp;title=Template%3ASp%2Fdoc</id>
	<title>Template:Sp/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.limswiki.org/index.php?action=history&amp;feed=atom&amp;title=Template%3ASp%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://www.limswiki.org/index.php?title=Template:Sp/doc&amp;action=history"/>
	<updated>2026-04-04T21:11:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://www.limswiki.org/index.php?title=Template:Sp/doc&amp;diff=16385&amp;oldid=prev</id>
		<title>Shawndouglas: Created as needed.</title>
		<link rel="alternate" type="text/html" href="https://www.limswiki.org/index.php?title=Template:Sp/doc&amp;diff=16385&amp;oldid=prev"/>
		<updated>2014-11-19T18:27:13Z</updated>

		<summary type="html">&lt;p&gt;Created as needed.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Documentation subpage}}&lt;br /&gt;
&amp;lt;!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
{{tlx|sp}} will insert a single, ordinary space character.&lt;br /&gt;
&lt;br /&gt;
====Anywhere you need a regular space====&lt;br /&gt;
You can use {{tl|sp}} anywhere you need a regular, breaking space. If you need a non-breaking space or multiple spaces in a row, use {{tl|space}}.&lt;br /&gt;
&lt;br /&gt;
====Inserting a space inside a parser function====&lt;br /&gt;
Sometimes when using [[Help:parser functions|parser functions]], you need to insert a space at the beginning or end of an optional message. {{tl|sp}} can be used for that purpose. In the following examples, look closely at the spacing between words and punctuation to see the subtle differences.&lt;br /&gt;
&lt;br /&gt;
;Example&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;I like green{{#if:{{{blue|}}}|and blue}}.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The above example works fine if 'blue' does not have a value ('&amp;lt;tt&amp;gt;I like green.&amp;lt;/tt&amp;gt;').&lt;br /&gt;
&lt;br /&gt;
However, if 'blue' is set to true (&amp;lt;code&amp;gt;|blue=true&amp;lt;/code&amp;gt;), then the message is incorrectly run together ('&amp;lt;tt&amp;gt;I like greenand blue.&amp;lt;/tt&amp;gt;').&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;I like green {{#if:{{{blue|}}}|and blue}}.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Adding the space between 'green' and '&amp;amp;#123;&amp;amp;#123;#if' avoids running the '&amp;lt;tt&amp;gt;green and&amp;lt;/tt&amp;gt;' together, but now there will be an extra space if 'blue' is not set ('&amp;lt;tt&amp;gt;I like green .&amp;lt;/tt&amp;gt;').&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;I like green{{#if:{{{blue|}}}| and blue}}.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Adding the space between the pipe ('&amp;amp;#124;') and the word 'and' doesn't work. Any leading or trailing spaces from a parser function output are stripped, so this produces exactly the same output as the first example when 'blue' is true ('&amp;lt;tt&amp;gt;I like greenand blue.&amp;lt;/tt&amp;gt;').&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;I like green{{#if:{{{blue|}}}|{{sp}}and blue}}.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
This one works! By inserting the {{tl|sp}} in the parser function output, the space is not stripped, and the correct output is given whether blue is set to true ('&amp;lt;tt&amp;gt;I like green and blue.&amp;lt;/tt&amp;gt;') or not set at all ('&amp;lt;tt&amp;gt;I like green.&amp;lt;/tt&amp;gt;').&lt;br /&gt;
&lt;br /&gt;
====Disabling default substitution====&lt;br /&gt;
Suppose you have a template, {{tl|Example}}, that uses [[WP:substitution|substitution]], like this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{{{{subst|subst:}}}#if{{{condition|}}}|message}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When the template is [[WP:Transclusion|transcluded]] and saved, the result would be interpreted as:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{subst:#if{{{condition|}}}|message}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You could override the substitution by setting the 'subst' attribute to {{tl|sp}}:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{Example| subst={{sp}} }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Now the result would be interpreted as:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ #if{{{condition|}}}|message}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The extra blank space preceding the '#if' would not affect the template at all (except to suppress the default substitution).&lt;br /&gt;
&lt;br /&gt;
===See also===&lt;br /&gt;
* {{tlx|space}}: A similar template that is often more useful except when working with parser functions&lt;br /&gt;
* {{tlx|fdw-iw}}: A template that uses {{tl|sp}} with parser functions&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
&amp;lt;!-- CATEGORIES BELOW THIS LINE, PLEASE: --&amp;gt;&lt;br /&gt;
[[Category:Inline spacing templates]]&lt;br /&gt;
[[Category:Typing-aid templates]]&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Shawndouglas</name></author>
	</entry>
</feed>