Page MenuHomePhabricator

Linter extension needs an "exception list" for paired templates, and/or a means to detect unpaired use...
Open, LowPublicFeature

Description

Currently on some Mediawiki wiki in use by WMF projects it's widespread to use "paired" templates.

These opening and closing templates of the pair contain an opening or closing tag, which unless ( <noinclude></noinclude> is used to add the respective tag) causes Linter to see these templates as having missing end tags or stripped tags respectively.

Would it be possible to have some kind of per-wiki exception list for the extension, so that paired templates shown to be otherwise valid can be eliminated as problems, allowing those fixing potential errors to focus on genuine erorrs rather than those currently generated in Linter as a result of deliberate coding decisions?

It would also be useful if there was a way of detecting unpaired template use in pages. This would be useful on projects like Wikisource which make extensive use of the "paired" template approach..

Related Objects

Event Timeline

For example - https://en.wikisource.org/wiki/Template:Smaller_block/s is paired, (it has the closing tag in a <noinclude></noinclude> but is still treated as stripped by Linter. Having an exception list for templates such as these that were paired up with others or 'cooking' out <includeonly></includeonly> <noinclude></noinclude> books when analysing in Template: namespace would be strongly hinted at.

@ShakespeareFan00 A year after filing this task, you removed the closing </div> with the comment "lint"

https://en.wikisource.org/w/index.php?title=Template%3ASmaller_block%2Fs&diff=9440385&oldid=5111963

Was that you acquiescing or is this task still valid?

I found a way to resolve the situation without needing code changes. The original request should be considered as more of a feature request if it needs to be kept open at all. Further discussion seems to be in the RFC for balanced templates anyway.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Aug 20 2023, 7:34 AM