Page MenuHomePhabricator

Linter detection of missing table end has a slight problem with noinclude tags
Open, MediumPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

  • Notice that there is a Linter missing table end tag error detected.

What should have happened instead?:

  • No Linter missing table end tag error should have been detected.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

This detection of missing table end tags was added in T295197.

Event Timeline

This is affecting dozens, possibly hundreds, of template pages. If it could be fixed soon, that would be helpful.

https://en.wikipedia.org/wiki/Special:LintErrors/missing-end-tag?namespace=10

Change 964984 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/services/parsoid@master] [WIP] Pop noinclude tags from the end of table (row) attributes

https://gerrit.wikimedia.org/r/964984

Arlolra triaged this task as Medium priority.
Arlolra subscribed.

The issue is that these noinclude tags are in the table (row) attribute position (as you've discovered in the workarounds) and Parsoid tokenizes noincludes as balanced units, so the entire noinclude tag and its contents, including the table end tag, gets hoisted into the attributes (and anything else on the closing noinclude tag's line)

This is affecting dozens, possibly hundreds, of template pages. If it could be fixed soon, that would be helpful.

It's unfortunately not so straightforward. The patch in T348296#9240867 does fix it using an approach similar to what was done in T87069 but needs refinement if it's even the right way to go.

Should the patch that was deployed in T295197 be reverted for the time being until this task can be addressed?

Please don't revert the changes, which have been helpful overall. I have been adding line breaks before the noinclude tags to a few hundred template pages, and that seems to resolve this false positive error without changing the table's display.

My understanding of noinclude tags has always been that they were essentially invisible to the parser, since that is how they seem to behave when the page is rendered. So as long as there is a new line after the noinclude tag, the table renders fine, but it sounds like the Parsoid page analyzer works differently from the actual renderer. It's too technical for me, but it you can find a way to make the Linting match the rendering (and the logical structuring of the wikitext), that would be great.

Please don't revert the changes, which have been helpful overall.

Ok

My understanding of noinclude tags has always been that they were essentially invisible to the parser

Your understanding is correct; Parsoid is breaking that contract and needs to be fixed.