Steps to replicate the issue (include links if applicable):
- Create a document with the following wikitext:
<ref name="a">[http://foo.invalid/]</ref> <ref name="a">[http://foo.invalid/]</ref>
For example, https://en.wikipedia.beta.wmflabs.org/w/index.php?title=User:Adamw/sandbox/Cite-Parsoid-dups&action=edit
- Parse with the legacy Cite ref tag parser, note that no errors are generated. Duplicating ref tags with exactly identical content is a supported and correct use case. Example: https://en.wikipedia.beta.wmflabs.org/wiki/User:Adamw/sandbox/Cite-Parsoid-dups
- Parse with Parsoid.
What happens?:
Parsoid generates errors for the ref tags with external links:
<sup about="#mwt4" class="mw-ref reference" id="cite_ref-a_1-1" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"a"},"body":{"html":"<a rel=\"mw:ExtLink\" href=\"http://foo.invalid/\" data-parsoid='{\"dsr\":[56,77,20,1]}'></a>"},"errors":[{"key":"cite_error_references_duplicate_key","params":["a"]}]}'><a href="./User:Adamw/sandbox/Cite-Parsoid-dups#cite_note-a-1" style="counter-reset: mw-Ref 1;" id="mwBQ"><span class="mw-reflink-text" id="mwBg">[1]</span></a></sup></p>Example: https://en.wikipedia.beta.wmflabs.org/api/rest_v1/page/html/User:Adamw%2Fsandbox%2FCite-Parsoid-dups
Debugging Parsoid shows that the different is caused by the "dsr" data. Perhaps this should be stripped before comparing the HTML of each ref tag?
What should have happened instead?:
Happy parse with no errors, just like the second half of the example where ref tags include no external link.
Software version (skip for WMF-hosted wikis like Wikipedia):
Other information (browser name/version, screenshots, etc.):