More actions
Created page with "{{Documentation subpage}} {{High-use}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikipedia:Wikidata) --> This template replaces the first character of the argument with its HTML entity if it is one of four wiki markup characters <code>:</code> <code>;</code> <code>*</code> <code>#</code>. This can sometimes fix the issue at Help:Template#Problems and workarounds where a charact..." |
No edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{wikipedia|page name}} | |||
{{Documentation subpage}} | {{Documentation subpage}} | ||
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | ||
This template replaces the first character of the argument with its | This template replaces the first character of the argument with its HTML entity if it is one of four wiki markup characters <code>:</code> <code>;</code> <code>*</code> <code>#</code>. 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 == | == Usage == | ||
| Line 15: | Line 15: | ||
But the output will behave differently from the input in some situations where it is processed. For example, {{tl|la}} fails as of August 2017 if its argument starts with <code>*</code>. | But the output will behave differently from the input in some situations where it is processed. For example, {{tl|la}} fails as of August 2017 if its argument starts with <code>*</code>. | ||
<code><nowiki>{{la|*Lisp}}</nowiki></code> causes the asterisk to be processed as | <code><nowiki>{{la|*Lisp}}</nowiki></code> causes the asterisk to be processed as list markup and produces broken display. | ||
<code><nowiki>{{la|{{Encodefirst|*Lisp}}}}</nowiki></code> works correctly: | <code><nowiki>{{la|{{Encodefirst|*Lisp}}}}</nowiki></code> works correctly: | ||
Latest revision as of 17:29, 9 April 2025
| This page uses Creative Commons Licensed content from Wikipedia (view authors). |
| This is a documentation subpage for Template:Encodefirst It may contain usage information, categories and other content that is not part of the original template page. |
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
{{Encodefirst|<string>}}
Examples
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 broken display.
{{la|{{Encodefirst|*Lisp}}}} works correctly: