jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/386461 )
Change subject: T133334: Ref marker in caption in data-mw
......................................................................
T133334: Ref marker in caption in data-mw
* Replace ref markers instead of waiting for cleanup to remove them
since that doesn't happen on embedded html.
Change-Id: Ied746f025a0ac7f14d922aff6640fef3aa4b55b0
---
M lib/ext/Cite/index.js
M lib/wt2html/pp/handlers/cleanup.js
M tests/parserTests-blacklist.js
M tests/parserTests.txt
4 files changed, 17 insertions(+), 24 deletions(-)
Approvals:
Subramanya Sastry: Looks good to me, approved
jenkins-bot: Verified
diff --git a/lib/ext/Cite/index.js b/lib/ext/Cite/index.js
index e54eb75..e6c7cf3 100644
--- a/lib/ext/Cite/index.js
+++ b/lib/ext/Cite/index.js
@@ -482,8 +482,10 @@
span.appendChild(refLink);
if (!nestedInReferences) {
- node.parentNode.insertBefore(span, node);
+ node.parentNode.replaceChild(span, node);
} else {
+ // We don't need to delete the node now since it'll be removed
in
+ // `insertReferencesIntoDOM` when all the children all cleaned
out.
nestedRefsHTML.push(DU.ppToXML(span), '\n');
}
@@ -654,7 +656,6 @@
child, referencesId, referencesGroup,
nestedRefsHTML);
}
}
-
child = nextChild;
}
};
@@ -715,7 +716,6 @@
}
}
}
-
child = nextChild;
}
};
diff --git a/lib/wt2html/pp/handlers/cleanup.js
b/lib/wt2html/pp/handlers/cleanup.js
index a546282..4a69b89 100644
--- a/lib/wt2html/pp/handlers/cleanup.js
+++ b/lib/wt2html/pp/handlers/cleanup.js
@@ -4,31 +4,24 @@
var Util = require('../../../utils/Util.js').Util;
var Consts = require('../../../config/WikitextConstants.js').WikitextConstants;
-// Extension/ref/Marker nodes are now processed on the final top-level dom only
-// and have to be preserved all the way till that time. So, don't strip them
-// from non-top level DOMs. Since <ref> tags can be templated, we don't want
-// a "mw:Transclusion mw:Extension/ref/Marker" meta tag to be stripped.
-// So, we are using an exact match regexp here.
-var nonTopLevelRE = /^mw:(StartTag|EndTag|TSRMarker|Transclusion)\/?[^\s]*$/;
-
-// For top-level DOMs, we cannot have any of these types left behind.
-var topLevelRE =
/(?:^|\s)mw:(StartTag|EndTag|Extension\/ref\/Marker|TSRMarker|Transclusion)\/?[^\s]*/;
-
function stripMarkerMetas(rtTestMode, node, env, atTopLevel) {
var metaType = node.getAttribute("typeof");
if (!metaType) {
return true;
}
+ // Extension/ref/Marker nodes are now processed on the final top-level
dom only
+ // and have to be preserved all the way till that time.
+ console.assert(!atTopLevel ||
!metaType.match(/mw:Extension\/ref\/Marker/),
+ 'Found a top level reference marker.');
+
// Sometimes a non-tpl meta node might get the mw:Transclusion typeof
// element attached to it. So, check if the node has data-mw,
- // in which case we also have to keep it, except if it's also a
mw:extension/ref/Marker
- // in which case it'll have data-mw but we have to remove the node.
- var metaTestRE = atTopLevel ? topLevelRE : nonTopLevelRE;
+ // in which case we also have to keep it.
+ var metaTestRE =
/(?:^|\s)mw:(StartTag|EndTag|TSRMarker|Transclusion)\/?[^\s]*/;
+
if ((!rtTestMode && metaType === "mw:Placeholder/StrippedTag")
- || (metaTestRE.test(metaType) &&
- (!DU.validDataMw(node) ||
- metaType.match(/mw:Extension\/ref\/Marker/)))) {
+ || (metaTestRE.test(metaType) &&
!DU.validDataMw(node))) {
var nextNode = node.nextSibling;
DU.deleteNode(node);
// stop the traversal, since this node is no longer in the DOM.
diff --git a/tests/parserTests-blacklist.js b/tests/parserTests-blacklist.js
index acd73e1..187710b 100644
--- a/tests/parserTests-blacklist.js
+++ b/tests/parserTests-blacklist.js
@@ -409,7 +409,7 @@
add("html2html", "Link to image page- image page normally doesn't exists,
hence edit link\nAdd test with existing image page\n#<p><a
href=\"/wiki/File:Test\" title=\"Image:Test\">Image:test</a>", "<p
data-parsoid='{\"dsr\":[0,61,0,0]}'>[/index.php?title=File:Test&action=edit&redlink=1
Image:test]</p>\n");
add("html2html", "T20784 Link to non-existent image page with caption should
use caption as link text", "<p
data-parsoid='{\"dsr\":[0,58,0,0]}'>[/index.php?title=File:Test&action=edit&redlink=1
caption]</p>\n");
add("html2html", "SVG thumbnails with invalid language code", "<figure
class=\"mw-default-size\" typeof=\"mw:Image/Thumb\"
data-parsoid='{\"optList\":[{\"ck\":\"thumbnail\",\"ak\":\"thumb\"},{\"ck\":\"lang\",\"ak\":\"lang=invalid.language.code\"}],\"dsr\":[0,52,2,2]}'><a
href=\"./File:Foobar.svg\"
data-parsoid='{\"a\":{\"href\":\"./File:Foobar.svg\"},\"sa\":{\"href\":\"File:Foobar.svg\"},\"dsr\":[2,50,null,null]}'><img
resource=\"./File:Foobar.svg\"
src=\"//example.com/images/thumb/f/ff/Foobar.svg/220px-Foobar.svg.png\"
lang=\"invalid.language.code\" data-file-width=\"240\" data-file-height=\"180\"
data-file-type=\"drawing\" height=\"165\" width=\"220\"
data-parsoid='{\"a\":{\"resource\":\"./File:Foobar.svg\",\"lang\":\"invalid.language.code\",\"height\":\"165\",\"width\":\"220\"},\"sa\":{\"resource\":\"File:Foobar.svg\",\"lang\":\"lang=invalid.language.code\"}}'/></a></figure>\n");
-add("html2html", "T93580: 3. Templated <ref> inside inline images", "<p
data-parsoid='{\"dsr\":[0,98,0,0]}'><span class=\"mw-default-size\"
typeof=\"mw:Image\"
data-parsoid='{\"optList\":[{\"ck\":\"caption\",\"ak\":\"Undisplayed caption in
inline image with ref:
{{echo|<ref>{{echo|foo}}</ref>}}\"}],\"dsr\":[0,98,null,null]}'
data-mw='{\"caption\":\"Undisplayed caption in inline image with ref: <span
about=\\\"#mwt3\\\" class=\\\"mw-ref\\\" id=\\\"cite_ref-1\\\"
rel=\\\"dc:references\\\" typeof=\\\"mw:Transclusion mw:Extension/ref\\\"
data-parsoid='{\\\"dsr\\\":[64,96,null,null],\\\"pi\\\":[[{\\\"k\\\":\\\"1\\\"}]]}'
data-mw='{\\\"parts\\\":[{\\\"template\\\":{\\\"target\\\":{\\\"wt\\\":\\\"echo\\\",\\\"href\\\":\\\"./Template:Echo\\\"},\\\"params\\\":{\\\"1\\\":{\\\"wt\\\":\\\"&lt;ref>{{echo|foo}}&lt;/ref>\\\"}},\\\"i\\\":0}}]}'><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></span><meta
typeof=\\\"mw:Transclusion mw:Extension/ref/Marker\\\" about=\\\"#mwt3\\\"
data-parsoid='{\\\"group\\\":\\\"\\\",\\\"name\\\":\\\"\\\",\\\"content\\\":\\\"foo\\\",\\\"hasRefInRef\\\":false,\\\"dsr\\\":[64,96,null,null],\\\"pi\\\":[[{\\\"k\\\":\\\"1\\\"}]]}'
data-mw='{\\\"parts\\\":[{\\\"template\\\":{\\\"target\\\":{\\\"wt\\\":\\\"echo\\\",\\\"href\\\":\\\"./Template:Echo\\\"},\\\"params\\\":{\\\"1\\\":{\\\"wt\\\":\\\"&lt;ref>{{echo|foo}}&lt;/ref>\\\"}},\\\"i\\\":0}}]}'/>\"}'><a
href=\"./File:Foobar.jpg\"
data-parsoid='{\"a\":{\"href\":\"./File:Foobar.jpg\"},\"sa\":{\"href\":\"File:Foobar.jpg\"}}'><img
resource=\"./File:Foobar.jpg\" src=\"//example.com/images/3/3a/Foobar.jpg\"
data-file-width=\"1941\" data-file-height=\"220\" data-file-type=\"bitmap\"
height=\"220\" width=\"1941\"
data-parsoid='{\"a\":{\"resource\":\"./File:Foobar.jpg\",\"height\":\"220\",\"width\":\"1941\"},\"sa\":{\"resource\":\"File:Foobar.jpg\"}}'/></a></span></p>\n\n<ol
class=\"mw-references references\" typeof=\"mw:Extension/references\"
about=\"#mwt7\" data-parsoid='{\"dsr\":[100,114,2,2]}'
data-mw='{\"name\":\"references\",\"attrs\":{}}'><li about=\"#cite_note-1\"
id=\"cite_note-1\"><a href=\"./Main_Page#cite_ref-1\"
rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span
id=\"mw-reference-text-cite_note-1\" class=\"mw-reference-text\"
data-parsoid=\"{}\">foo</span></li></ol>");
+add("html2html", "T93580: 3. Templated <ref> inside inline images", "<p
data-parsoid='{\"dsr\":[0,98,0,0]}'><span class=\"mw-default-size\"
typeof=\"mw:Image\"
data-parsoid='{\"optList\":[{\"ck\":\"caption\",\"ak\":\"Undisplayed caption in
inline image with ref:
{{echo|<ref>{{echo|foo}}</ref>}}\"}],\"dsr\":[0,98,null,null]}'
data-mw='{\"caption\":\"Undisplayed caption in inline image with ref: <span
about=\\\"#mwt3\\\" class=\\\"mw-ref\\\" id=\\\"cite_ref-1\\\"
rel=\\\"dc:references\\\" typeof=\\\"mw:Transclusion mw:Extension/ref\\\"
data-parsoid='{\\\"dsr\\\":[64,96,null,null],\\\"pi\\\":[[{\\\"k\\\":\\\"1\\\"}]]}'
data-mw='{\\\"parts\\\":[{\\\"template\\\":{\\\"target\\\":{\\\"wt\\\":\\\"echo\\\",\\\"href\\\":\\\"./Template:Echo\\\"},\\\"params\\\":{\\\"1\\\":{\\\"wt\\\":\\\"&lt;ref>{{echo|foo}}&lt;/ref>\\\"}},\\\"i\\\":0}}]}'><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></span>\"}'><a
href=\"./File:Foobar.jpg\"
data-parsoid='{\"a\":{\"href\":\"./File:Foobar.jpg\"},\"sa\":{\"href\":\"File:Foobar.jpg\"}}'><img
resource=\"./File:Foobar.jpg\" src=\"//example.com/images/3/3a/Foobar.jpg\"
data-file-width=\"1941\" data-file-height=\"220\" data-file-type=\"bitmap\"
height=\"220\" width=\"1941\"
data-parsoid='{\"a\":{\"resource\":\"./File:Foobar.jpg\",\"height\":\"220\",\"width\":\"1941\"},\"sa\":{\"resource\":\"File:Foobar.jpg\"}}'/></a></span></p>\n\n<ol
class=\"mw-references references\" typeof=\"mw:Extension/references\"
about=\"#mwt7\" data-parsoid='{\"dsr\":[100,114,2,2]}'
data-mw='{\"name\":\"references\",\"attrs\":{}}'><li about=\"#cite_note-1\"
id=\"cite_note-1\"><a href=\"./Main_Page#cite_ref-1\"
rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span
id=\"mw-reference-text-cite_note-1\" class=\"mw-reference-text\"
data-parsoid=\"{}\">foo</span></li></ol>");
add("html2html", "Subpage link", "<p data-parsoid='{\"dsr\":[0,38,0,0]}'><a
rel=\"mw:WikiLink\" href=\"./Wiki/Subpage_test/subpage\" title=\"Wiki/Subpage
test/subpage\"
data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Subpage_test/subpage\"},\"sa\":{\"href\":\"wiki/Subpage
test/subpage\"},\"dsr\":[0,38,28,2]}'>/subpage</a></p>\n");
add("html2html", "Subpage noslash link", "<p
data-parsoid='{\"dsr\":[0,37,0,0]}'><a rel=\"mw:WikiLink\"
href=\"./Wiki/Subpage_test/subpage\" title=\"Wiki/Subpage test/subpage\"
data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Subpage_test/subpage\"},\"sa\":{\"href\":\"wiki/Subpage
test/subpage\"},\"dsr\":[0,37,28,2]}'>subpage</a></p>\n");
add("html2html", "Render invalid page names as plain text (T53090)", "<p
data-parsoid='{\"dsr\":[0,172,0,0]}'>[[./../foo|bar]]\n[[foo�|bar]]\n[[foo/.|bar]]\n[[foo/..|bar]]\n<span
typeof=\"mw:Nowiki\"
data-parsoid='{\"dsr\":[59,89,8,9]}'>[[foo~~~bar]]</span>\n[[foo>bar]]\n[[foo[bar]]\n[[.]]\n[[..]]\n[[foo././bar]]\n[[foo<a
rel=\"mw:ExtLink\" href=\"http://example.com\"
data-parsoid='{\"targetOff\":166,\"contentOffsets\":[166,166],\"dsr\":[147,167,19,1]}'></a>xyz]]</p>\n\n<p
data-parsoid='{\"dsr\":[174,420,0,0]}'>[[<span about=\"#mwt36\"
typeof=\"mw:Transclusion\"
data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[176,193,null,null]}'
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"./../foo\"}},\"i\":0}}]}'>./../foo</span>|bar]]\n[[<span
about=\"#mwt37\" typeof=\"mw:Transclusion\"
data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[202,216,null,null]}'
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo/.\"}},\"i\":0}}]}'>foo/.</span>|bar]]\n[[<span
about=\"#mwt38\" typeof=\"mw:Transclusion\"
data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[225,240,null,null]}'
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo/..\"}},\"i\":0}}]}'>foo/..</span>|bar]]\n[[<span
about=\"#mwt39\" typeof=\"mw:Transclusion\"
data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[249,268,null,null]}'
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo~~~~bar\"}},\"i\":0}}]}'>foo~~~~bar</span>]]\n[[<span
about=\"#mwt40\" typeof=\"mw:Transclusion\"
data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[273,289,null,null]}'
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo>bar\"}},\"i\":0}}]}'>foo>bar</span>]]\n[[<span
about=\"#mwt41\" typeof=\"mw:Transclusion\"
data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[294,313,null,null]}'
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo././bar\"}},\"i\":0}}]}'>foo././bar</span>]]\n[[<span
about=\"#mwt42\" typeof=\"mw:Transclusion\"
data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[318,334,null,null]}'
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo{bar\"}},\"i\":0}}]}'>foo{bar</span>]]\n[[<span
about=\"#mwt43\" typeof=\"mw:Transclusion\"
data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[339,355,null,null]}'
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo}bar\"}},\"i\":0}}]}'>foo}bar</span>]]\n[[<span
about=\"#mwt44\" typeof=\"mw:Transclusion\"
data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[360,376,null,null]}'
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo[bar\"}},\"i\":0}}]}'>foo[bar</span>]]\n[[<span
about=\"#mwt45\" typeof=\"mw:Transclusion\"
data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[381,397,null,null]}'
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo]bar\"}},\"i\":0}}]}'>foo]bar</span>]]\n[[<span
about=\"#mwt46\" typeof=\"mw:Transclusion\"
data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[402,418,null,null]}'
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo<bar\"}},\"i\":0}}]}'>foo<bar</span>]]</p>\n");
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index f027649..32452ed 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -15653,9 +15653,9 @@
<references />
!! html/parsoid
-<p><span class="mw-default-size" typeof="mw:Image"
data-parsoid='{"optList":[{"ck":"caption","ak":"Undisplayed caption in inline
image with ref: <ref>foo</ref>"}]}' data-mw='{"caption":"Undisplayed
caption in inline image with ref: <span about=\"#mwt2\" class=\"mw-ref\"
id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\"
data-parsoid='{\"dsr\":[64,78,5,6]}'
data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-1\"},\"attrs\":{}}'><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></span><meta
typeof=\"mw:Extension/ref/Marker\" about=\"#mwt2\"
data-parsoid='{\"group\":\"\",\"name\":\"\",\"content\":\"foo\",\"hasRefInRef\":false,\"dsr\":[64,78,5,6]}'/>"}'><a
href="./File:Foobar.jpg"
data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"sa":{}}'><img
resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg"
data-file-width="1941" data-file-height="220" data-file-type="bitmap"
height="220" width="1941"
data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p>
+<p><span class="mw-default-size" typeof="mw:Image"
data-parsoid='{"optList":[{"ck":"caption","ak":"Undisplayed caption in inline
image with ref: <ref>foo</ref>"}]}' data-mw='{"caption":"Undisplayed
caption in inline image with ref: <span about=\"#mwt2\" class=\"mw-ref\"
id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\"
data-parsoid='{\"dsr\":[64,78,5,6]}'
data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-1\"},\"attrs\":{}}'><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></span>"}'><a
href="./File:Foobar.jpg"
data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"sa":{"href":"File:Foobar.jpg"}}'><img
resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg"
data-file-width="1941" data-file-height="220" data-file-type="bitmap"
height="220" width="1941"
data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p>
-<ol class="mw-references references" typeof="mw:Extension/references"
about="#mwt4" data-mw='{"name":"references","attrs":{}}'><li
about="#cite_note-1" id="cite_note-1"><a href="./Main_Page#cite_ref-1"
rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span
id="mw-reference-text-cite_note-1" class="mw-reference-text"
data-parsoid="{}">foo</span></li></ol>
+<ol class="mw-references references" typeof="mw:Extension/references"
about="#mwt4" data-mw='{"name":"references","attrs":{}}'><li
about="#cite_note-1" id="cite_note-1"><a href="./Main_Page#cite_ref-1"
rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span
id="mw-reference-text-cite_note-1"
class="mw-reference-text">foo</span></li></ol>
!! end
!! test
@@ -15665,9 +15665,9 @@
<references />
!! html/parsoid
-<p><span class="mw-default-size" typeof="mw:Image"
data-parsoid='{"optList":[{"ck":"caption","ak":"Undisplayed caption in inline
image with ref: {{echo|<ref>{{echo|foo}}</ref>}}"}]}'
data-mw='{"caption":"Undisplayed caption in inline image with ref: <span
about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-1\" rel=\"dc:references\"
typeof=\"mw:Transclusion mw:Extension/ref\"
data-parsoid='{\"dsr\":[64,96,null,null],\"pi\":[[{\"k\":\"1\"}]]}'
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"&lt;ref>{{echo|foo}}&lt;/ref>\"}},\"i\":0}}]}'><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></span><meta
typeof=\"mw:Transclusion mw:Extension/ref/Marker\" about=\"#mwt2\"
data-parsoid='{\"group\":\"\",\"name\":\"\",\"content\":\"foo\",\"hasRefInRef\":false,\"dsr\":[64,96,null,null],\"pi\":[[{\"k\":\"1\"}]]}'
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"&lt;ref>{{echo|foo}}&lt;/ref>\"}},\"i\":0}}]}'/>"}'><a
href="./File:Foobar.jpg"
data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"sa":{}}'><img
resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg"
data-file-width="1941" data-file-height="220" data-file-type="bitmap"
height="220" width="1941"
data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p>
+<p><span class="mw-default-size" typeof="mw:Image"
data-parsoid='{"optList":[{"ck":"caption","ak":"Undisplayed caption in inline
image with ref: {{echo|<ref>{{echo|foo}}</ref>}}"}]}'
data-mw='{"caption":"Undisplayed caption in inline image with ref: <span
about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-1\" rel=\"dc:references\"
typeof=\"mw:Transclusion mw:Extension/ref\"
data-parsoid='{\"dsr\":[64,96,null,null],\"pi\":[[{\"k\":\"1\"}]]}'
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"&lt;ref>{{echo|foo}}&lt;/ref>\"}},\"i\":0}}]}'><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></span>"}'><a
href="./File:Foobar.jpg"
data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"sa":{"href":"File:Foobar.jpg"}}'><img
resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg"
data-file-width="1941" data-file-height="220" data-file-type="bitmap"
height="220" width="1941"
data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p>
-<ol class="mw-references references" typeof="mw:Extension/references"
about="#mwt6" data-mw='{"name":"references","attrs":{}}'><li
about="#cite_note-1" id="cite_note-1"><a href="./Main_Page#cite_ref-1"
rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span
id="mw-reference-text-cite_note-1" class="mw-reference-text"
data-parsoid="{}">foo</span></li></ol>
+<ol class="mw-references references" typeof="mw:Extension/references"
about="#mwt6" data-mw='{"name":"references","attrs":{}}'><li
about="#cite_note-1" id="cite_note-1"><a href="./Main_Page#cite_ref-1"
rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span
id="mw-reference-text-cite_note-1"
class="mw-reference-text">foo</span></li></ol>
!! end
###
--
To view, visit https://gerrit.wikimedia.org/r/386461
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ied746f025a0ac7f14d922aff6640fef3aa4b55b0
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <[email protected]>
Gerrit-Reviewer: C. Scott Ananian <[email protected]>
Gerrit-Reviewer: Sbailey <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits