unmatched tag - bhsd-harry/wikiparser-node GitHub Wiki

unmatched-tag

⚠️ By default, this rule reports unmatched HTML tags as warnings.

Options

both

❌ By default, this rule reports HTML tags that are both closing and self-closing as errors. This can be configured by providing a both option with a severity value.

Examples of incorrect code for { "unmatched-tag": [ 0, { "both": 2 } ] }:

</br>
</li/>

Examples of correct code for { "unmatched-tag": [ 2, { "both": 0 } ] }:

</br>
</li/>

closing

This option can be configured to specify the severity of unmatched closing tags. See also: Help:Lint errors/stripped-tag.

Examples of incorrect code for { "unmatched-tag": [ 0, { "closing": 2 } ] }:

</p>

Examples of correct code for { "unmatched-tag": [ 2, { "closing": 0 } ] }:

</p>

conditional

This option can be configured to specify the severity of unmatched HTML tags inside conditional statements (#if, #ifeq, #ifexpr, #iferror, #ifexist, or #switch).

Examples of incorrect code for { "unmatched-tag": [ 0, { "conditional": 2 } ] }:

{{#if:|<p>}}
{{#if:|</p>}}

Examples of correct code for { "unmatched-tag": [ 2, { "conditional": 0 } ] }:

{{#if:|<p>}}
{{#if:|</p>}}

opening

This option can be configured to specify the severity of unmatched opening tags. See also: Help:Lint errors/missing-end-tag.

Examples of incorrect code for { "unmatched-tag": [ 0, { "opening": 2 } ] }:

<p>

Examples of correct code for { "unmatched-tag": [ 2, { "opening": 0 } ] }:

<p>

selfClosing

❌ By default, this rule reports invalid self-closing HTML tags as errors. This can be configured by providing a selfClosing option with a severity value. See also: Help:Lint errors/self-closed-tag.

Examples of incorrect code for { "unmatched-tag": [ 0, { "selfClosing": 2 } ] }:

<p/>

Examples of correct code for { "unmatched-tag": [ 2, { "selfClosing": 0 } ] }:

<p/>
⚠️ **GitHub.com Fallback** ⚠️