Template:Dialog/safe

From Wikinews, the free news source you can write!
Jump to navigation Jump to search
[edit] Template documentation

This template converts certain wiki formatting characters in its parameter to numeric html entity references.

Usage

Apply this template to strings output by the template expansion process, that will be converted to html but are meant to remain relatively unaffected by the conversion. The conversion still alters the string somewhat. To bypass the conversion altogether, use {{dialog/init}}.

  • {{dialog/safe|string}} returns a "safe" version of string, by substituting html entity references for certain characters that have format meaning in wiki markup. As of this writing, the characters are
< > = [ ] * # : '
Note, this list does not include characters that affect parsing of wiki markup, but don't affect the subsequent conversion to html:
{ } |
These parsing characters (and some of the others) are significant when a dialog parameter is being injected into the template expansion process, and are dealt with there by replacing them with template calls — to templates {{(*}}, {{*)}}, {{!}}, etc., so that the expansion process returns those characters to their original forms.

Internals

The characters substituted for are designated by a Scribunto ustring pattern.

See also