Template:WhitespaceMarker/doc

From Cosmoteer Wiki
Jump to navigation Jump to search

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