Jump to content

Strip marker

From mediawiki.org

Strip markers are alphanumeric strings in the form of \127'"`UNIQ--tagname-8 hex digits-QINU`"'\127[1] (for instance ?'"`UNIQ--nowiki-FFFFFFFF-QINU`"'?) used as placeholders by MediaWiki parser to indicate that more complicated content will be included.

The MediaWiki software adds elements that look and act like XML tags. Parser tags are included in MediaWiki whereas parser extension tags are added by optional software extensions.

Examples

[edit]

Parser tags

[edit]
  • ‎<gallery>
  • ‎<includeonly>
  • ‎<noinclude>
  • ‎<nowiki>
  • ‎<onlyinclude>
  • ‎<pre>

Parser extension tags

[edit]

The following parser extension tags are typically used on Wikimedia wikis:

  • ‎<categorytree>
  • ‎<charinsert>
  • ‎<dynamicpagelist>
  • ‎<graph>
  • ‎<hiero>
  • ‎<imagemap>
  • ‎<indicator>
  • ‎<inputbox>
  • ‎<languages>
  • ‎<math>
  • ‎<poem>
  • ‎<ref>
  • ‎<references>
  • ‎<score>
  • ‎<section>
  • ‎<syntaxhighlight> (alias ‎<source>)
  • ‎<templatedata>
  • ‎<timeline>

For the complete list of parser extension tags see Category:Tag extensions.

Strip marker exposure

[edit]

Strip markers can be exposed when badly-formed code causes the parser to be reset, and lose its memory of which strip marker corresponds to which piece of special content. When a strip marker is exposed by an issue with an extension tag, the name of the tag causing the issue will show in the middle of the string, so the text is useful in determining the root cause.

All strip marker issues are tracked by phab:T28213.

Known causes

[edit]
  • A change in the MediaWiki software or a template may cause strip markers to be exposed under certain circumstances. Even when this has been fixed, pages that have not been edited since before the problem was introduced may still show the strip markers due to caching. To resolve this, purge the page. The update to MediaWiki 1.18 in October 2011 is one such instance of this issue. An update to Extension:Cite/Cite.php with 1.24wmf13 on July 24, 2014 also exposed the markers.
  • Using a parser tag inside a {{#tag:}} construct will expose the strip markers. Examples: ‎<ref> in {{#tag:nowiki}}; ‎<nowiki> in {{#tag:source}} (task T16562).
  • Using ‎<ref> in a piped link will expose the strip markers (task T27417).
  • Lua code has access to strip markers and can corrupt them (e.g. uppercasing, lowercasing or truncation) such as {{#invoke:String|sub|<ref>foo</ref>|2|-2}} → '"`UNIQ--ref-00000028-QINU`"'.

Notes

[edit]
  1. Before Gerrit change 214404 (Gerrit #I31d455) they were in the form of \127UNIQ16 random hex digits-tagname-8 hex digits-QINU\127 (for instance ?UNIQ0123456789abcdef-nowiki-00000001-QINU?)

See also

[edit]