Module:HasTag/doc: Difference between revisions
Jump to navigation
Jump to search
(Created page with "<code><nowiki>{{#invoke:HasTag | main | TAG | WIKITEXT }}</nowiki></code> Checks whether the tag named <code>TAG</code> occurs within <code>WIKITEXT</code>. Returns the position of the tag if found, empty otherwise. Example: <code><nowiki>{{#invoke:HasTag | main | ref | Blah <ref>blep</ref> blub. }}</nowiki></code> Result: {{#invoke:HasTag | main | ref | Blah <ref>blep</ref> blub. }} (Why no work?)") |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
Doc page: [[Module:HasTag/doc]] | |||
<code><nowiki>{{#invoke:HasTag | main | TAG | WIKITEXT }}</nowiki></code> | <code><nowiki>{{#invoke:HasTag | main | TAG | WIKITEXT }}</nowiki></code> | ||
Checks whether the tag named <code>TAG</code> occurs within <code>WIKITEXT</code>. Returns the position of the tag if found, empty otherwise. | Checks whether the tag named <code>TAG</code> occurs within <code>WIKITEXT</code>. Returns the position of the tag if found, empty otherwise. | ||
Example: <code><nowiki>{{#invoke:HasTag | main | | Example: <code><nowiki>{{#invoke:HasTag | main | nowiki | Blah <nowiki>blep</nowiki> blub. }}</nowiki></code> | ||
Result: {{#invoke:HasTag | main | | Result: {{#invoke:HasTag | main | nowiki | Blah <nowiki>blep</nowiki> blub. }} | ||
( | Note: This only works with parser tags, not HTML tags. For example, it wouldn't work with <code><div></code> or <code><code></code>, but it works with <code><gallery></code> or <code><nowiki></code>. (HTML tags can be searched for with regular parser string functions.) |
Latest revision as of 22:39, 10 June 2024
Doc page: Module:HasTag/doc
{{#invoke:HasTag | main | TAG | WIKITEXT }}
Checks whether the tag named TAG
occurs within WIKITEXT
. Returns the position of the tag if found, empty otherwise.
Example: {{#invoke:HasTag | main | nowiki | Blah <nowiki>blep</nowiki> blub. }}
Result: 8
Note: This only works with parser tags, not HTML tags. For example, it wouldn't work with <div>
or <code>
, but it works with <gallery>
or <nowiki>
. (HTML tags can be searched for with regular parser string functions.)