Page MenuHomePhabricator

ref tags inside of ref tags, but in HTML comments, still parsed
Open, LowPublic

Description

While this wikicode works fine as expected (I leave out the <references /> part):

random text<ref>random text<!-- random text --></ref>

this fails:

random text<ref>random text<!-- <ref>random text</ref> --></ref>

but in my opinion inside of the HTML comment the ref tags shouldn’t be parsed any more.

Related Objects

Event Timeline

ssastry added a project: MediaWiki-Parser.

This is an edge case. Behavior in the PHP parser has its own edges. But, this boils down to the precedence of extension tags vs. HTML comments.

Try the following:

A <ref> B <!-- C </ref> D --> E

A <!-- B <ref> --> C </ref> D

A <ref> X <!-- B <ref> C </ref> --> D </ref> E

php output for this is,

<p>random text<span class="error mw-ext-cite-error" lang="en" dir="ltr" xml:lang="en">Cite error: Closing <code>&lt;/ref&gt;</code> missing for <code>&lt;ref&gt;</code> tag</span> --&gt;&lt;/ref&gt;</p>

parsoid's is,

<p>random text<span id="cite_ref-1"><a href="Main_Page#cite_note-1" style="counter-reset: mw-Ref 1;"><span>[1]</span></a></span> -->&lt;/ref></p>

which is the same, so this isn't Parsoid specific.