Revision as of 19:31, 13 August 2024 editAndrybak (talk | contribs)Extended confirmed users, Template editors81,166 edits Category:Hiding templates← Previous edit | Latest revision as of 10:00, 1 October 2024 edit undoGrufo (talk | contribs)Extended confirmed users4,609 editsmNo edit summary | ||
Line 28: | Line 28: | ||
--></syntaxhighlight> | --></syntaxhighlight> | ||
In substitutable templates, use <syntaxhighlight lang="wikitext" inline>{{ |
In substitutable templates, use <syntaxhighlight lang="wikitext" inline>{{safesubst:<noinclude />HTML comment|...}}</syntaxhighlight>. | ||
== Notable cases == | == Notable cases == |
Latest revision as of 10:00, 1 October 2024
This is a documentation subpage for Template:HTML comment. It may contain usage information, categories and other content that is not part of the original template page. |
This template should always be substituted (i.e., use {{subst:HTML comment}} ). |
Use this substitution to insert HTML comments (<!-- ... -->
) – hidden to readers – into Misplaced Pages pages.
Usage
{{subst:html comment|Lorem ipsum dolor sit amet}}
- ↳
<!-- Lorem ipsum dolor sit amet -->
- ↳
By default a space will be added before and after the given text. Use collapsed=yes to remove it (useful in vertical comments). For example,
{{subst:html comment|collapsed=yes| Lorem ipsum dolor sit amet }}
will generate
<!-- Lorem ipsum dolor sit amet -->
In substitutable templates, use {{safesubst:<noinclude />HTML comment|...}}
.
Notable cases
Using this substitution allows the expansion of MediaWiki commands inside HTML comments, where they would be preserved verbatim otherwise. Compare:
{{subst:html comment|{{subst:FULLPAGENAME}}}}
- ↳
<!-- Template:HTML comment -->
- ↳
and:
<!-- {{subst:FULLPAGENAME}} -->
- ↳
<!-- {{subst:FULLPAGENAME}} -->
- ↳
See also
- {{Example HTML comment}}
- {{Comment}}