Template:WhitespaceMarker
Template documentation
|
---|
View or edit this documentation. (About template documentation)
Portions of the template sample may not be visible without values provided. |
Usage
Used in templates only.
1. Place one or multiple {{WhitespaceMarker}}s in your text somewhere. Usually it's the start/end of a string.
{{#vardefine: var_with_text |Text with a marker inside of it. {{WhitespaceMarker}}}}
2. When you are ready to render the text somewhere where the whitespace is preserved (like inside a <div>
), remove the markers by calling {{RemoveWhitespaceMarkers}}:
{{RemoveWhitespaceMarkers|{{#var: var_with_text}}}}
The marker will get removed, leaving the whitespace intact.
Be aware that if you try to render your text just directly into wiki markup, the whitespace will get stripped. So use HTML tags like <span>
for this.
The output of this template: (wrapped in code for clarity): @@__WHITESPACE_MARKER__@@EnAlswXZ7fEnAlswXZ7f
Returns a string that can be used at start/end of strings to prevent the whitespace after/before (respectively) from collapsing. The string can later be removed from by using {{RemoveWhitespaceMarker}} template.
Parameter | Description | Type | Status | |||
---|---|---|---|---|---|---|
No parameters specified |