Subramanya Sastry has uploaded a new change for review.
https://gerrit.wikimedia.org/r/192044
Change subject: T90309: Ensure that implicitly-added <references> output have
unique ids
......................................................................
T90309: Ensure that implicitly-added <references> output have unique ids
* Fixed parser test output of one test to add unique ids. Output for
other parser tests modified in 5189bcb7 still need fixing up.
Left for a separate patch.
Change-Id: I04546c2a590930121d960239a1954b26771e9c80
---
M lib/ext.Cite.js
M tests/parserTests.txt
2 files changed, 4 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid
refs/changes/44/192044/1
diff --git a/lib/ext.Cite.js b/lib/ext.Cite.js
index 2eaee36..e9fa7ee 100644
--- a/lib/ext.Cite.js
+++ b/lib/ext.Cite.js
@@ -484,7 +484,6 @@
References.prototype.insertMissingReferencesIntoDOM = function (env, node) {
var doc = node.ownerDocument,
- referencesId = env.newAboutId(),
self = this;
this.refGroups.forEach(function (refsData, refsGroup) {
@@ -493,7 +492,7 @@
DU.addAttributes(ol, {
'class': 'references',
typeof: 'mw:Extension/references',
- about: referencesId
+ about: env.newAboutId()
});
// The new references come out of "nowhere", so to make selser
work
// propertly, add a zero-sized DSR pointing to the end of the
document.
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index fc37f96..81a8276 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -20178,11 +20178,11 @@
A <ref>foo</ref>
B <ref group="inexistent">bar</ref>
!! html
-<p>A <span class="reference" id="cite_ref-1" rel="dc:references"
typeof="mw:Extension/ref"
data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}'><a
href="#cite_note-1">[1]</a></span> B <span class="reference" id="cite_ref-2"
rel="dc:references" typeof="mw:Extension/ref"
data-mw='{"name":"ref","body":{"html":"bar"},"attrs":{"group":"inexistent"}}'><a
href="#cite_note-2">[inexistent 1]</a></span></</p>
-<ol class="references" typeof="mw:Extension/references"
data-mw='{"name":"references","attrs":{}}'>
+<p>A <span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references"
typeof="mw:Extension/ref"
data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}'><a
href="#cite_note-1">[1]</a></span> B <span about="#mwt4" class="reference"
id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref"
data-mw='{"name":"ref","body":{"html":"bar"},"attrs":{"group":"inexistent"}}'><a
href="#cite_note-2">[inexistent 1]</a></span></</p>
+<ol about="#mwt5" class="references" typeof="mw:Extension/references"
data-mw='{"name":"references","attrs":{}}'>
<li id="cite_note-1"><span rel="mw:referencedBy"><a
href="#cite_ref-1">↑</a></span> foo</li>
</ol>
-<ol class="references" typeof="mw:Extension/references"
data-mw='{"name":"references","attrs":{"group":"inexistent"}}'>
+<ol about="#mwt6" class="references" typeof="mw:Extension/references"
data-mw='{"name":"references","attrs":{"group":"inexistent"}}'>
<li id="cite_note-2"><span rel="mw:referencedBy"><a
href="#cite_ref-2">↑</a></span> bar</li>
</ol>
!! end
--
To view, visit https://gerrit.wikimedia.org/r/192044
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I04546c2a590930121d960239a1954b26771e9c80
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits