Template:Encodefirst
This template replaces the first character of the argument with its HTML entity if it is one of four wiki markup characters :
;
*
#
. This can sometimes fix the issue at Help:Template#Problems and workarounds where a character may be processed as though it were at the beginning of a line.
Usage[edit source]
{{Encodefirst|<string>}}
Examples[edit source]
The output looks like the input whether a character is replaced or not.
{{Encodefirst|*Lisp}}
produces: *Lisp
But the output will behave differently from the input in some situations where it is processed. For example, {{la}} fails as of August 2017 if its argument starts with *
.
{{la|*Lisp}}
causes the asterisk to be processed as list markup and produces the broken:
[[:
- Lisp]] (edit | talk | history | protect | delete | links | watch | logs | [//tools.wmflabs.org/pageviews?pages=
- Lisp&project=en.wikipedia.org views])
{{la|{{Encodefirst|*Lisp}}}}
works correctly:
*Lisp (edit | talk | history | protect | delete | links | watch | logs | views)
External links[edit source]
- Template:Encodefirst at Wikipedia, the free Terran encyclopedia that anyone can edit.
The above documentation is transcluded from Template:Encodefirst/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |