Jump to content

Template:HTML comment/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Grufo (talk | contribs) at 14:55, 3 August 2023 (First draft). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Use this substitution to insert HTML comments (<!-- ... -->) – hidden to readers – into Wikipedia pages.

Usage

{{subst:html comment|Lorem ipsum dolor sit amet}}
<!-- Lorem ipsum dolor sit amet -->

Notable cases

Using this substitution allows the expansion of MediaWiki commands inside HTML comments, which would be preserved verbatim otherwise. Compare:

{{subst:html comment|{{subst:FULLPAGENAME}}}}
<!-- Template:HTML comment -->

and:

<!-- {{subst:FULLPAGENAME}} -->
<!-- {{subst:FULLPAGENAME}} -->

See also