Page MenuHomePhabricator

Presence of <section /> tag confuses Linter analyis when using 'continued' tables....
Closed, ResolvedPublic

Description

The following page https://en.wikisource.org/w/index.php?title=Page:A_biographical_dictionary_of_eminent_Scotsmen,_vol_1.djvu/337&action=edit&lintid=1080094 was being detected as having a "fostered content" concern.

The only fostered content that could be located was a <section /> tag, which is used by LST to mark the start of a 'section'. Removing the <section /> tag from the markup caused the fostered content concern to vanish. The presence of the section tag is not however an error, as Wikisource uses <section /> tags extensively. Having Linter erroneously report a 'fostered' content concern. Linter mis-reporting these where no fostered content actually exists is tiresome.

What should have happened is that the <Section /> tag should once noted for the purposes of building a transcluded section have been stripped from the output, and from the markup supplied to the Linter analyser.

Of course if Mediawiki had a more sensible way of splitting table sections (the current markup and handling having been designed for single page use....) then concerns like this would be less important...

(Aside: The use of section tags for LST possibly conflicts with HTML5)

Event Timeline

Another example:-
https://en.wikisource.org/w/index.php?title=Page%3AJanuary_1916_QST.djvu%2F11&type=revision&diff=9110659&oldid=6808821

here the 'fostered content' arose due to very very specfic whitespace handling around the <section /> tag ( which I've still not seen any documentation on, despite having raised that issue on Phabricator in the past.)

Dinoguy1000 renamed this task from Presence of<section /> tag confuses Linter analyis when using 'continued' tables.... to Presence of <section /> tag confuses Linter analyis when using 'continued' tables.....Feb 17 2019, 5:38 PM
Dinoguy1000 updated the task description. (Show Details)

This problem appears to be still happening, for example at:

https://en.wikipedia.org/w/index.php?title=List_of_Doctor_Who_home_video_releases&oldid=962205062

Expanding one of the tables in that page on Special:ExpandTemplates shows that no additional HTML code appears to be displayed above the table. With an actual Fostered content error, there should be something rendered above the table.

According to the Page information Linter error counts, this is the article with the most Linter errors on all of English Wikipedia as of today. (Although it is not actually the article with the most errors, because the Page information counts are often inaccurate; see T246403 for details on that bug.)

It would be great if Linter could ignore these section tags.

FYI, I was able to fix the Doctor Who article by removing line breaks before the the section tags: https://en.wikipedia.org/w/index.php?title=List_of_Doctor_Who_home_video_releases&type=revision&diff=1035236542&oldid=1033009703

I don't know if the same fix could have been applied to the wikisource pages.

Until someone analyses what is happening in the lint component for what is otherwise non-problematic code elsewhere, then who knows.

With reference to Jonesey95's Dr Who article, newlines before section tags are impossible to avoid in the WS page namespace, because there are some hardcoded newlines inserted by the extension before the body text (see T275388 for a place this causes an actual issue in the wikicode, rather than the linter).

Doesn't mean it's not something the linter could no choke on, but it's also sadly not something Wikisource users can avoid by changing the markup.

Another example:-
https://en.wikisource.org/w/index.php?title=Page%3AJanuary_1916_QST.djvu%2F11&type=revision&diff=9110659&oldid=6808821

here the 'fostered content' arose due to very very specfic whitespace handling around the <section /> tag ( which I've still not seen any documentation on, despite having raised that issue on Phabricator in the past.)

This is due to the latter being interpreted as a table tag attribute:

Each mark, except table end (|}), optionally accepts one or more attributes. Attributes must be on the same line as the mark.

From https://en.wikipedia.org/wiki/Help:Table#HTML_attributes

Arlolra triaged this task as Medium priority.Aug 17 2023, 6:42 PM

In T162919, the fostering lint was supposed to be suppressed for rendering transparent tags. Parsoid renders <section /> tags as <link />s, which should fall in that category.

However,

> echo "{|\n<section name='test'/>\n|123\n|}" | php bin/parse.php --domain en.wikisource.org --linting                                                                                
{"type":"fostered","dsr":[0,33,2,2],"params":[]}
<p data-parsoid='{"fostered":true,"autoInsertedStart":true,"dsr":[0,0,null,null]}'><link typeof="mw:Extension/section" about="#mwt2" data-parsoid='{"dsr":[3,25,22,0]}' data-mw='{"name":"section","attrs":{"name":"test"}}'/></p><table data-parsoid='{"dsr":[0,33,2,2]}'>

<tbody data-parsoid='{"dsr":[26,31,0,0]}'><tr data-parsoid='{"autoInsertedStart":true,"dsr":[26,31,0,0]}'><td data-parsoid='{"dsr":[26,31,1,0]}'>123
</td></tr></tbody></table>

This is because currently Parsoid only considers link tags that are from start-of-line transparent tags (like category links) as rendering transparent. The differences being, for example,

<section name="123"/>== test ==

won't render the heading because the section isn't sol-transparent.

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

[mediawiki/services/parsoid@master] Don't report lints for fostered section tags

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

Change 950035 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Don't report lints for fostered section tags

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

Change 956459 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.18.0-v23

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

Change 956459 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.18.0-v23

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