Page MenuHomePhabricator

Linter incorrectly lists a page on which the closing <span> tag is on a different line
Closed, DeclinedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

What happens?:

The page is being reported as containing a Stripped SPAN. A third-party script indicates that this is paired with a missing SPAN

By examining the page source, there is no mismatch of SPAN tags in the page concerned. However the page does contain a situation where a closing </SPAN> is not on the same line as an opening span where an embeded <SPAN></SPAN> pair is also present.

By comparison : https://en.wikisource.org/wiki/Page:Tragedies_of_Seneca_(1907)_Miller.djvu/51 which is using a near identical approach, is NOT reported as an error, as there are no embedded SPAN's.

What should have happened instead?:
The page should be reported as error-free as there is no mismatching/missing or stripped tags actually present in the page, or the Linter used should be more intelligent in it's matching approach.

More context

<span style="margin-left:-5em">''Oedipus:'' {{gap|0.5em}}In hades shalt thou pay thy life for all, <br/>
Unless thou till the secrets of the fates.</span><br/>

Is an example of the markup that causes a paired 'missing/stripped' SPAN to generate.

What I suspect may be occurring is that the Linter is not necessarily aware that it needs to collapse the end of line whitespace, even though it's seeing an embedded <SPAN></SPAN> and is thus erronously reporting something that isn't actually an error (given that elsewhere the parser is seemingly able to collapse the line-feeds automatically.

Event Timeline

Aklapper renamed this task from Linter misdetection. to Linter incorrectly lists a page on which the closing <span> tag is on a different line.Mar 14 2022, 11:08 AM
ShakespeareFan00 renamed this task from Linter incorrectly lists a page on which the closing <span> tag is on a different line to Linter misdetection..Mar 14 2022, 11:10 AM
ShakespeareFan00 updated the task description. (Show Details)

(Side question: Does linter use regular expresssions to try and detect certain conditions? If so then are those regular expressions set only to look at a single line? (i.e they are not-set as multi-line)

ShakespeareFan00 updated the task description. (Show Details)
ShakespeareFan00 updated the task description. (Show Details)
ShakespeareFan00 renamed this task from Linter misdetection. to Linter incorrectly lists a page on which the closing <span> tag is on a different line to Linter misdetection...Mar 14 2022, 11:16 AM

(Apologies for edit conflicts)

Aklapper renamed this task from Linter incorrectly lists a page on which the closing <span> tag is on a different line to Linter misdetection.. to Linter incorrectly lists a page on which the closing <span> tag is on a different line.Mar 14 2022, 11:47 AM
Arlolra moved this task from Backlog to Parsoid on the MediaWiki-extensions-Linter board.
Arlolra subscribed.

This looks like a duplicate of T275475#9094307

The wikitext for the article starts,

<noinclude>{{left margin|5em}}</noinclude><span style="margin-left:-5em">''Oedipus:'' {{gap|0.5em}}In hades shalt thou pay thy life for all, <br/>
Unless thou till the secrets of the fates.</span><br/>

which expands to,

<div style="margin-left:5em;">
[[Category:Pages using left-margin without text]]<span style="margin-left:-5em">''Oedipus:'' <span class="wst-gap __gap" style="display:inline-block; width:0.5em;">&#8288;</span>In hades shalt thou pay thy life for all, <br/>
Unless thou till the secrets of the fates.</span><br/>

The category has the weird property of suppressing the newline [citation needed] so that you effectively have an open span on the same line as a div, which suppresses paragraph wrapping on that line,

<div><span>testing
123</span>

so that it parses as,

> echo "<div><span>testing\n123</span>" | php bin/parse.php --linting
{"type":"missing-end-tag","dsr":[0,29,5,0],"params":{"name":"div","inTable":false}}
{"type":"missing-end-tag","dsr":[5,29,6,0],"params":{"name":"span","inTable":false}}
{"type":"stripped-tag","dsr":[22,29,null,null],"params":{"name":"span"}}
<div data-parsoid='{"stx":"html","autoInsertedEnd":true,"dsr":[0,29,5,0]}'><span data-parsoid='{"stx":"html","autoInsertedEnd":true,"dsr":[5,29,6,0]}'>testing
<p data-parsoid='{"dsr":[19,29,0,0]}'>123</p></span></div>

The induced paragraph is from T134469 and the linked task above explains a bit more about how it breaks up the span.