Page MenuHomePhabricator

noinclude and includeonly tags written in visual mode were not wrapped in nowiki
Closed, ResolvedPublic

Description

In this edit: https://en.wikisource.org/w/index.php?title=User_talk:Matma_Rex&diff=12108727&oldid=12108300&diffonly=0 the noinclude and includeonly tags I wrote in visual mode were not wrapped in nowiki, and did not display correctly on the resulting page.

Expected: https://en.wikisource.org/w/index.php?diff=12108730&oldid=12108727

Event Timeline

Arlolra triaged this task as Medium priority.Feb 2 2022, 7:33 PM
Arlolra moved this task from Needs Triage to Bugs & Crashers on the Parsoid board.
Arlolra subscribed.

Hmm,

> echo "<noinclude>hmm</noinclude>" | php bin/parse.php --html2html
<meta typeof="mw:Includes/NoInclude" data-parsoid='{"src":"&lt;noinclude>","dsr":[0,11,null,null]}'/><p data-parsoid='{"dsr":[11,14,0,0]}'>hmm</p><meta typeof="mw:Includes/NoInclude/End" data-parsoid='{"src":"&lt;/noinclude>","dsr":[14,26,null,null]}'/>

and

echo "<ref>hmm</ref>" | php bin/parse.php --html2html
<p data-parsoid='{"dsr":[0,14,0,0]}'><sup about="#mwt2" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"dsr":[0,14,5,6]}' data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Main_Page#cite_note-1" style="counter-reset: mw-Ref 1;" data-parsoid="{}"><span class="mw-reflink-text" data-parsoid="{}">[1]</span></a></sup></p>

<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt3" data-parsoid='{"dsr":[15,15,0,0]}' data-mw='{"name":"references","attrs":{},"autoGenerated":true}'><ol class="mw-references references" data-parsoid="{}"><li about="#cite_note-1" id="cite_note-1" data-parsoid="{}"><a href="./Main_Page#cite_ref-1" rel="mw:referencedBy" data-parsoid="{}"><span class="mw-linkback-text" data-parsoid="{}">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text" data-parsoid="{}">hmm</span></li></ol></div>

It seems odd that we don't have escaping for this, but here we are.

echo "<nowiki>hmm</nowiki>" | php bin/parse.php --html2html
<p data-parsoid='{"dsr":[0,32,0,0]}'><span typeof="mw:Entity" data-parsoid='{"src":"&amp;lt;","srcContent":"&lt;","dsr":[0,4,null,null]}'>&lt;</span>nowiki<span typeof="mw:Entity" data-parsoid='{"src":"&amp;gt;","srcContent":">","dsr":[10,14,null,null]}'>></span>hmm<span typeof="mw:Entity" data-parsoid='{"src":"&amp;lt;","srcContent":"&lt;","dsr":[17,21,null,null]}'>&lt;</span>/nowiki<span typeof="mw:Entity" data-parsoid='{"src":"&amp;gt;","srcContent":">","dsr":[28,32,null,null]}'>></span></p>

Is the only one that seems to have specialized handling,
https://github.com/wikimedia/parsoid/blob/master/src/Html2Wt/WikitextSerializer.php#L335-L337

Change 769406 had a related patch set uploaded (by Jgiannelos; author: Jgiannelos):

[mediawiki/services/parsoid@master] WIP - Check for tag needs escaping and escape tags

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

Change 769406 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Escape dom elements with extension tag names when serializing

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

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

[mediawiki/services/parsoid@master] Don't escape extension tags shadowing html5 tags if found in source

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

Change 788449 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Don't escape extension tags shadowing html5 tags if found in source

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

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

[mediawiki/vendor@master] Bump parsoid to 0.16.0-a8

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

Change 792236 merged by jenkins-bot:

[mediawiki/vendor@master] Bump parsoid to 0.16.0-a8

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