invalid gallery - bhsd-harry/wikiparser-node GitHub Wiki

❌ By default, this rule reports invalid files or image parameters, including those in <gallery> tags, as errors.

Examples

Examples of incorrect code for { "invalid-gallery": 2 }:

<gallery>Foo.jpg|thumb</gallery>

Examples of correct code for { "invalid-gallery": 2 }:

[[File:{{{1}}}]]

Options

extension

This option can be configured to specify the severity of missing file extensions.

Examples of incorrect code for { "invalid-gallery": [ 0, { "extension": 2 } ] }:

[[File:Foo]]
<gallery>Foo</gallery>

image

This option can be configured to specify the severity of invalid images in <gallery> tags.

Examples of incorrect code for { "invalid-gallery": [ 0, { "image": 2 } ] }:

<gallery>Help:Foo</gallery>

Examples of correct code for { "invalid-gallery": [ 2, { "image": 0 } ] }:

<gallery>Help:Foo</gallery>

link

This option can be configured to specify the severity of invalid links in gallery images.

Examples of incorrect code for { "invalid-gallery": [ 0, { "link": 2 } ] }:

<gallery>Foo.jpg|link=http://foo bar</gallery>
<gallery>Foo.jpg|link={</gallery>

Examples of correct code for { "invalid-gallery": [ 2, { "link": 0 } ] }:

<gallery>Foo.jpg|link=http://foo bar</gallery>
<gallery>Foo.jpg|link={</gallery>

parameter

⚠️ By default, this rule reports invalid image parameters as warnings. This can be configured by providing a parameter option with a severity value.

Examples of incorrect code for { "invalid-gallery": [ 0, { "parameter": 2 } ] }:

<gallery>
Foo.jpg|100px
</gallery>
[[File:Foo.jpg|frame|100px]]
[[File:Foo.jpg|100pxpx]]

Examples of correct code for { "invalid-gallery": [ 2, { "parameter": 0 } ] }:

<gallery>
Foo.jpg|100px
</gallery>
[[File:Foo.jpg|frame|100px]]
[[File:Foo.jpg|100pxpx]]

thumb

This option can be configured to specify the severity of invalid thumbnail filenames in image parameters.

Examples of incorrect code for { "invalid-gallery": [ 0, { "thumb": 2 } ] }:

[[File:Foo.jpg|thumb=<invalid>]]
[[File:Foo.jpg|thumb=Bar]]

Examples of correct code for { "invalid-gallery": [ 2, { "thumb": 0 } ] }:

[[File:Foo.jpg|thumb=<invalid>]]
[[File:Foo.jpg|thumb=Bar]]
⚠️ **GitHub.com Fallback** ⚠️