Page MenuHomePhabricator

No OneTemporary

This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/bin/parserTests.js b/bin/parserTests.js
index 0b9539a65..ec7af5a28 100755
--- a/bin/parserTests.js
+++ b/bin/parserTests.js
@@ -1,1498 +1,1497 @@
#!/usr/bin/env node
/*
* Parsoid test runner
*
* This pulls all the parserTests.txt items and runs them through Parsoid.
*/
'use strict';
require('../core-upgrade.js');
var serviceWrapper = require('../tests/serviceWrapper.js');
var fs = require('pn/fs');
var path = require('path');
var Alea = require('alea');
var DU = require('../lib/utils/DOMUtils.js').DOMUtils;
var TestUtils = require('../tests/TestUtils.js').TestUtils;
var Promise = require('../lib/utils/promise.js');
var ParsoidLogger = require('../lib/logger/ParsoidLogger.js').ParsoidLogger;
var PEG = require('pegjs');
var Util = require('../lib/utils/Util.js').Util;
var JSUtils = require('../lib/utils/jsutils.js').JSUtils;
// Fetch up some of our wacky parser bits...
var MWParserEnvironment = require('../lib/config/MWParserEnvironment.js').MWParserEnvironment;
var ParsoidConfig = require('../lib/config/ParsoidConfig.js').ParsoidConfig;
// be careful to load our extension code with the correct parent module.
var ParserHook = ParsoidConfig.loadExtension(
path.resolve(__dirname, '../tests/parserTestsParserHook.js')
);
var exitUnexpected = new Error('unexpected failure'); // unique marker value
/**
* Main class for the test environment.
*
* @class
*/
function ParserTests(testFilePath, modes) {
var parseFilePath = path.parse(testFilePath);
this.testFileName = parseFilePath.base;
this.testFilePath = testFilePath;
// Name of file used to cache the parser tests cases
this.cacheFileName = parseFilePath.name + '.cache';
this.cacheFilePath = path.resolve(parseFilePath.dir, this.cacheFileName);
var whiteListName = parseFilePath.name + '-whitelist.js';
this.whiteListPath = path.resolve(parseFilePath.dir, whiteListName);
try {
this.testWhiteList = require(this.whiteListPath).testWhiteList;
console.warn('Using whitelist from ' + this.whiteListPath);
} catch (e) {
this.testWhiteList = {};
}
var blackListName = parseFilePath.name + '-blacklist.js';
this.blackListPath = path.resolve(parseFilePath.dir, blackListName);
try {
this.testBlackList = require(this.blackListPath).testBlackList;
} catch (e) {
console.warn('No blacklist found at ' + this.blackListPath);
this.testBlackList = {};
}
this.articles = {};
this.tests = new Set();
// Test statistics
this.stats = {};
this.stats.passedTests = 0;
this.stats.passedTestsWhitelisted = 0;
this.stats.passedTestsUnexpected = 0;
this.stats.failedTests = 0;
this.stats.failedTestsUnexpected = 0;
var newModes = {};
for (var i = 0; i < modes.length; i++) {
newModes[modes[i]] = Util.clone(this.stats);
newModes[modes[i]].failList = [];
newModes[modes[i]].result = ''; // XML reporter uses this.
}
this.stats.modes = newModes;
}
/**
* Get an object holding our tests cases. Eventually from a cache file
*
* @method
* @param {Object} argv
* @return {Object}
*/
ParserTests.prototype.getTests = Promise.async(function *(argv) {
// Startup by loading .txt test file
var testFile = yield fs.readFile(this.testFilePath, 'utf8');
if (!Util.booleanOption(argv.cache)) {
// Cache not wanted, parse file and return object
return this.parseTestCase(testFile);
}
// Track files imported / required
var fileDependencies = [
this.testFilePath,
this.testParserFilePath,
];
// Find out modification time of all files dependencies and then hash those
// to make a unique value using sha1.
var mtimes = (yield Promise.all(
fileDependencies.sort().map(function(file) {
return fs.stat(file);
})
)).map(function(stat) { return stat.mtime; }).join('|');
var sha1 = require('crypto')
.createHash('sha1')
.update(mtimes)
.digest('hex');
// Look for a cacheFile
var cacheContent;
var cacheFileDigest;
try {
cacheContent = yield fs.readFile(this.cacheFilePath, 'utf8');
// Fetch previous digest
cacheFileDigest = cacheContent.match(/^CACHE: (\w+)\n/)[1];
} catch (e4) {
// cache file does not exist
}
if (cacheFileDigest === sha1) {
// cache file match our digest.
// Return contained object after removing first line (CACHE: <sha1>)
return JSON.parse(cacheContent.replace(/^.*\n/, ''));
} else {
// Write new file cache, content preprended with current digest
console.error("Cache file either not present or outdated");
var parse = this.parseTestCase(testFile);
yield fs.writeFile(this.cacheFilePath,
"CACHE: " + sha1 + "\n" + JSON.stringify(parse),
'utf8'
);
// We can now return the parsed object
return parse;
}
});
/**
* Parse content of tests case file given as plaintext.
*
* @param {string} content
* @return {Array}
*/
ParserTests.prototype.parseTestCase = function(content) {
return this.testParser.parse(content);
};
/**
* Convert a DOM to Wikitext.
*
* @method
* @param {Object} options
* @param {string} mode
* @param {Object} item
* @param {Node} body
* @return {Promise} a promise which will resolve to the wikitext
*/
ParserTests.prototype.convertHtml2Wt = Promise.async(function *(options, mode, item, body) {
try {
var startsAtWikitext = mode === 'wt2wt' || mode === 'wt2html' || mode === 'selser';
if (startsAtWikitext) {
// FIXME: All tests share an env.
// => we need to initialize this each time over here.
this.env.page.dom = DU.parseHTML(item.cachedBODYstr).body;
}
if (mode === 'selser') {
this.env.setPageSrcInfo(item.wikitext);
} else if (Util.booleanOption(options.use_source) && startsAtWikitext) {
this.env.setPageSrcInfo(item.wikitext);
} else {
this.env.setPageSrcInfo(null);
}
var handler = this.env.getContentHandler();
// yield and then return so our finally gets a chance to catch any
// exceptions thrown.
return (yield handler.fromHTML(this.env, body, (mode === 'selser')));
} finally {
this.env.setPageSrcInfo(null);
this.env.page.dom = null;
}
});
/**
* For a selser test, check if a change we could make has already been
* tested in this round.
* Used for generating unique tests.
*
* @param {Array} allChanges Already-tried changes.
* @param {Array} change Candidate change.
* @return {boolean}
*/
ParserTests.prototype.isDuplicateChangeTree = function(allChanges, change) {
if (!Array.isArray(allChanges)) {
return false;
}
var i;
for (i = 0; i < allChanges.length; i++) {
if (JSUtils.deepEquals(allChanges[i], change)) {
return true;
}
}
return false;
};
// Random string used as selser comment content
var staticRandomString = "ahseeyooxooZ8Oon0boh";
/**
* Make changes to a DOM in order to run a selser test on it.
*
* @param {Object} item
* @param {Node} body
* @param {Array} changelist
* @return {Node} The altered body.
*/
ParserTests.prototype.applyChanges = function(item, body, changelist) {
// Seed the random-number generator based on the item title
var random = new Alea((item.seed || '') + (item.title || ''));
// Keep the changes in the item object
// to check for duplicates while building tasks
item.changes = changelist;
// Helper function for getting a random string
function randomString() {
return random.uint32().toString(36);
}
function insertNewNode(n) {
// Insert a text node, if not in a fosterable position.
// If in foster position, enter a comment.
// In either case, dom-diff should register a new node
var str = randomString();
var ownerDoc = n.ownerDocument;
var wrapperName;
var newNode;
// Don't separate legacy IDs from their H? node.
if (n.nodeName === 'SPAN' &&
n.getAttribute('typeof') === 'mw:FallbackId') {
n = n.nextSibling || n.parentNode;
}
// For these container nodes, it would be buggy
// to insert text nodes as children
switch (n.parentNode.nodeName) {
case 'OL':
case 'UL': wrapperName = 'LI'; break;
case 'DL': wrapperName = 'DD'; break;
case 'TR':
var prev = n.previousElementSibling;
if (prev) {
// TH or TD
wrapperName = prev.nodeName;
} else {
var next = n.nextElementSibling;
if (next) {
// TH or TD
wrapperName = next.nodeName;
} else {
wrapperName = 'TD';
}
}
break;
case 'BODY': wrapperName = 'P'; break;
default:
if (DU.isBlockNodeWithVisibleWT(n)) {
wrapperName = 'P';
}
break;
}
if (DU.isFosterablePosition(n) && n.parentNode.nodeName !== 'TR') {
newNode = ownerDoc.createComment(str);
} else if (wrapperName) {
newNode = ownerDoc.createElement(wrapperName);
newNode.appendChild(ownerDoc.createTextNode(str));
} else {
newNode = ownerDoc.createTextNode(str);
}
n.parentNode.insertBefore(newNode, n);
}
var removeNode = (n) => {
n.parentNode.removeChild(n);
};
var applyChangesInternal = (node, changes) => {
if (!node) {
// FIXME: Generate change assignments dynamically
this.env.log("error", "no node in applyChangesInternal, ",
"HTML structure likely changed");
return;
}
// Clone the array since it could be modified below
var nodes = Array.from(node.childNodes);
for (var i = 0; i < changes.length; i++) {
var child = nodes[i];
var change = changes[i];
if (Array.isArray(change)) {
applyChangesInternal(child, change);
} else {
switch (change) {
// No change
case 0:
break;
// Change node wrapper
// (sufficient to insert a random attr)
case 1:
if (DU.isElt(child)) {
child.setAttribute('data-foobar', randomString());
} else {
this.env.log("error", "Buggy changetree. changetype 1 (modify attribute) cannot be applied on text/comment nodes.");
}
break;
// Insert new node before child
case 2:
insertNewNode(child);
break;
// Delete tree rooted at child
case 3:
removeNode(child);
break;
// Change tree rooted at child
case 4:
insertNewNode(child);
removeNode(child);
break;
}
}
}
};
if (this.env.conf.parsoid.dumpFlags &&
this.env.conf.parsoid.dumpFlags.has("dom:post-changes")) {
DU.dumpDOM(body, 'Original DOM');
}
if (item.changes === 5) {
// Hack so that we can work on the parent node rather than just the
// children: Append a comment with known content. This is later
// stripped from the output, and the result is compared to the
// original wikitext rather than the non-selser wt2wt result.
body.appendChild(body.ownerDocument.createComment(staticRandomString));
} else if (item.changes !== 0) {
applyChangesInternal(body, item.changes);
}
if (this.env.conf.parsoid.dumpFlags &&
this.env.conf.parsoid.dumpFlags.has("dom:post-changes")) {
console.warn("Change tree : " + JSON.stringify(item.changes));
DU.dumpDOM(body, 'Edited DOM');
}
return body;
};
/**
* Generate a change object for a document, so we can apply it during a selser test.
*
* @param {Object} options
* @param {Object} item
* @param {Node} body
* @return {Object} The body and change tree.
* @return {Node} [return.body] The altered body.
* @return {Array} [return.changeTree] The list of changes.
*/
ParserTests.prototype.generateChanges = function(options, item, body) {
var random = new Alea((item.seed || '') + (item.title || ''));
/**
* If no node in the DOM subtree rooted at 'node' is editable in the VE,
* this function should return false.
*
* Currently true for template and extension content, and for entities.
*/
function domSubtreeIsEditable(env, node) {
return !DU.isElt(node) ||
(!DU.isEncapsulationWrapper(node) &&
node.getAttribute("typeof") !== "mw:Entity" &&
// Deleting these div wrappers is tantamount to removing the
// reference tag encaption wrappers, which results in errors.
!/\bmw-references-wrap\b/.test(node.getAttribute("class")));
}
/**
* Even if a DOM subtree might be editable in the VE,
* certain nodes in the DOM might not be directly editable.
*
* Currently, this restriction is only applied to DOMs generated for images.
* Possibly, there are other candidates.
*/
function nodeIsUneditable(node) {
// Text and comment nodes are always editable
if (!DU.isElt(node)) {
return false;
}
// - Meta tag providing info about tpl-affected attrs is uneditable.
//
// SSS FIXME: This is not very useful right now because sometimes,
// these meta-tags are not siblings with the element that it applies to.
// So, you can still end up deleting the meta-tag (by deleting its parent)
// and losing this property. See example below. The best fix for this is
// to hoist all these kind of meta tags into <head>, start, or end of doc.
// Then, we don't even have to check for editability of these nodes here.
//
// Ex:
// ...
// <td><meta about="#mwt2" property="mw:objectAttrVal#style" ...>..</td>
// <td about="#mwt2" typeof="mw:ExpandedAttrs/Transclusion" ...>..</td>
// ...
if ((/\bmw:objectAttr/).test(node.getAttribute('property'))) {
return true;
}
// - Image wrapper is an uneditable image elt.
// - Any node nested in an image elt that is not a fig-caption
// is an uneditable image elt.
// - Entity spans are uneditable as well
return (/\bmw:(Image|Video|Audio|Entity)\b/).test(node.getAttribute('typeof')) ||
(
node.nodeName !== 'FIGCAPTION' &&
node.parentNode &&
node.parentNode.nodeName !== 'BODY' &&
nodeIsUneditable(node.parentNode)
);
}
var hasChangeMarkers = (list) => {
// If all recorded changes are 0, then nothing has been modified
return list.some(function(c) {
return Array.isArray(c) ? hasChangeMarkers(c) : (c > 0);
});
};
var genChangesInternal = (node) => {
// Seed the random-number generator based on the item title
var changelist = [];
var children = node.childNodes;
var n = children.length;
for (var i = 0; i < n; i++) {
var child = children[i];
var changeType = 0;
if (domSubtreeIsEditable(this.env, child)) {
if (nodeIsUneditable(child) || random() < 0.5) {
// This call to random is a hack to preserve the current
// determined state of our blacklist entries after a
// refactor.
random.uint32();
changeType = genChangesInternal(child);
} else {
if (!child.setAttribute) {
// Text or comment node -- valid changes: 2, 3, 4
// since we cannot set attributes on these
changeType = Math.floor(random() * 3) + 2;
} else {
changeType = Math.floor(random() * 4) + 1;
}
}
}
changelist.push(changeType);
}
return hasChangeMarkers(changelist) ? changelist : 0;
};
var changeTree;
var numAttempts = 0;
do {
numAttempts++;
changeTree = genChangesInternal(body);
} while (
numAttempts < 1000 &&
(changeTree.length === 0 || this.isDuplicateChangeTree(item.selserChangeTrees, changeTree))
);
if (numAttempts === 1000) {
// couldn't generate a change ... marking as such
item.duplicateChange = true;
}
return { body: body, changeTree: changeTree };
};
/**
* Apply manually-specified changes, which are provided in a pseudo-jQuery
* format.
*
* @param {Node} body
* @param {Array} changes
* @return {Node} The changed body.
*/
ParserTests.prototype.applyManualChanges = function(body, changes) {
var err = null;
// changes are specified using jquery methods.
// [x,y,z...] becomes $(x)[y](z....)
// that is, ['fig', 'attr', 'width', '120'] is interpreted as
// $('fig').attr('width', '120')
// See http://api.jquery.com/ for documentation of these methods.
// "contents" as second argument calls the jquery .contents() method
// on the results of the selector in the first argument, which is
// a good way to get at the text and comment nodes
var jquery = {
after: function(html) {
var div, tbl;
if (this.parentNode.nodeName === 'TBODY') {
tbl = this.ownerDocument.createElement('table');
tbl.innerHTML = html;
// <tbody> is implicitly added when inner html is set to <tr>..</tr>
DU.migrateChildren(tbl.firstChild, this.parentNode, this.nextSibling);
} else if (this.parentNode.nodeName === 'TR') {
tbl = this.ownerDocument.createElement('table');
tbl.innerHTML = '<tbody><tr></tr></tbody>';
tbl.firstChild.firstChild.innerHTML = html;
DU.migrateChildren(tbl.firstChild.firstChild, this.parentNode, this.nextSibling);
} else {
div = this.ownerDocument.createElement('div');
div.innerHTML = html;
DU.migrateChildren(div, this.parentNode, this.nextSibling);
}
},
attr: function(name, val) {
this.setAttribute(name, val);
},
before: function(html) {
var div, tbl;
if (this.parentNode.nodeName === 'TBODY') {
tbl = this.ownerDocument.createElement('table');
tbl.innerHTML = html;
// <tbody> is implicitly added when inner html is set to <tr>..</tr>
DU.migrateChildren(tbl.firstChild, this.parentNode, this);
} else if (this.parentNode.nodeName === 'TR') {
tbl = this.ownerDocument.createElement('table');
tbl.innerHTML = '<tbody><tr></tr></tbody>';
tbl.firstChild.firstChild.innerHTML = html;
DU.migrateChildren(tbl.firstChild.firstChild, this.parentNode, this);
} else {
div = this.ownerDocument.createElement('div');
div.innerHTML = html;
DU.migrateChildren(div, this.parentNode, this);
}
},
removeAttr: function(name) {
this.removeAttribute(name);
},
removeClass: function(c) {
this.classList.remove(c);
},
addClass: function(c) {
this.classList.add(c);
},
text: function(t) {
this.textContent = t;
},
html: function(h) {
this.innerHTML = h;
},
remove: function(optSelector) {
// jquery lets us specify an optional selector to further
// restrict the removed elements.
// text nodes don't have the "querySelectorAll" method, so
// just include them by default (jquery excludes them, which
// is less useful)
var what = !optSelector ? [ this ] :
!DU.isElt(this) ? [ this ] /* text node hack! */ :
this.querySelectorAll(optSelector);
Array.prototype.forEach.call(what, function(node) {
if (node.parentNode) { node.parentNode.removeChild(node); }
});
},
empty: function() {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
},
wrap: function(w) {
var frag = this.ownerDocument.createElement("div");
frag.innerHTML = w;
var first = frag.firstChild;
this.parentNode.replaceChild(first, this);
while (first.firstChild) {
first = first.firstChild;
}
first.appendChild(this);
}
};
changes.forEach(function(change) {
if (err) { return; }
if (change.length < 2) {
err = new Error('bad change: ' + change);
return;
}
// use document.querySelectorAll as a poor man's $(...)
var els = body.querySelectorAll(change[0]);
if (!els.length) {
err = new Error(change[0] + ' did not match any elements: ' + body.outerHTML);
return;
}
if (change[1] === 'contents') {
change = change.slice(1);
els = Array.prototype.reduce.call(els, function(acc, el) {
acc.push.apply(acc, el.childNodes);
return acc;
}, []);
}
var fun = jquery[change[1]];
if (!fun) {
err = new Error('bad mutator function: ' + change[1]);
return;
}
Array.prototype.forEach.call(els, function(el) {
fun.apply(el, change.slice(2));
});
});
if (err) {
console.log(err.toString().red);
throw err;
}
return body;
};
/**
* Convert a wikitext string to an HTML Node.
*
* @method
* @param {string} mode
* @param {string} wikitext
* @return {Promise} a promise returning the body Node.
*/
ParserTests.prototype.convertWt2Html = Promise.async(function *(mode, wikitext) {
var env = this.env;
env.setPageSrcInfo(wikitext);
var doc = yield env.getContentHandler().toHTML(env);
return doc.body;
});
/**
* @method
* @param {Object} item
* @param {Object} options
* @param {string} mode
* @return {Promise} a promise that is fulfilled when the test is complete
*/
ParserTests.prototype.prepareTest = Promise.async(function *(item, options, mode) {
if (!('title' in item)) {
throw new Error('Missing title from test case.');
}
item.time = {};
if (item.options) {
console.assert(item.options.extensions === undefined);
this.env.conf.wiki.namespacesWithSubpages[0] = false;
// Since we are reusing the 'env' object, set it to the default
// so that relative link prefix is back to "./"
this.env.initializeForPageName(this.env.conf.wiki.mainpage);
if (item.options.subpage !== undefined) {
this.env.conf.wiki.namespacesWithSubpages[0] = true;
}
if (item.options.title !== undefined &&
!Array.isArray(item.options.title)) {
// This sets the page name as well as the relative link prefix
// for the rest of the parse. Do this redundantly with the above
// so that we start from the wiki.mainpage when resolving
// absolute subpages.
this.env.initializeForPageName(item.options.title);
}
// Page language matches "wiki language" (which is set by
// the item 'language' option).
this.env.page.pagelanguage = this.env.conf.wiki.lang;
this.env.page.pagelanguagedir = this.env.conf.wiki.rtl ? 'rtl' : 'ltr';
this.env.conf.wiki.allowExternalImages = [ '' ]; // all allowed
if (item.options.wgallowexternalimages !== undefined &&
!/^(1|true|)$/.test(item.options.wgallowexternalimages)) {
this.env.conf.wiki.allowExternalImages = undefined;
}
// Process test-specific options
var defaults = {
scrubWikitext: MWParserEnvironment.prototype.scrubWikitext,
nativeGallery: MWParserEnvironment.prototype.nativeGallery,
wrapSections: false, // override for parser tests
};
var env = this.env;
Object.keys(defaults).forEach(function(opt) {
env[opt] = item.options.parsoid && item.options.parsoid.hasOwnProperty(opt) ?
item.options.parsoid[opt] : defaults[opt];
});
this.env.conf.wiki.responsiveReferences =
(item.options.parsoid && item.options.parsoid.responsiveReferences) ||
// The default for parserTests
{ enabled: false, threshold: 10 };
}
// Some useful booleans
var startsAtHtml = mode === 'html2html' || mode === 'html2wt';
var endsAtWikitext = mode === 'wt2wt' || mode === 'selser' || mode === 'html2wt';
var endsAtHtml = mode === 'wt2html' || mode === 'html2html';
var parsoidOnly =
('html/parsoid' in item) ||
(item.options.parsoid !== undefined && !item.options.parsoid.normalizePhp);
item.time.start = Date.now();
var body, wt;
// Source preparation
if (startsAtHtml) {
var html = item.html;
if (!parsoidOnly) {
// Strip some php output that has no wikitext representation
// (like .mw-editsection) and won't html2html roundtrip and
// therefore causes false failures.
html = TestUtils.normalizePhpOutput(html);
}
body = DU.parseHTML(html).body;
wt = yield this.convertHtml2Wt(options, mode, item, body);
} else { // startsAtWikitext
// Always serialize DOM to string and reparse before passing to wt2wt
if (item.cachedBODYstr === null) {
body = yield this.convertWt2Html(mode, item.wikitext);
// Caching stage 1 - save the result of the first two stages
// so we can maybe skip them later
// Cache parsed HTML
item.cachedBODYstr = DU.toXML(body);
// - In wt2html mode, pass through original DOM
// so that it is serialized just once.
// - In wt2wt and selser modes, pass through serialized and
// reparsed DOM so that fostering/normalization effects
// are reproduced.
if (mode === "wt2html") {
// body = body; // no-op
} else {
body = DU.parseHTML(item.cachedBODYstr).body;
}
} else {
body = DU.parseHTML(item.cachedBODYstr).body;
}
}
// Generate and make changes for the selser test mode
if (mode === 'selser') {
if ((options.selser === 'noauto' || item.changetree === 'manual') &&
item.options.parsoid && item.options.parsoid.changes) {
// Ensure that we have this set here in case it hasn't been
// set in buildTasks because the 'selser=noauto' option was passed.
item.changetree = 'manual';
body = this.applyManualChanges(body, item.options.parsoid.changes);
} else {
var changeTree = options.changetree ? JSON.parse(options.changetree) : item.changetree;
var r;
if (changeTree) {
r = { body: body, changeTree: changeTree };
} else {
r = this.generateChanges(options, item, body);
}
body = this.applyChanges(item, r.body, r.changeTree);
}
// Save the modified DOM so we can re-test it later
// Always serialize to string and reparse before passing to selser/wt2wt
item.changedHTMLStr = DU.toXML(body);
body = DU.parseHTML(item.changedHTMLStr).body;
} else if (mode === 'wt2wt') {
// handle a 'changes' option if present.
if (item.options.parsoid && item.options.parsoid.changes) {
body = this.applyManualChanges(body, item.options.parsoid.changes);
}
}
// Roundtrip stage
if (mode === 'wt2wt' || mode === 'selser') {
wt = yield this.convertHtml2Wt(options, mode, item, body);
} else if (mode === 'html2html') {
body = yield this.convertWt2Html(mode, wt);
}
// Processing stage
if (endsAtWikitext) {
yield this.processSerializedWT(item, options, mode, wt);
} else if (endsAtHtml) {
this.processParsedHTML(item, options, mode, body);
}
});
/**
* Check the given HTML result against the expected result, and throw an
* exception if necessary.
*
* @param {Object} item
* @param {Object} options
* @param {string} mode
* @param {Node} body
*/
ParserTests.prototype.processParsedHTML = function(item, options, mode, body) {
item.time.end = Date.now();
// Check the result vs. the expected result.
var checkPassed = this.checkHTML(item, body, options, mode);
// Only throw an error if --exit-unexpected was set and there was an error
// Otherwise, continue running tests
if (options['exit-unexpected'] && !checkPassed) {
throw exitUnexpected;
}
};
/**
* Check the given wikitext result against the expected result, and throw an
* exception if necessary.
*
* @method
* @param {Object} item
* @param {Object} options
* @param {string} mode
* @param {string} wikitext
* @return {Promise} a promise that will be fulfilled when the result
* has been checked.
*/
ParserTests.prototype.processSerializedWT = Promise.async(function *(item, options, mode, wikitext) {
item.time.end = Date.now();
if (mode === 'selser' && options.selser !== 'noauto') {
if (item.changetree === 5) {
item.resultWT = item.wikitext;
} else {
var body = DU.parseHTML(item.changedHTMLStr).body;
item.resultWT = yield this.convertHtml2Wt(options, 'wt2wt', item, body);
}
}
// Check the result vs. the expected result.
var checkPassed = this.checkWikitext(item, wikitext, options, mode);
// Only throw an error if --exit-unexpected was set and there was an error
// Otherwise, continue running tests
if (options['exit-unexpected'] && !checkPassed) {
throw exitUnexpected;
}
});
/**
* @param {Object} item
* @param {string} out
* @param {Object} options
*/
ParserTests.prototype.checkHTML = function(item, out, options, mode) {
var normalizedOut, normalizedExpected;
var parsoidOnly =
('html/parsoid' in item) ||
(item.options.parsoid !== undefined && !item.options.parsoid.normalizePhp);
- var preserveIEW = item.options.parsoid && item.options.parsoid.preserveIEW;
- normalizedOut = TestUtils.normalizeOut(out, parsoidOnly, preserveIEW);
+ normalizedOut = TestUtils.normalizeOut(out, parsoidOnly);
out = DU.toXML(out, { innerXML: true });
if (item.cachedNormalizedHTML === null) {
if (parsoidOnly) {
var normalDOM = DU.parseHTML(item.html).body;
- normalizedExpected = TestUtils.normalizeOut(normalDOM, parsoidOnly, preserveIEW);
+ normalizedExpected = TestUtils.normalizeOut(normalDOM, parsoidOnly);
} else {
normalizedExpected = TestUtils.normalizeHTML(item.html);
}
item.cachedNormalizedHTML = normalizedExpected;
} else {
normalizedExpected = item.cachedNormalizedHTML;
}
var input = mode === 'html2html' ? item.html : item.wikitext;
var expected = { normal: normalizedExpected, raw: item.html };
var actual = { normal: normalizedOut, raw: out, input: input };
return options.reportResult(this.testBlackList, this.testWhiteList, this.stats, item, options, mode, expected, actual);
};
/**
* @param {Object} item
* @param {string} out
* @param {Object} options
*/
ParserTests.prototype.checkWikitext = function(item, out, options, mode) {
var itemWikitext = item.wikitext;
out = out.replace(new RegExp('<!--' + staticRandomString + '-->', 'g'), '');
if (mode === 'selser' && item.resultWT !== null &&
item.changes !== 5 && item.changetree !== 'manual') {
itemWikitext = item.resultWT;
} else if ((mode === 'wt2wt' || (mode === 'selser' && item.changetree === 'manual')) &&
item.options.parsoid && item.options.parsoid.changes) {
itemWikitext = item['wikitext/edited'];
}
var toWikiText = mode === 'html2wt' || mode === 'wt2wt' || mode === 'selser';
// FIXME: normalization not in place yet
var normalizedExpected = toWikiText ? itemWikitext.replace(/\n+$/, '') : itemWikitext;
// FIXME: normalization not in place yet
var normalizedOut = toWikiText ? out.replace(/\n+$/, '') : out;
var input = mode === 'selser' ? item.changedHTMLStr :
mode === 'html2wt' ? item.html : itemWikitext;
var expected = { normal: normalizedExpected, raw: itemWikitext };
var actual = { normal: normalizedOut, raw: out, input: input };
return options.reportResult(this.testBlackList, this.testWhiteList, this.stats, item, options, mode, expected, actual);
};
/**
* @method
* @param {Object} [options]
* @param {String} [mockAPIServerURL]
* @return {Promise}
*/
ParserTests.prototype.main = Promise.async(function *(options, mockAPIServerURL) {
this.runDisabled = Util.booleanOption(options['run-disabled']);
this.runPHP = Util.booleanOption(options['run-php']);
// test case filtering
this.testFilter = null; // null is the 'default' by definition
if (options.filter || options.regex) {
// NOTE: filter.toString() is required because a number-only arg
// shows up as a numeric type rather than a string.
// Ex: parserTests.js --filter 53221
var pattern = options.regex || JSUtils.escapeRegExp(options.filter.toString());
this.testFilter = new RegExp(pattern);
}
this.testParserFilePath = path.join(__dirname, '../tests/parserTests.pegjs');
this.testParser = PEG.buildParser(yield fs.readFile(this.testParserFilePath, 'utf8'));
this.cases = yield this.getTests(options);
if (options.maxtests) {
var n = Number(options.maxtests);
console.warn('maxtests:' + n);
if (n > 0) {
this.cases.length = n;
}
}
var parsoidOptions = {};
Util.setDebuggingFlags(parsoidOptions, options);
Util.setTemplatingAndProcessingFlags(parsoidOptions, options);
var setup = function(parsoidConfig) {
// Init early so we can overwrite it here.
parsoidConfig.loadWMF = false;
parsoidConfig.initMwApiMap();
parsoidConfig.useBatchAPI = true;
// Needed for bidi-char-scrubbing html2wt tests.
parsoidConfig.scrubBidiChars = true;
var extensions = parsoidConfig.defaultNativeExtensions.concat(ParserHook);
// Send all requests to the mock API server.
Array.from(parsoidConfig.mwApiMap.values()).forEach(function(apiConf) {
parsoidConfig.removeMwApi(apiConf);
parsoidConfig.setMwApi({
prefix: apiConf.prefix,
domain: apiConf.domain,
uri: mockAPIServerURL,
extensions: extensions,
});
});
// This isn't part of the sitematrix but the
// "Check noCommafy in formatNum" test depends on it.
parsoidConfig.removeMwApi({ domain: 'be-tarask.wikipedia.org' });
parsoidConfig.setMwApi({
prefix: 'be-taraskwiki',
domain: 'be-tarask.wikipedia.org',
uri: mockAPIServerURL,
extensions: extensions,
});
// Enable sampling to assert it's working while testing.
parsoidConfig.loggerSampling = [
[/^warn(\/|$)/, 100],
];
parsoidConfig.timeouts.mwApi.connect = 10000;
};
var pc = new ParsoidConfig({ setup: setup }, parsoidOptions);
var logLevels;
if (Util.booleanOption(options.quiet)) {
logLevels = ["fatal", "error"];
}
// Create a new parser environment
var env = yield MWParserEnvironment.getParserEnv(pc, {
prefix: 'enwiki',
logLevels: logLevels,
});
this.env = env;
// A hint to enable some slow paths only while testing
env.immutable = true;
// Save default logger so we can be reset it after temporarily
// switching to the suppressLogger to suppress expected error
// messages.
this.defaultLogger = env.logger;
this.suppressLogger = new ParsoidLogger(env);
this.suppressLogger.registerLoggingBackends(["fatal"], pc);
// Override env's `setLogger` to record if we see `fatal` or `error`
// while running parser tests. (Keep it clean, folks! Use
// "suppressError" option on the test if error is expected.)
this.loggedErrorCount = 0;
env.setLogger = (function(parserTests, superSetLogger) {
return function(_logger) {
superSetLogger.call(this, _logger);
this.log = function(level) {
if (_logger !== parserTests.suppressLogger &&
/^(fatal|error)\b/.test(level)) {
parserTests.loggedErrorCount++;
}
return _logger.log.apply(_logger, arguments);
};
};
})(this, env.setLogger);
if (console.time && console.timeEnd) {
console.time('Execution time');
}
options.reportStart();
this.env.pageCache = this.articles;
this.comments = [];
return this.processCase(0, options, false);
});
/**
* FIXME: clean up this mess!
* - generate all changes at once (generateChanges should return a tree
* really) rather than going to all these lengths of interleaving change
* generation with tests
* - set up the changes in item directly rather than juggling around with
* indexes etc
* - indicate whether to compare to wt2wt or the original input
* - maybe make a full selser test one method that uses others rather than the
* current chain of methods that sometimes do something for selser
*
* @method
* @return {Promise}
*/
ParserTests.prototype.buildTasks = Promise.async(function *(item, targetModes, options) {
for (var i = 0; i < targetModes.length; i++) {
if (targetModes[i] === 'selser' && options.numchanges &&
options.selser !== 'noauto' && !options.changetree) {
var newitem;
// Prepend manual changes, if present, but not if 'selser' isn't
// in the explicit modes option.
if (item.options.parsoid && item.options.parsoid.changes) {
newitem = Util.clone(item);
// Mutating the item here is necessary to output 'manual' in
// the test's title and to differentiate it for blacklist.
// It can only get here in two cases:
// * When there's no changetree specified in the command line,
// buildTasks creates the items by cloning the original one,
// so there should be no problem setting it.
// In fact, it will override the existing 'manual' value
// (lines 1765 and 1767).
// * When a changetree is specified in the command line and
// it's 'manual', there shouldn't be a problem setting the
// value here as no other items will be processed.
// Still, protect against changing a different copy of the item.
console.assert(
newitem.changetree === 'manual' ||
newitem.changetree === undefined
);
newitem.changetree = 'manual';
yield this.prepareTest(newitem, options, 'selser');
}
// And if that's all we want, next one.
if (item.options.parsoid && item.options.parsoid.selser === 'noauto') {
continue;
}
item.selserChangeTrees = new Array(options.numchanges);
// Prepend a selser test that appends a comment to the root node
newitem = Util.clone(item);
newitem.changetree = 5;
yield this.prepareTest(newitem, options, 'selser');
for (var j = 0; j < item.selserChangeTrees.length; j++) {
var modeIndex = i;
var changesIndex = j;
newitem = Util.clone(item);
// Make sure we aren't reusing the one from manual changes
console.assert(newitem.changetree === undefined);
newitem.seed = changesIndex + '';
yield this.prepareTest(newitem, options, targetModes[modeIndex]);
if (this.isDuplicateChangeTree(item.selserChangeTrees, newitem.changes)) {
// Once we get a duplicate change tree, we can no longer
// generate and run new tests. So, be done now!
break;
} else {
item.selserChangeTrees[changesIndex] = newitem.changes;
}
}
} else {
if (targetModes[i] === 'selser' && options.selser === 'noauto') {
// Manual changes were requested on the command line,
// check that the item does have them.
if (item.options.parsoid && item.options.parsoid.changes) {
// If it does, we need to clone the item so that previous
// results don't clobber this one.
yield this.prepareTest(Util.clone(item), options, targetModes[i]);
} else {
// If it doesn't have manual changes, just skip it.
continue;
}
} else {
// A non-selser task, we can reuse the item.
yield this.prepareTest(item, options, targetModes[i]);
}
}
}
});
/**
* @method
* @return {Promise}
*/
ParserTests.prototype.processCase = Promise.async(function *(i, options, earlyExit) {
if (i < this.cases.length && !earlyExit) {
var item = this.cases[i];
var err = null;
try {
yield this.processItem(item, options);
} catch (e) {
err = e;
}
// There are two types of errors that reach here. The first is just
// a notification that a test failed. We use the error propagation
// mechanism to get back to this point to print the summary. The
// second type is an actual exception that we should hard fail on.
// exitUnexpected is a sentinel for the first type.
if (err && err !== exitUnexpected) {
throw err;
} else {
earlyExit = options['exit-unexpected'] && (err === exitUnexpected);
}
// FIXME: now that we're no longer using node-style callbacks,
// there's no reason we need to use recursion for this loop.
return this.processCase(i + 1, options, earlyExit);
} else {
// Sanity check in case any tests were removed but we didn't update
// the blacklist
var blacklistChanged = false;
var allModes = options.wt2html && options.wt2wt && options.html2wt &&
options.html2html && options.selser &&
!(options.filter || options.regex || options.maxtests);
// update the blacklist, if requested
if (allModes || Util.booleanOption(options['rewrite-blacklist'])) {
var old, oldExists;
if (yield fs.exists(this.blackListPath)) {
old = yield fs.readFile(this.blackListPath, 'utf8');
oldExists = true;
} else {
// Use the preamble from one we know about ...
var defaultBlPath = path.join(__dirname, '../tests/parserTests-blacklist.js');
old = yield fs.readFile(defaultBlPath, 'utf8');
oldExists = false;
}
var shell = old.split(/^.*DO NOT REMOVE THIS LINE.*$/m);
var contents = shell[0];
contents += '// ### DO NOT REMOVE THIS LINE ### ';
contents += '(start of automatically-generated section)\n';
options.modes.forEach((mode) => {
contents += '\n// Blacklist for ' + mode + '\n';
this.stats.modes[mode].failList.forEach(function(fail) {
contents += 'add(' + JSON.stringify(mode) + ', ' +
JSON.stringify(fail.title);
contents += ', ' + JSON.stringify(fail.raw);
contents += ');\n';
});
contents += '\n';
});
contents += '// ### DO NOT REMOVE THIS LINE ### ';
contents += '(end of automatically-generated section)';
contents += shell[2];
if (Util.booleanOption(options['rewrite-blacklist'])) {
yield fs.writeFile(this.blackListPath, contents, 'utf8');
} else if (allModes && oldExists) {
blacklistChanged = (contents !== old);
}
}
// Write updated tests from failed ones
if (options['update-tests'] ||
Util.booleanOption(options['update-unexpected'])) {
var updateFormat = (options['update-tests'] === 'raw') ?
'raw' : 'actualNormalized';
var parserTests = yield fs.readFile(this.testFilePath, 'utf8');
this.stats.modes.wt2html.failList.forEach(function(fail) {
if (options['update-tests'] || fail.unexpected) {
var exp = new RegExp("(" + /!!\s*test\s*/.source +
JSUtils.escapeRegExp(fail.title) + /(?:(?!!!\s*end)[\s\S])*/.source +
")(" + JSUtils.escapeRegExp(fail.expected) + ")", "m");
parserTests = parserTests.replace(exp, "$1" +
fail[updateFormat].replace(/\$/g, '$$$$'));
}
});
yield fs.writeFile(this.testFilePath, parserTests, 'utf8');
}
// print out the summary
// note: these stats won't necessarily be useful if someone
// reimplements the reporting methods, since that's where we
// increment the stats.
var failures = options.reportSummary(
options.modes, this.stats, this.testFileName,
this.loggedErrorCount, this.testFilter, blacklistChanged
);
// we're done!
// exit status 1 == uncaught exception
var exitCode = failures || blacklistChanged ? 2 : 0;
if (Util.booleanOption(options['exit-zero'])) {
exitCode = 0;
}
return {
exitCode: exitCode,
stats: Object.assign({
failures: failures,
loggedErrorCount: this.loggedErrorCount,
}, this.stats),
file: this.testFileName,
blacklistChanged: blacklistChanged,
};
}
});
/**
* @method
*/
ParserTests.prototype.processItem = Promise.async(function *(item, options) { // eslint-disable-line require-yield
if (typeof item !== 'object') {
// this is a comment line in the file, ignore it.
return;
}
if (!item.options) { item.options = {}; }
// backwards-compatibility aliases for section names.
if ('input' in item) { item.wikitext = item.input; delete item.input; }
if ('result' in item) { item.html = item.result; delete item.result; }
// html/* and html/parsoid should be treated as html.
[ 'html/*', 'html/*+tidy', 'html+tidy', 'html/parsoid' ].forEach(function(alt) {
if (alt in item) {
item.html = item[alt];
}
});
// ensure that test is not skipped if it has a wikitext/edited section
if ('wikitext/edited' in item) { item.html = true; }
// Reset the cached results for the new case.
// All test modes happen in a single run of processCase.
item.cachedBODYstr = null;
item.cachedNormalizedHTML = null;
// Also reset the logger, since we might have changed it to support
// the `suppressErrors` option.
this.env.setLogger(this.defaultLogger);
// Similarly for parsing resource limits.
this.env.setResourceLimits();
switch (item.type) {
case 'article':
this.comments = [];
return this.processArticle(item);
case 'test':
return this.processTest(item, options);
case 'comment':
this.comments.push(item.comment);
return;
case 'hooks':
this.comments = [];
this.env.log('warn', 'parserTests: Unhandled extension hook', JSON.stringify(item));
return;
case 'functionhooks':
this.comments = [];
this.env.log("warn", "parserTests: Unhandled functionhook", JSON.stringify(item));
return;
default:
this.comments = [];
return;
}
});
/**
* Process an article test case (ie the text of an article we need for a test).
*
* @param {Object} item
* @param {string} item.title
* @param {string} item.text
*/
ParserTests.prototype.processArticle = function(item) {
var key = this.env.normalizedTitleKey(item.title, false, true);
if (this.articles.hasOwnProperty(key)) {
throw new Error('Duplicate article: ' + item.title);
} else {
this.articles[key] = item.text;
}
};
/**
* @method
*/
ParserTests.prototype.processTest = Promise.async(function *(item, options) {
var targetModes = options.modes;
if (this.tests.has(item.title)) {
throw new Error('Duplicate titles: ' + item.title);
} else {
this.tests.add(item.title);
}
if (!('wikitext' in item && 'html' in item) ||
('disabled' in item.options && !this.runDisabled) ||
('php' in item.options &&
!('html/parsoid' in item || this.runPHP)) ||
(this.testFilter && item.title.search(this.testFilter) === -1)) {
// Skip test whose title does not match --filter
// or which is disabled or php-only
this.comments = [];
return;
}
// Add comments to following test.
item.comments = item.comments || this.comments;
this.comments = [];
var suppressErrors = item.options.parsoid && item.options.parsoid.suppressErrors;
if (suppressErrors) {
this.env.setLogger(this.suppressLogger);
}
if (item.options.parsoid && item.options.parsoid.modes) {
// Avoid filtering out the selser test
if (options.selser &&
item.options.parsoid.modes.indexOf("selser") < 0 &&
item.options.parsoid.modes.indexOf("wt2wt") >= 0
) {
item.options.parsoid.modes.push("selser");
}
targetModes = targetModes.filter(function(mode) {
return item.options.parsoid.modes.indexOf(mode) >= 0;
});
}
if (!targetModes.length) {
return;
}
// Honor language option in parserTests.txt
var prefix = item.options.language || 'enwiki';
if (!/wiki/.test(prefix)) {
// Convert to our enwiki.. format
prefix += 'wiki';
}
yield this.env.switchToConfig(prefix);
// TODO: set language variant
// adjust config to match that used for PHP tests
// see core/tests/parser/parserTest.inc:setupGlobals() for
// full set of config normalizations done.
var wikiConf = this.env.conf.wiki;
wikiConf.fakeTimestamp = 123;
wikiConf.timezoneOffset = 0; // force utc for parsertests
wikiConf.server = 'http://example.org';
wikiConf.scriptpath = '/';
wikiConf.script = '/index.php';
wikiConf.articlePath = '/wiki/$1';
wikiConf.interwikiMap.clear();
var iwl = TestUtils.iwl;
Object.keys(iwl).forEach(function(key) {
iwl[key].prefix = key;
wikiConf.interwikiMap.set(key, {});
Object.keys(iwl[key]).forEach(function(f) {
wikiConf.interwikiMap.get(key)[f] = iwl[key][f];
});
});
// Cannot modify namespaces otherwise since baseConfig is deep frozen.
wikiConf.siteInfo.namespaces = Util.clone(wikiConf.siteInfo.namespaces, true);
// Add 'MemoryAlpha' namespace (T53680)
TestUtils.addNamespace(wikiConf, {
"id": 100,
"case": "first-letter",
"canonical": "MemoryAlpha",
"*": "MemoryAlpha",
});
// Testing
if (wikiConf.iwp === 'enwiki') {
TestUtils.addNamespace(wikiConf, {
"id": 4,
"case": "first-letter",
"subpages": "",
"canonical": "Project",
"*": "Base MW",
});
TestUtils.addNamespace(wikiConf, {
"id": 5,
"case": "first-letter",
"subpages": "",
"canonical": "Project talk",
"*": "Base MW talk",
});
}
// Update $wgInterwikiMagic flag
// default (undefined) setting is true
this.env.conf.wiki.interwikimagic =
item.options.wginterwikimagic === undefined ||
/^(1|true|)$/.test(item.options.wginterwikimagic);
yield this.buildTasks(item, targetModes, options);
});
// Start the mock api server and kick off parser tests
Promise.async(function *() {
var options = TestUtils.prepareOptions();
var ret = yield serviceWrapper.runServices({ skipParsoid: true });
var runner = ret.runner;
var mockURL = ret.mockURL;
var testFilePaths;
if (options._[0]) {
testFilePaths = [path.resolve(process.cwd(), options._[0])];
} else {
var testDir = path.join(__dirname, '../tests/');
var testFilesPath = path.join(testDir, 'parserTests.json');
var testFiles = require(testFilesPath);
testFilePaths = Object.keys(testFiles).map(function(f) {
return path.join(testDir, f);
});
}
var stats = {
passedTests: 0,
passedTestsWhitelisted: 0,
passedTestsUnexpected: 0,
failedTests: 0,
failedTestsUnexpected: 0,
loggedErrorCount: 0,
failures: 0,
};
var blacklistChanged = false;
var exitCode = 0;
for (var i = 0; i < testFilePaths.length; i++) {
var testFilePath = testFilePaths[i];
var ptests = new ParserTests(testFilePath, options.modes);
var result = yield ptests.main(options, mockURL);
Object.keys(stats).forEach(function(k) {
stats[k] += result.stats[k]; // Sum all stats
});
blacklistChanged = blacklistChanged || result.blacklistChanged;
exitCode = exitCode || result.exitCode;
if (exitCode !== 0 && options['exit-unexpected']) { break; }
}
options.reportSummary([], stats, null, stats.loggedErrorCount, null, blacklistChanged);
yield runner.stop();
process.exit(exitCode);
})().done();
diff --git a/lib/config/WikitextConstants.js b/lib/config/WikitextConstants.js
index 2d9b1c60a..1e51663f5 100644
--- a/lib/config/WikitextConstants.js
+++ b/lib/config/WikitextConstants.js
@@ -1,482 +1,470 @@
/**
* The WikitextConstant structure holds "global constants" that
* capture properties about wikitext markup.
*
* Ex: Valid options for wikitext image markup
*
* This structure, over time, can come to serve as useful documentation
* about Wikitext itself.
*
* @module
*/
'use strict';
require('../../core-upgrade.js');
var JSUtils = require('../utils/jsutils.js').JSUtils;
/** @namespace */
var WikitextConstants = {
/**
* Valid media options:
* * Prefix options are of the form "alt=foo"
* * Simple options are of the form "center"
*
* @see [Wikipedia:Extended_image_syntax](http://en.wikipedia.org/wiki/Wikipedia:Extended_image_syntax)
* for more information about how they are used.
* @namespace
*/
Media: {
/** @type {Map} */
PrefixOptions: JSUtils.mapObject({
'img_link': 'link',
'img_alt': 'alt',
'img_page': 'page',
'img_lang': 'lang', // see T34987
'img_upright': 'upright',
'img_width': 'width',
'img_class': 'class',
'img_manualthumb': 'manualthumb',
'timedmedia_thumbtime': 'thumbtime',
'timedmedia_starttime': 'start',
'timedmedia_endtime': 'end',
'timedmedia_disablecontrols': 'disablecontrols', // See T135537
}),
/** @type {Map} */
SimpleOptions: JSUtils.mapObject({
// halign
'img_left': 'halign',
'img_right': 'halign',
'img_center': 'halign',
'img_none': 'halign',
// valign
'img_baseline': 'valign',
'img_sub': 'valign',
'img_super': 'valign',
'img_top': 'valign',
'img_text_top': 'valign',
'img_middle': 'valign',
'img_bottom': 'valign',
'img_text_bottom': 'valign',
// format
// 'border' can be given in addition to *one of*
// frameless, framed, or thumbnail
'img_border': 'border',
'img_frameless': 'format',
'img_framed': 'format',
'img_thumbnail': 'format',
// Ha! Upright can be either one! Try parsing THAT!
'img_upright': 'upright',
'timedmedia_noplayer': 'noplayer', // See T134880
'timedmedia_noicon': 'noicon', // See T134880
}),
},
/** @namespace */
Sanitizer: {
/**
* List of whitelisted tags that can be used as raw HTML in wikitext.
* All other html/html-like tags will be spit out as text.
* @type {Set}
*/
TagWhiteList: new Set([
// In case you were wondering, explicit <a .. > HTML is NOT allowed in wikitext.
// That is why the <a> tag is missing from the white-list.
'ABBR',
'B', 'BDI', 'BDO', 'BIG', 'BLOCKQUOTE', 'BR',
'CAPTION', 'CENTER', 'CITE', 'CODE',
'DATA', 'DD', 'DEL', 'DFN', 'DIV', 'DL', 'DT',
'EM',
'FONT',
'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'HR',
'I', 'INS',
'KBD',
'LI',
'MARK',
'OL',
'P', 'PRE',
'Q',
'RB', 'RP', 'RT', 'RTC', 'RUBY',
'S', 'SAMP', 'SMALL', 'SPAN', 'STRIKE', 'STRONG', 'SUB', 'SUP',
'TABLE', 'TD', 'TH', 'TIME', 'TR', 'TT',
'U', 'UL',
'VAR',
'WBR',
]),
},
/**
* These HTML tags have native wikitext representations.
* All other HTML tags would have to be emitted as HTML tags in wikitext.
* @type {Set}
*/
HTMLTagsWithWTEquivalents: new Set([
"A", "B", "P", "PRE",
"HR", "I", "IMG", "LINK", "META",
"H1", "H2", "H3", "H4", "H5", "H6",
"OL", "LI", "UL", "DD", "DL", "DT",
"FIGCAPTION", "FIGURE",
"TABLE", "TD", "TH", "TR", "CAPTION",
]),
- /**
- * These HTML tags come from native wikitext markup and
- * (as long as they are not literal HTML tags in the wikitext source)
- * should have whitespace trimmed from their content.
- * @type {Set}
- */
- WikitextTagsWithTrimmableWS: new Set([
- "H1", "H2", "H3", "H4", "H5", "H6",
- "OL", "LI", "UL", "DD", "DL", "DT",
- "TD", "TH", "CAPTION",
- ]),
-
/**
* These HTML tags will be generated only if
* the corresponding wikitext occurs in a SOL context.
* @type {Set}
*/
HTMLTagsRequiringSOLContext: new Set([
"PRE",
"H1", "H2", "H3", "H4", "H5", "H6",
"OL", "LI", "UL", "DD", "DL", "DT",
]),
/**
* These wikitext tags are composed with quote-chars.
* @type {Set}
*/
WTQuoteTags: new Set(['I', 'B']),
/**
* Leading whitespace on new lines in these elements does not lead to indent-pre.
* This only applies to immediate children (while skipping past zero-wikitext tags).
* (Ex: content in table-cells induce indent pres)
* @type {Set}
*/
WeakIndentPreSuppressingTags: new Set([
'TABLE', 'TBODY', 'TR',
]),
/**
* Leading whitespace on new lines in these elements does not lead to indent-pre.
* This applies to all nested content in these tags.
* Ex: content in table-cells nested in blocktags do not induce indent pres
*
* These tags should match `$openmatch` regexp in `doBlockLevels`:
* ```
* $openmatch = preg_match( '/(?:<table|<blockquote|<h1|<h2|<h3|<h4|<h5|<h6|<pre|<tr|<p|<ul|<ol|<dl|<li|<\\/tr|<\\/td|<\\/th)/iS', $t )
* ```
*
* PHP parser handling is line-based. Our handling is DOM-children based.
* So, there might be edge cases where behavior will be different.
* @type {Set}
*/
StrongIndentPreSuppressingTags: new Set([
'BLOCKQUOTE', 'PRE', 'P',
'H1', 'H2', 'H3', 'H4', 'H5', 'H6',
'UL', 'OL', 'DL', 'LI',
]),
/**
* Leading whitespace on new lines changes wikitext
* parsing for these tags (`*#;:=`).
* @type {Set}
*/
SolSpaceSensitiveTags: new Set([
'H1', 'H2', 'H3', 'H4', 'H5', 'H6',
'UL', 'OL', 'LI', 'DL', 'DD', 'DT',
]),
/**
* In the PHP parser, these block tags open block-tag scope.
* See `doBlockLevels` in the PHP parser (`includes/parser/Parser.php`).
* @type {Set}
*/
BlockScopeOpenTags: new Set([
'BLOCKQUOTE', 'PRE', 'P',
'H1', 'H2', 'H3', 'H4', 'H5', 'H6',
'UL', 'OL', 'LI', 'DL',
'TABLE', 'TR',
]),
/**
* In the PHP parser, these block tags close block-tag scope.
* See `doBlockLevels` in the PHP parser (`includes/parser/Parser.php`).
* @type {Set}
*/
BlockScopeCloseTags: new Set([
'TD', 'TH',
]),
/** @namespace */
HTML: {
/**
* The list of HTML5 tags, mainly used for the identification of *non*-html tags.
* Non-html tags terminate otherwise tag-eating rules in the tokenizer
* to support potential extension tags.
* @type {Set}
*/
HTML5Tags: new Set([
"A", "ABBR", "ADDRESS", "AREA", "ARTICLE",
"ASIDE", "AUDIO", "B", "BASE", "BDI", "BDO", "BLOCKQUOTE",
"BODY", "BR", "BUTTON", "CANVAS", "CAPTION", "CITE", "CODE",
"COL", "COLGROUP", "COMMAND", "DATA", "DATALIST", "DD", "DEL",
"DETAILS", "DFN", "DIV", "DL", "DT", "EM", "EMBED", "FIELDSET",
"FIGCAPTION", "FIGURE", "FOOTER", "FORM",
"H1", "H2", "H3", "H4", "H5", "H6", "HEAD", "HEADER", "HGROUP",
"HR", "HTML", "I", "IFRAME", "IMG", "INPUT", "INS", "KBD", "KEYGEN",
"LABEL", "LEGEND", "LI", "LINK", "MAP", "MARK", "MENU", "META",
"METER", "NAV", "NOSCRIPT", "OBJECT", "OL", "OPTGROUP", "OPTION",
"OUTPUT", "P", "PARAM", "PRE", "PROGRESS", "Q", "RB", "RP", "RT",
"RTC", "RUBY", "S", "SAMP", "SCRIPT", "SECTION", "SELECT", "SMALL",
"SOURCE", "SPAN", "STRONG", "STYLE", "SUB", "SUMMARY", "SUP",
"TABLE", "TBODY", "TD", "TEXTAREA", "TFOOT", "TH", "THEAD", "TIME",
"TITLE", "TR", "TRACK", "U", "UL", "VAR", "VIDEO", "WBR",
]),
/** From {@link http://www.w3.org/TR/html5-diff/#obsolete-elements}.
* SSS FIXME: basefont is missing here, but looks like the PHP parser
* does not support it anyway and treats it as plain text. So, skipping
* this one in Parsoid as well.
* @type {Set}
*/
OlderHTMLTags: new Set([
"STRIKE", "BIG", "CENTER", "FONT", "TT",
]),
/**
* From {@link https://developer.mozilla.org/en-US/docs/HTML/Block-level_elements}.
* However, you probably want to use `Util.isBlockTag()`, where some
* exceptions are being made.
* @type {Set}
*/
HTML4BlockTags: new Set([
'DIV', 'P',
// tables
'TABLE', 'TBODY', 'THEAD', 'TFOOT', 'CAPTION', 'TH', 'TR', 'TD',
// lists
'UL', 'OL', 'LI', 'DL', 'DT', 'DD',
// HTML5 heading content
'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'HGROUP',
// HTML5 sectioning content
'ARTICLE', 'ASIDE', 'NAV', 'SECTION', 'FOOTER', 'HEADER',
'FIGURE', 'FIGCAPTION', 'FIELDSET', 'DETAILS', 'BLOCKQUOTE',
// other
'HR', 'BUTTON', 'CANVAS', 'CENTER', 'COL', 'COLGROUP', 'EMBED',
'MAP', 'OBJECT', 'PRE', 'PROGRESS', 'VIDEO',
]),
/**
* From {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements}
* plus some non-strict elements not on that list (FONT, S, STRIKE, U) since
* these are tags that are actually used on wikipedias.
*
* All HTML5 formatting elements except NOBR are on this list.
* @type {Set}
*/
HTML4InlineTags: new Set([
'A', 'ABBR', /* 'ACRONYM', */
'B', 'BIG', 'BDO', 'BR', 'BUTTON',
'CITE', 'CODE',
'DFN',
'EM',
'FONT',
'I', 'IMG', 'INPUT',
'KBD',
'LABEL',
'MAP',
'Q',
'OBJECT',
'S', 'SAMP', 'SCRIPT', 'SELECT', 'SMALL', 'SPAN', 'STRIKE', 'STRONG', 'SUB', 'SUP',
'TEXTAREA', 'TIME', 'TT',
'U',
'VAR',
]),
/**
* @see http://www.w3.org/html/wg/drafts/html/master/syntax.html#formatting
* @type {Set}
*/
FormattingTags: new Set([
'A', 'B', 'BIG', 'CODE', 'EM', 'FONT', 'I', 'NOBR',
'S', 'SMALL', 'STRIKE', 'STRONG', 'TT', 'U',
]),
/** @type {Set} */
ListTags: new Set(['UL', 'OL', 'DL']),
/** @type {Set} */
ListItemTags: new Set(['LI', 'DD', 'DT']),
/** @type {Set} */
FosterablePosition: new Set(['TABLE', 'TBODY', 'TR']),
/** @type {Set} */
TableTags: new Set([
'TABLE', 'TBODY', 'THEAD', 'TFOOT', 'CAPTION', 'TH', 'TR', 'TD',
]),
/**
* Table tags that can be parents.
* @type {Set}
*/
ParentTableTags: new Set([
"TABLE", "TBODY", "THEAD", "TFOOT", "TR",
]),
/**
* Table tags that can be children.
* @type {Set}
*/
ChildTableTags: new Set([
"TBODY", "THEAD", "TFOOT", "TR", "CAPTION", "TH", "TD",
]),
/**
* @see http://www.whatwg.org/specs/web-apps/current-work/#void-elements
* @type {Set}
*/
VoidTags: new Set([
'AREA', 'BASE', 'BR', 'COL', 'COMMAND', 'EMBED', 'HR', 'IMG',
'INPUT', 'KEYGEN', 'LINK', 'META', 'PARAM', 'SOURCE',
'TRACK', 'WBR',
]),
},
/**
* These HTML tags have native wikitext representations.
* The wikitext equivalents do not have closing tags.
* @type {Set}
*/
WTTagsWithNoClosingTags: new Set([
"PRE", "LI", "DT", "DD", "HR", "TR", "TD", "TH"
]),
/** @namespace */
Output: {
/** @type {Set} */
FlaggedEmptyElts: new Set([
'LI', 'TR', 'P',
]),
},
/**
* Known wikitext tag widths. These are known statically
* but other widths are computed or updated based on actual wikitext usage.
* @type {Map}
*/
WtTagWidths: JSUtils.mapObject({
"BODY": [0, 0],
"HTML": [0, 0],
"HEAD": [0, 0],
"P": [0, 0],
"META": [0, 0],
"PRE": [1, 0],
"OL": [0, 0],
"UL": [0, 0],
"DL": [0, 0],
"LI": [1, 0],
"DT": [1, 0],
"DD": [1, 0],
"H1": [1, 1],
"H2": [2, 2],
"H3": [3, 3],
"H4": [4, 4],
"H5": [5, 5],
"H6": [6, 6],
"HR": [4, 0],
"TABLE": [2, 2],
"TBODY": [0, 0],
"THEAD": [0, 0],
"TFOOT": [0, 0],
"TR": [null, 0],
"TD": [null, 0],
"TH": [null, 0],
"B": [3, 3],
"I": [2, 2],
"BR": [0, 0],
"FIGURE": [2, 2],
}),
/**
* HTML tags whose wikitext equivalents are zero-width.
* This information is derived from WtTagWidths and set below.
* @type {Set}
*/
ZeroWidthWikitextTags: new Set(),
/**
* Map LanguageConverter wikitext flags to readable JSON field names.
* @type {Map}
*/
LCFlagMap: new Map([
// These first three flags are used internally during flag processing,
// but should never appear in the output wikitext, so we prepend them
// with '$'.
// 'S': Show converted text
[ '$S', 'show' ],
// '+': Add conversion rule
[ '$+', 'add' ],
// 'E': Error in the given flags
[ '$E', 'error' ],
// These rest of these are valid flags in wikitext.
// 'A': add conversion rule *and show converted text* (implies S)
[ 'A', 'add' ],
// 'T': Convert and override page title
[ 'T', 'title' ],
// 'R': Disable language conversion (exclusive flag)
[ 'R', 'disabled' ],
// 'D': Describe conversion rule (without adding to table)
[ 'D', 'describe' ],
// '-': Remove existing conversion rule (exclusive flag)
[ '-', 'remove' ],
// 'H': add rule for convert code (but no display in placed code )
[ 'H', '' ], // this is handled implicitly as a lack of 'show'
// 'N': Output current variant name (exclusive flag)
[ 'N', 'name' ],
]),
/**
* Map JSON field names to LanguageConverter wikitext flags.
* This information is derived from {@link .LCFlagMap} and set below.
* @type {Map}
*/
LCNameMap: new Map(),
};
// Derived information from 'WtTagWidths'
WikitextConstants.WtTagWidths.forEach(function(widths, tag) {
// This special case can be fixed by maybe removing them WtTagWidths.
// They may no longer be necessary -- to be investigated in another patch.
if (tag !== 'HTML' && tag !== 'HEAD' && tag !== 'BODY') {
if (widths[0] === 0 && widths[1] === 0) {
WikitextConstants.ZeroWidthWikitextTags.add(tag);
}
}
});
// Derived information from `LCFlagMap`
WikitextConstants.LCFlagMap.forEach(function(v,k) {
if (v) {
WikitextConstants.LCNameMap.set(v, k);
}
});
// Handle ambiguity in inverse mapping.
WikitextConstants.LCNameMap.set('add', 'A');
// Freeze constants to prevent accidental changes
JSUtils.deepFreeze(WikitextConstants);
if (typeof module === "object") {
module.exports.WikitextConstants = WikitextConstants;
}
diff --git a/lib/wt2html/pp/handlers/cleanup.js b/lib/wt2html/pp/handlers/cleanup.js
index c669ebfc2..eb48e4dea 100644
--- a/lib/wt2html/pp/handlers/cleanup.js
+++ b/lib/wt2html/pp/handlers/cleanup.js
@@ -1,244 +1,203 @@
/** @module */
'use strict';
var DU = require('../../../utils/DOMUtils.js').DOMUtils;
var Util = require('../../../utils/Util.js').Util;
var Consts = require('../../../config/WikitextConstants.js').WikitextConstants;
/**
*/
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.
var metaTestRE = /(?:^|\s)mw:(StartTag|EndTag|TSRMarker|Transclusion)\/?[^\s]*/;
if ((!rtTestMode && metaType === "mw:Placeholder/StrippedTag")
|| (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.
return nextNode;
} else {
return true;
}
}
/**
*/
function handleEmptyElements(node, env, unused, tplInfo) {
if (!DU.isElt(node) ||
!Consts.Output.FlaggedEmptyElts.has(node.nodeName) ||
node.attributes.length > 0 ||
!DU.nodeEssentiallyEmpty(node)
) {
return true;
}
// The node is known to be empty and a deletion candidate
// * If node is part of template content, it can be deleted
// (since we know it has no attributes, it won't be the
// first node that has about, typeof, and other attrs)
// * If not, we add the mw-empty-elt class so that wikis
// can decide what to do with them.
if (tplInfo) {
var nextNode = node.nextSibling;
DU.deleteNode(node);
return nextNode;
} else {
node.classList.add('mw-empty-elt');
return true;
}
}
function isRefText(node) {
while (!DU.atTheTop(node)) {
if (node.classList.contains("mw-reference-text")) {
return true;
}
node = node.parentNode;
}
return false;
}
-// Whitespace in this function refers to [ \t] only
-function trimWhiteSpace(node) {
- let c, next, prev;
-
- // Trim leading ws (on the first line)
- for (c = node.firstChild; c; c = next) {
- next = c.nextSibling;
- if (DU.isText(c) && c.data.match(/^[ \t]*$/)) {
- node.removeChild(c);
- } else if (!DU.isRenderingTransparentNode(c)) {
- break;
- }
- }
-
- if (DU.isText(c)) {
- c.data = c.data.replace(/^[ \t]+/, '');
- }
-
- // Trim trailing ws (on the last line)
- for (c = node.lastChild; c; c = prev) {
- prev = c.previousSibling;
- if (DU.isText(c) && c.data.match(/^[ \t]*$/)) {
- node.removeChild(c);
- } else if (!DU.isRenderingTransparentNode(c)) {
- break;
- }
- }
-
- if (DU.isText(c)) {
- c.data = c.data.replace(/[ \t]+$/, '');
- }
-}
-
/**
* Perform some final cleanup and save data-parsoid attributes on each node.
*/
function cleanupAndSaveDataParsoid(node, env, atTopLevel, tplInfo) {
if (!DU.isElt(node)) {
return true;
}
var dp = DU.getDataParsoid(node);
var next;
// Delete empty auto-inserted elements
if (dp.autoInsertedStart && dp.autoInsertedEnd &&
// template/extension content OR nodes with templated-attributes
!DU.hasParsoidAboutId(node) && (!node.hasChildNodes() ||
(DU.hasNChildren(node, 1) && !DU.isElt(node.firstChild) &&
/^\s*$/.test(node.textContent)))
) {
next = node.nextSibling;
if (node.firstChild) {
// migrate the ws out
node.parentNode.insertBefore(node.firstChild, node);
}
DU.deleteNode(node);
return next;
}
// Delete from data parsoid, wikitext originating autoInsertedEnd info
if (dp.autoInsertedEnd && !DU.hasLiteralHTMLMarker(dp) &&
Consts.WTTagsWithNoClosingTags.has(node.nodeName)) {
dp.autoInsertedEnd = undefined;
}
var isFirstEncapsulationWrapperNode = (tplInfo && tplInfo.first === node) ||
// Traversal isn't done with tplInfo for section tags, but we should
// still clean them up as if they are the head of encapsulation.
DU.isParsoidSectionTag(node);
// Remove dp.src from elements that have valid data-mw and dsr.
// This should reduce data-parsoid bloat.
//
// Presence of data-mw is a proxy for us knowing how to serialize
// this content from HTML. Token handlers should strip src for
// content where data-mw isn't necessary and html2wt knows how to
// handle the HTML markup.
var validDSR = DU.validDataMw(node) && Util.isValidDSR(dp.dsr);
var isPageProp = (node.nodeName === 'META' &&
/^mw\:PageProp\/(.*)$/.test(node.getAttribute('property')));
if (validDSR && !isPageProp) {
dp.src = undefined;
} else if (isFirstEncapsulationWrapperNode && (!atTopLevel || !dp.tsr)) {
// Transcluded nodes will not have dp.tsr set
// and don't need dp.src either.
dp.src = undefined;
}
// Remove tsr
if (dp.tsr) {
dp.tsr = undefined;
}
// Remove temporary information
dp.tmp = undefined;
// Make dsr zero-range for fostered content
// to prevent selser from duplicating this content
// outside the table from where this came.
//
// But, do not zero it out if the node has template encapsulation
// information. That will be disastrous (see T54638, T54488).
if (dp.fostered && dp.dsr && !isFirstEncapsulationWrapperNode) {
dp.dsr[0] = dp.dsr[1];
}
if (atTopLevel) {
// Strip nowiki spans from encapsulated content but leave behind
// wrappers on root nodes since they have valid about ids and we
// don't want to break the about-chain by stripping the wrapper
// and associated ids (we cannot add an about id on the nowiki-ed
// content since that would be a text node).
if (tplInfo && !DU.hasParsoidAboutId(node) &&
/^mw:Nowiki$/.test(node.getAttribute('typeof'))) {
next = node.nextSibling;
DU.migrateChildren(node, node.parentNode, next);
// Replace the span with an empty text node.
// (better for perf instead of deleting the node)
node.parentNode.replaceChild(node.ownerDocument.createTextNode(''), node);
return next;
}
- // Trim whitespace from some wikitext markup
- // not involving explicit HTML tags (T157481)
- if (!DU.hasLiteralHTMLMarker(dp) &&
- Consts.WikitextTagsWithTrimmableWS.has(node.nodeName)
- ) {
- trimWhiteSpace(node);
- }
-
var discardDataParsoid = env.discardDataParsoid;
// Strip data-parsoid from templated content, where unnecessary.
if (tplInfo
// Always keep info for the first node
&& !isFirstEncapsulationWrapperNode
// We can't remove data-parsoid from inside <references> text,
// as that's the only HTML representation we have left for it.
&& !isRefText(node)
// FIXME: We can't remove dp from nodes with stx information
// because the serializer uses stx information in some cases to
// emit the right newline separators.
//
// For example, "a\n\nb" and "<p>a</p><p>b/p>" both generate
// identical html but serialize to different wikitext.
//
// This is only needed for the last top-level node .
&& (!dp.stx || tplInfo.last !== node)
) {
discardDataParsoid = true;
}
DU.storeDataAttribs(node, {
discardDataParsoid: discardDataParsoid,
// Even though we're passing in the `env`, this is the only place
// we want the storage to happen, so don't refactor this in there.
storeInPageBundle: env.pageBundle,
env: env, // We only need the env in this case.
});
}
return true;
}
if (typeof module === "object") {
module.exports.cleanupAndSaveDataParsoid = cleanupAndSaveDataParsoid;
module.exports.handleEmptyElements = handleEmptyElements;
module.exports.stripMarkerMetas = stripMarkerMetas;
}
diff --git a/tests/TestUtils.js b/tests/TestUtils.js
index f32743921..12dbc7e7c 100644
--- a/tests/TestUtils.js
+++ b/tests/TestUtils.js
@@ -1,1161 +1,1167 @@
/**
* @module
*/
'use strict';
require('../core-upgrade.js');
var colors = require('colors');
var yargs = require('yargs');
var Diff = require('../lib/utils/Diff.js').Diff;
var DU = require('../lib/utils/DOMUtils.js').DOMUtils;
var Util = require('../lib/utils/Util.js').Util;
var TestUtils = {};
/**
* Specialized normalization of the wiki parser output, mostly to ignore a few
* known-ok differences. If parsoidOnly is true-ish, then we allow more
* markup through (like property and typeof attributes), for better
* checking of parsoid-only test cases.
*
* @param {string} out
* @param {boolean} [parsoidOnly=false]
* @return {string}
*/
-TestUtils.normalizeOut = function(out, parsoidOnly, preserveIEW) {
+TestUtils.normalizeOut = function(out, parsoidOnly) {
if (typeof (out) === 'string') {
out = DU.parseHTML(out).body;
}
var stripTypeof = parsoidOnly ?
/(?:^|mw:DisplaySpace\s+)mw:Placeholder$/ :
/^mw:(?:(?:DisplaySpace\s+mw:)?Placeholder|Nowiki|Transclusion|Entity)$/;
- var body = this.unwrapSpansAndNormalizeIEW(out, stripTypeof, parsoidOnly, preserveIEW);
- out = preserveIEW ? body.innerHTML : DU.toXML(body, { innerXML: true });
+ var body = this.normalizeIEW(out, stripTypeof, parsoidOnly);
+ out = DU.toXML(body, { innerXML: true });
// NOTE that we use a slightly restricted regexp for "attribute"
// which works for the output of DOM serialization. For example,
// we know that attribute values will be surrounded with double quotes,
// not unquoted or quoted with single quotes. The serialization
// algorithm is given by:
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#serializing-html-fragments
if (!/[^<]*(<\w+(\s+[^\0-\cZ\s"'>\/=]+(="[^"]*")?)*\/?>[^<]*)*/.test(out)) {
throw new Error("normalizeOut input is not in standard serialized form");
}
// Eliminate a source of indeterminacy from leaked strip markers
out = out.replace(/UNIQ-.*?-QINU/g, '');
// And from the imagemap extension - the id attribute is not always around, it appears!
out = out.replace(/<map name="ImageMap_[^"]*"( id="ImageMap_[^"]*")?>/g, '<map>');
if (parsoidOnly) {
// unnecessary attributes, we don't need to check these
// style is in there because we should only check classes.
out = out.replace(/ (data-parsoid|prefix|about|rev|datatype|inlist|usemap|vocab|content|style)=\\?"[^\"]*\\?"/g, '');
// single-quoted variant
out = out.replace(/ (data-parsoid|prefix|about|rev|datatype|inlist|usemap|vocab|content|style)=\\?'[^\']*\\?'/g, '');
// apos variant
out = out.replace(/ (data-parsoid|prefix|about|rev|datatype|inlist|usemap|vocab|content|style)=&apos;.*?&apos;/g, '');
// strip self-closed <nowiki /> because we frequently test WTS
// <nowiki> insertion by providing an html/parsoid section with the
// <meta> tags stripped out, allowing the html2wt test to verify that
// the <nowiki> is correctly added during WTS, while still allowing
// the html2html and wt2html versions of the test to pass as a
// sanity check. If <meta>s were not stripped, these tests would all
// have to be modified and split up. Not worth it at this time.
// (see commit 689b22431ad690302420d049b10e689de6b7d426)
out = out
.replace(/<span typeof="mw:Nowiki"><\/span>/g, '');
return out;
}
// Normalize headings by stripping out Parsoid-added ids so that we don't
// have to add these ids to every parser test that uses headings.
// We will test the id generation scheme separately via mocha tests.
out = out.replace(/(<h[1-6].*?) id="[^"]*"([^>]*>)/g, '$1$2');
// strip meta/link elements
out = out
.replace(/<\/?(?:meta|link)(?: [^\0-\cZ\s"'>\/=]+(?:=(?:"[^"]*"|'[^']*'))?)*\/?>/g, '');
// Ignore troublesome attributes.
// Strip JSON attributes like data-mw and data-parsoid early so that
// comment stripping in normalizeNewlines does not match unbalanced
// comments in wikitext source.
out = out.replace(/ (data-mw|data-parsoid|resource|rel|prefix|about|rev|datatype|inlist|property|usemap|vocab|content|class)="[^\"]*"/g, '');
// single-quoted variant
out = out.replace(/ (data-mw|data-parsoid|resource|rel|prefix|about|rev|datatype|inlist|property|usemap|vocab|content|class)='[^\']*'/g, '');
// strip typeof last
out = out.replace(/ typeof="[^\"]*"/g, '');
return out
// replace mwt ids
.replace(/ id="mw((t\d+)|([\w-]{2,}))"/g, '')
.replace(/<span[^>]+about="[^"]*"[^>]*>/g, '')
.replace(/(\s)<span>\s*<\/span>\s*/g, '$1')
.replace(/<span>\s*<\/span>/g, '')
.replace(/(href=")(?:\.?\.\/)+/g, '$1')
// replace unnecessary URL escaping
.replace(/ href="[^"]*"/g, Util.decodeURI)
// strip thumbnail size prefixes
.replace(/(src="[^"]*?)\/thumb(\/[0-9a-f]\/[0-9a-f]{2}\/[^\/]+)\/[0-9]+px-[^"\/]+(?=")/g, '$1$2');
};
/**
* Normalize newlines in IEW to spaces instead.
*
* @param {Node} body
* The document `<body>` node to normalize.
* @param {RegExp} [stripSpanTypeof]
* @param {boolean} [parsoidOnly=false]
* @return {Node}
*/
-TestUtils.unwrapSpansAndNormalizeIEW = function(body, stripSpanTypeof, parsoidOnly, preserveIEW) {
+TestUtils.normalizeIEW = function(body, stripSpanTypeof, parsoidOnly) {
var newlineAround = function(node) {
return node && /^(BODY|CAPTION|DIV|DD|DT|LI|P|TABLE|TR|TD|TH|TBODY|DL|OL|UL|H[1-6])$/.test(node.nodeName);
};
var unwrapSpan; // forward declare
var cleanSpans = function(node) {
var child, next;
if (!stripSpanTypeof) { return; }
for (child = node.firstChild; child; child = next) {
next = child.nextSibling;
if (child.nodeName === 'SPAN' &&
stripSpanTypeof.test(child.getAttribute('typeof') || '')) {
unwrapSpan(node, child);
}
}
};
unwrapSpan = function(parent, node) {
+ var child, next, placeholder;
// first recurse to unwrap any spans in the immediate children.
cleanSpans(node);
// now unwrap this span.
- DU.migrateChildren(node, parent, node);
- parent.removeChild(node);
+ placeholder = node.ownerDocument.createTextNode('XXX');
+ parent.replaceChild(placeholder, node);
+ for (child = node.firstChild; child; child = next) {
+ next = child.nextSibling;
+ parent.insertBefore(child, placeholder);
+ }
+ parent.removeChild(placeholder);
};
var visit = function(node, stripLeadingWS, stripTrailingWS, inPRE) {
var child, next, prev;
if (node.nodeName === 'PRE') {
// Preserve newlines in <pre> tags
inPRE = true;
}
- if (!preserveIEW && DU.isText(node)) {
+ if (DU.isText(node)) {
if (!inPRE) {
node.data = node.data.replace(/\s+/g, ' ');
}
if (stripLeadingWS) {
node.data = node.data.replace(/^\s+/, '');
}
if (stripTrailingWS) {
node.data = node.data.replace(/\s+$/, '');
}
}
// unwrap certain SPAN nodes
cleanSpans(node);
// now remove comment nodes
if (!parsoidOnly) {
for (child = node.firstChild; child; child = next) {
next = child.nextSibling;
if (DU.isComment(child)) {
node.removeChild(child);
}
}
}
// reassemble text nodes split by a comment or span, if necessary
node.normalize();
// now recurse.
if (node.nodeName === 'PRE') {
// hack, since PHP adds a newline before </pre>
stripLeadingWS = false;
stripTrailingWS = true;
} else if (node.nodeName === 'SPAN' &&
/^mw[:]/.test(node.getAttribute('typeof') || '')) {
// SPAN is transparent; pass the strip parameters down to kids
} else {
stripLeadingWS = stripTrailingWS = newlineAround(node);
}
child = node.firstChild;
// Skip over the empty mw:FallbackId <span> and strip leading WS
// on the other side of it.
if (/^H[1-6]$/.test(node.nodeName) &&
child && child.nodeName === 'SPAN' &&
child.getAttribute('typeof') === 'mw:FallbackId') {
child = child.nextSibling;
}
for (; child; child = next) {
next = child.nextSibling;
visit(child,
stripLeadingWS,
stripTrailingWS && !child.nextSibling,
inPRE);
stripLeadingWS = false;
}
- if (inPRE || preserveIEW) { return node; }
+ if (inPRE) { return node; }
// now add newlines around appropriate nodes.
for (child = node.firstChild; child; child = next) {
prev = child.previousSibling;
next = child.nextSibling;
if (newlineAround(child)) {
if (prev && DU.isText(prev)) {
prev.data = prev.data.replace(/\s*$/, '\n');
} else {
prev = node.ownerDocument.createTextNode('\n');
node.insertBefore(prev, child);
}
if (next && DU.isText(next)) {
next.data = next.data.replace(/^\s*/, '\n');
} else {
next = node.ownerDocument.createTextNode('\n');
node.insertBefore(next, child.nextSibling);
}
}
}
return node;
};
// clone body first, since we're going to destructively mutate it.
return visit(body.cloneNode(true), true, true, false);
};
/**
* Strip some php output we aren't generating.
*/
TestUtils.normalizePhpOutput = function(html) {
return html
// do not expect section editing for now
.replace(/<span[^>]+class="mw-headline"[^>]*>(.*?)<\/span> *(<span class="mw-editsection"><span class="mw-editsection-bracket">\[<\/span>.*?<span class="mw-editsection-bracket">\]<\/span><\/span>)?/g, '$1')
.replace(/<a[^>]+class="mw-headline-anchor"[^>]*>§<\/a>/g, '');
};
/**
* Normalize the expected parser output by parsing it using a HTML5 parser and
* re-serializing it to HTML. Ideally, the parser would normalize inter-tag
* whitespace for us. For now, we fake that by simply stripping all newlines.
*
* @param {string} source
* @return {string}
*/
TestUtils.normalizeHTML = function(source) {
try {
- var body = this.unwrapSpansAndNormalizeIEW(DU.parseHTML(source).body);
+ var body = this.normalizeIEW(DU.parseHTML(source).body);
var html = DU.toXML(body, { innerXML: true })
// a few things we ignore for now..
// .replace(/\/wiki\/Main_Page/g, 'Main Page')
// do not expect a toc for now
.replace(/<div[^>]+?id="toc"[^>]*>\s*<div id="toctitle"[^>]*>[\s\S]+?<\/div>[\s\S]+?<\/div>\s*/g, '');
return this.normalizePhpOutput(html)
// remove empty span tags
.replace(/(\s)<span>\s*<\/span>\s*/g, '$1')
.replace(/<span>\s*<\/span>/g, '')
// general class and titles, typically on links
.replace(/ (class|rel|about|typeof)="[^"]*"/g, '')
// strip red link markup, we do not check if a page exists yet
.replace(/\/index.php\?title=([^']+?)&amp;action=edit&amp;redlink=1/g, '/wiki/$1')
// strip red link title info
.replace(/ \((?:page does not exist|encara no existeix|bet ele jaratılmag'an|lonkásá ezalí tɛ̂)\)/g, '') // eslint-disable-line
// the expected html has some extra space in tags, strip it
.replace(/<a +href/g, '<a href')
.replace(/href="\/wiki\//g, 'href="')
.replace(/" +>/g, '">')
// parsoid always add a page name to lonely fragments
.replace(/href="#/g, 'href="Main Page#')
// replace unnecessary URL escaping
.replace(/ href="[^"]*"/g, Util.decodeURI)
// strip empty spans
.replace(/(\s)<span>\s*<\/span>\s*/g, '$1')
.replace(/<span>\s*<\/span>/g, '');
} catch (e) {
console.log("normalizeHTML failed on" +
source + " with the following error: " + e);
console.trace();
return source;
}
};
/**
* Colorize given number if <> 0.
*
* @param {number} count
* @param {string} color
* @return {string} Colorized count
*/
var colorizeCount = function(count, color) {
// We need a string to use colors methods
var s = count.toString();
if (count === 0 || !s[color]) {
return s;
}
return s[color] + '';
};
/**
* @param {Array} modesRan
* @param {Object} stats
* @param {number} stats.failedTests Number of failed tests due to differences in output.
* @param {number} stats.passedTests Number of tests passed without any special consideration.
* @param {number} stats.passedTestsWhitelisted Number of tests passed by whitelisting.
* @param {Object} stats.modes All of the stats (failedTests, passedTests, and passedTestsWhitelisted) per-mode.
* @param {string} file
* @param {number} loggedErrorCount
* @param {RegExp|null} testFilter
* @param {boolean} blacklistChanged
* @return {number} The number of failures.
*/
var reportSummary = function(modesRan, stats, file, loggedErrorCount, testFilter, blacklistChanged) {
var curStr, mode, thisMode;
var failTotalTests = stats.failedTests;
var happiness = (
stats.passedTestsUnexpected === 0 && stats.failedTestsUnexpected === 0
);
var filename = (file === null) ? "ALL TESTS" : file;
if (file === null) { console.log(); }
console.log("==========================================================");
console.log("SUMMARY:", happiness ? filename.green : filename.red);
if (console.time && console.timeEnd && file !== null) {
console.timeEnd('Execution time');
}
if (failTotalTests !== 0) {
for (var i = 0; i < modesRan.length; i++) {
mode = modesRan[i];
curStr = mode + ': ';
thisMode = stats.modes[mode];
curStr += colorizeCount(thisMode.passedTests + thisMode.passedTestsWhitelisted, 'green') + ' passed (';
curStr += colorizeCount(thisMode.passedTestsUnexpected, 'red') + ' unexpected, ';
curStr += colorizeCount(thisMode.passedTestsWhitelisted, 'yellow') + ' whitelisted) / ';
curStr += colorizeCount(thisMode.failedTests, 'red') + ' failed (';
curStr += colorizeCount(thisMode.failedTestsUnexpected, 'red') + ' unexpected)';
console.log(curStr);
}
curStr = 'TOTAL' + ': ';
curStr += colorizeCount(stats.passedTests + stats.passedTestsWhitelisted, 'green') + ' passed (';
curStr += colorizeCount(stats.passedTestsUnexpected, 'red') + ' unexpected, ';
curStr += colorizeCount(stats.passedTestsWhitelisted, 'yellow') + ' whitelisted) / ';
curStr += colorizeCount(stats.failedTests, 'red') + ' failed (';
curStr += colorizeCount(stats.failedTestsUnexpected, 'red') + ' unexpected)';
console.log(curStr);
if (file === null) {
console.log(colorizeCount(stats.passedTests + stats.passedTestsWhitelisted, 'green') +
' total passed tests (expected ' +
(stats.passedTests + stats.passedTestsWhitelisted - stats.passedTestsUnexpected + stats.failedTestsUnexpected) +
'), ' +
colorizeCount(failTotalTests , 'red') + ' total failures (expected ' +
(stats.failedTests - stats.failedTestsUnexpected + stats.passedTestsUnexpected) +
')');
}
} else {
if (testFilter !== null) {
console.log("Passed " + (stats.passedTests + stats.passedTestsWhitelisted) +
" of " + stats.passedTests + " tests matching " + testFilter +
"... " + "ALL TESTS PASSED!".green);
} else {
// Should not happen if it does: Champagne!
console.log("Passed " + stats.passedTests + " of " + stats.passedTests +
" tests... " + "ALL TESTS PASSED!".green);
}
}
// If we logged error messages, complain about it.
var logMsg = 'No errors logged.'.green;
if (loggedErrorCount > 0) {
logMsg = (loggedErrorCount + " errors logged.").red;
}
if (file === null) {
if (loggedErrorCount > 0) {
logMsg = ('' + loggedErrorCount).red;
} else {
logMsg = ('' + loggedErrorCount).green;
}
logMsg += ' errors logged.';
}
console.log(logMsg);
var failures = (
stats.passedTestsUnexpected +
stats.failedTestsUnexpected +
loggedErrorCount
);
// If the blacklist changed, complain about it.
if (blacklistChanged) {
console.log("Blacklist changed!".red);
}
if (file === null) {
if (failures === 0) {
console.log('--> ' + 'NO UNEXPECTED RESULTS'.green + ' <--');
if (blacklistChanged) {
console.log("Perhaps some tests were deleted or renamed.");
console.log("Use `bin/parserTests.js --rewrite-blacklist` to update blacklist.");
}
} else {
console.log(('--> ' + failures + ' UNEXPECTED RESULTS. <--').red);
}
}
return failures;
};
var prettyPrintIOptions = function(iopts) {
if (!iopts) { return ''; }
var ppValue = function(v) {
if (Array.isArray(v)) {
return v.map(ppValue).join(',');
}
if (typeof v !== 'string') {
return JSON.stringify(v);
}
if (/^\[\[[^\]]*\]\]$/.test(v) || /^[-\w]+$/.test(v)) {
return v;
}
return JSON.stringify(v);
};
return Object.keys(iopts).map(function(k) {
if (iopts[k] === '') { return k; }
return k + '=' + ppValue(iopts[k]);
}).join(' ');
};
var printWhitelistEntry = function(title, raw) {
console.log('WHITELIST ENTRY:'.cyan + '');
console.log('testWhiteList[' +
JSON.stringify(title) + '] = ' +
JSON.stringify(raw) + ';\n');
};
/**
* @param {Object} stats
* @param {Object} item
* @param {Object} options
* @param {string} mode
* @param {string} title
* @param {Object} actual
* @param {Object} expected
* @param {boolean} expectFail Whether this test was expected to fail (on blacklist).
* @param {boolean} failureOnly Whether we should print only a failure message, or go on to print the diff.
* @param {Object} bl BlackList.
* @return {boolean} True if the failure was expected.
*/
var printFailure = function(stats, item, options, mode, title, actual, expected, expectFail, failureOnly, bl) {
stats.failedTests++;
stats.modes[mode].failedTests++;
var fail = {
title: title,
raw: actual ? actual.raw : null,
expected: expected ? expected.raw : null,
actualNormalized: actual ? actual.normal : null,
};
stats.modes[mode].failList.push(fail);
var extTitle = (title + (mode ? (' (' + mode + ')') : ''))
.replace('\n', ' ');
var blacklisted = false;
if (Util.booleanOption(options.blacklist) && expectFail) {
// compare with remembered output
if (bl[title][mode] !== actual.raw) {
blacklisted = true;
} else {
if (!Util.booleanOption(options.quiet)) {
console.log('EXPECTED FAIL'.red + ': ' + extTitle.yellow);
}
return true;
}
}
stats.failedTestsUnexpected++;
stats.modes[mode].failedTestsUnexpected++;
fail.unexpected = true;
if (!failureOnly) {
console.log('=====================================================');
}
console.log('UNEXPECTED FAIL'.red.inverse + ': ' + extTitle.yellow);
if (blacklisted) {
console.log('Blacklisted, but the output changed!'.red);
}
if (mode === 'selser') {
if (item.hasOwnProperty('wt2wtPassed') && item.wt2wtPassed) {
console.log('Even worse, the non-selser wt2wt test passed!'.red);
} else if (actual && item.hasOwnProperty('wt2wtResult') &&
item.wt2wtResult !== actual.raw) {
console.log('Even worse, the non-selser wt2wt test had a different result!'.red);
}
}
if (!failureOnly) {
console.log(item.comments.join('\n'));
if (options) {
console.log('OPTIONS'.cyan + ':');
console.log(prettyPrintIOptions(item.options) + '\n');
}
console.log('INPUT'.cyan + ':');
console.log(actual.input + '\n');
console.log(options.getActualExpected(actual, expected, options.getDiff));
if (Util.booleanOption(options.printwhitelist)) {
printWhitelistEntry(title, actual.raw);
}
}
return false;
};
/**
* @param {Object} stats
* @param {Object} item
* @param {Object} options
* @param {string} mode
* @param {string} title
* @param {boolean} expectSuccess Whether this success was expected (or was this test blacklisted?).
* @param {boolean} isWhitelist Whether this success was due to a whitelisting.
* @return {boolean} True if the success was expected.
*/
var printSuccess = function(stats, item, options, mode, title, expectSuccess, isWhitelist) {
var quiet = Util.booleanOption(options.quiet);
if (isWhitelist) {
stats.passedTestsWhitelisted++;
stats.modes[mode].passedTestsWhitelisted++;
} else {
stats.passedTests++;
stats.modes[mode].passedTests++;
}
var extTitle = (title + (mode ? (' (' + mode + ')') : ''))
.replace('\n', ' ');
if (Util.booleanOption(options.blacklist) && !expectSuccess) {
stats.passedTestsUnexpected++;
stats.modes[mode].passedTestsUnexpected++;
console.log('UNEXPECTED PASS'.green.inverse +
(isWhitelist ? ' (whitelist)' : '') +
':' + extTitle.yellow);
return false;
}
if (!quiet) {
var outStr = 'EXPECTED PASS';
if (isWhitelist) {
outStr += ' (whitelist)';
}
outStr = outStr.green + ': ' + extTitle.yellow;
console.log(outStr);
if (mode === 'selser' && item.hasOwnProperty('wt2wtPassed') &&
!item.wt2wtPassed) {
console.log('Even better, the non-selser wt2wt test failed!'.red);
}
}
return true;
};
/**
* Print the actual and expected outputs.
*
* @param {Object} actual
* @param {string} actual.raw
* @param {string} actual.normal
* @param {Object} expected
* @param {string} expected.raw
* @param {string} expected.normal
* @param {Function} getDiff Returns a string showing the diff(s) for the test.
* @param {Object} getDiff.actual
* @param {Object} getDiff.expected
* @return {string}
*/
var getActualExpected = function(actual, expected, getDiff) {
let mkVisible =
s => s.replace(/\n/g, '\u21b5\n'.white).replace(/\xA0/g, '\u2423'.white);
if (colors.mode === 'none') {
mkVisible = s => s;
}
var returnStr = '';
returnStr += 'RAW EXPECTED'.cyan + ':\n';
returnStr += expected.raw + '\n';
returnStr += 'RAW RENDERED'.cyan + ':\n';
returnStr += actual.raw + '\n';
returnStr += 'NORMALIZED EXPECTED'.magenta + ':\n';
returnStr += mkVisible(expected.normal) + '\n';
returnStr += 'NORMALIZED RENDERED'.magenta + ':\n';
returnStr += mkVisible(actual.normal) + '\n';
returnStr += 'DIFF'.cyan + ':\n';
returnStr += getDiff(actual, expected);
return returnStr;
};
/**
* @param {Object} actual
* @param {string} actual.normal
* @param {Object} expected
* @param {string} expected.normal
* @return {string} Colorized diff
*/
var doDiff = function(actual, expected) {
// safe to always request color diff, because we set color mode='none'
// if colors are turned off.
var e = expected.normal.replace(/\xA0/g, '\u2423');
var a = actual.normal.replace(/\xA0/g, '\u2423');
return Diff.colorDiff(e, a, {
context: 2,
noColor: (colors.mode === 'none'),
});
};
/**
* @param {Function} reportFailure
* @param {Function} reportSuccess
* @param {Object} bl BlackList.
* @param {Object} wl WhiteList.
* @param {Object} stats
* @param {Object} item
* @param {Object} options
* @param {string} mode
* @param {Object} expected
* @param {Object} actual
* @param {Function} pre
* @param {Function} post
* @return {boolean} True if the result was as expected.
*/
function printResult(reportFailure, reportSuccess, bl, wl, stats, item, options, mode, expected, actual, pre, post) {
var title = item.title; // Title may be modified here, so pass it on.
var quick = Util.booleanOption(options.quick);
var parsoidOnly =
('html/parsoid' in item) || (item.options.parsoid !== undefined);
if (mode === 'selser') {
title += ' ' + (item.changes ? JSON.stringify(item.changes) : 'manual');
}
var whitelist = false;
var tb = bl[title];
var expectFail = (tb && tb.hasOwnProperty(mode));
var fail = (expected.normal !== actual.normal);
// Return whether the test was as expected, independent of pass/fail
var asExpected;
if (fail &&
Util.booleanOption(options.whitelist) &&
title in wl &&
TestUtils.normalizeOut(DU.parseHTML(wl[title]).body, parsoidOnly) === actual.normal
) {
whitelist = true;
fail = false;
}
if (mode === 'wt2wt') {
item.wt2wtPassed = !fail;
item.wt2wtResult = actual.raw;
}
// don't report selser fails when nothing was changed or it's a dup
if (mode === 'selser' && (item.changes === 0 || item.duplicateChange)) {
return true;
}
if (typeof pre === 'function') {
pre(stats, mode, title, item.time);
}
if (fail) {
asExpected = reportFailure(stats, item, options, mode, title, actual, expected, expectFail, quick, bl);
} else {
asExpected = reportSuccess(stats, item, options, mode, title, !expectFail, whitelist);
}
if (typeof post === 'function') {
post(stats, mode);
}
return asExpected;
}
var _reportOnce = false;
/**
* Simple function for reporting the start of the tests.
*
* This method can be reimplemented in the options of the ParserTests object.
*/
var reportStartOfTests = function() {
if (!_reportOnce) {
_reportOnce = true;
console.log('ParserTests running with node', process.version);
console.log('Initialization complete. Now launching tests.');
}
};
/**
* Get the actual and expected outputs encoded for XML output.
*
* @inheritdoc getActualExpected
*
* @return {string} The XML representation of the actual and expected outputs.
*/
var getActualExpectedXML = function(actual, expected, getDiff) {
var returnStr = '';
returnStr += 'RAW EXPECTED:\n';
returnStr += DU.encodeXml(expected.raw) + '\n\n';
returnStr += 'RAW RENDERED:\n';
returnStr += DU.encodeXml(actual.raw) + '\n\n';
returnStr += 'NORMALIZED EXPECTED:\n';
returnStr += DU.encodeXml(expected.normal) + '\n\n';
returnStr += 'NORMALIZED RENDERED:\n';
returnStr += DU.encodeXml(actual.normal) + '\n\n';
returnStr += 'DIFF:\n';
returnStr += DU.encodeXml(getDiff(actual, expected, false));
return returnStr;
};
/**
* Report the start of the tests output.
*
* @inheritdoc reportStart
*/
var reportStartXML = function() {};
/**
* Report the end of the tests output.
*
* @inheritdoc reportSummary
*/
var reportSummaryXML = function(modesRan, stats, file, loggedErrorCount, testFilter, blacklistChanged) {
if (file === null) {
/* Summary for all tests; not included in XML format output. */
return;
}
console.log('<testsuites file="' + file + '">');
for (var i = 0; i < modesRan.length; i++) {
var mode = modesRan[i];
console.log('<testsuite name="parserTests-' + mode + '">');
console.log(stats.modes[mode].result);
console.log('</testsuite>');
}
console.log('</testsuites>');
};
/**
* Print a failure message for a test in XML.
*
* @inheritdoc printFailure
*/
var reportFailureXML = function(stats, item, options, mode, title, actual, expected, expectFail, failureOnly, bl) {
stats.failedTests++;
stats.modes[mode].failedTests++;
var failEle = '';
var blacklisted = false;
if (Util.booleanOption(options.blacklist) && expectFail) {
// compare with remembered output
blacklisted = (bl[title][mode] === actual.raw);
}
if (!blacklisted) {
failEle += '<failure type="parserTestsDifferenceInOutputFailure">\n';
failEle += getActualExpectedXML(actual, expected, options.getDiff);
failEle += '\n</failure>';
stats.failedTestsUnexpected++;
stats.modes[mode].failedTestsUnexpected++;
stats.modes[mode].result += failEle;
}
};
/**
* Print a success method for a test in XML.
*
* @inheritdoc printSuccess
*/
var reportSuccessXML = function(stats, item, options, mode, title, expectSuccess, isWhitelist) {
if (isWhitelist) {
stats.passedTestsWhitelisted++;
stats.modes[mode].passedTestsWhitelisted++;
} else {
stats.passedTests++;
stats.modes[mode].passedTests++;
}
};
/**
* Print the result of a test in XML.
*
* @inheritdoc printResult
*/
var reportResultXML = function() {
function pre(stats, mode, title, time) {
var testcaseEle;
testcaseEle = '<testcase name="' + DU.encodeXml(title) + '" ';
testcaseEle += 'assertions="1" ';
var timeTotal;
if (time && time.end && time.start) {
timeTotal = time.end - time.start;
if (!isNaN(timeTotal)) {
testcaseEle += 'time="' + ((time.end - time.start) / 1000.0) + '"';
}
}
testcaseEle += '>';
stats.modes[mode].result += testcaseEle;
}
function post(stats, mode) {
stats.modes[mode].result += '</testcase>';
}
var args = Array.prototype.slice.call(arguments);
args = [ reportFailureXML, reportSuccessXML ].concat(args, pre, post);
printResult.apply(this, args);
// In xml, test all cases always
return true;
};
/**
* Get the options from the command line.
*
* @return {Object}
*/
var getOpts = function() {
var standardOpts = Util.addStandardOptions({
'wt2html': {
description: 'Wikitext -> HTML(DOM)',
'default': false,
'boolean': true,
},
'html2wt': {
description: 'HTML(DOM) -> Wikitext',
'default': false,
'boolean': true,
},
'wt2wt': {
description: 'Roundtrip testing: Wikitext -> DOM(HTML) -> Wikitext',
'default': false,
'boolean': true,
},
'html2html': {
description: 'Roundtrip testing: HTML(DOM) -> Wikitext -> HTML(DOM)',
'default': false,
'boolean': true,
},
'selser': {
description: 'Roundtrip testing: Wikitext -> DOM(HTML) -> Wikitext (with selective serialization). ' +
'Set to "noauto" to just run the tests with manual selser changes.',
'default': false,
'boolean': false,
},
'changetree': {
description: 'Changes to apply to parsed HTML to generate new HTML to be serialized (useful with selser)',
'default': null,
'boolean': false,
},
'use_source': {
description: 'Use original source in wt2wt tests',
'boolean': true,
'default': true,
},
'numchanges': {
description: 'Make multiple different changes to the DOM, run a selser test for each one.',
'default': 20,
'boolean': false,
},
'cache': {
description: 'Get tests cases from cache file',
'boolean': true,
'default': false,
},
'filter': {
description: 'Only run tests whose descriptions match given string',
},
'regex': {
description: 'Only run tests whose descriptions match given regex',
alias: ['regexp', 're'],
},
'run-disabled': {
description: 'Run disabled tests',
'default': false,
'boolean': true,
},
'run-php': {
description: 'Run php-only tests',
'default': false,
'boolean': true,
},
'maxtests': {
description: 'Maximum number of tests to run',
'boolean': false,
},
'quick': {
description: 'Suppress diff output of failed tests',
'boolean': true,
'default': false,
},
'quiet': {
description: 'Suppress notification of passed tests (shows only failed tests)',
'boolean': true,
'default': false,
},
'whitelist': {
description: 'Compare against manually verified parser output from whitelist',
'default': true,
'boolean': true,
},
'printwhitelist': {
description: 'Print out a whitelist entry for failing tests. Default false.',
'default': false,
'boolean': true,
},
'blacklist': {
description: 'Compare against expected failures from blacklist',
'default': true,
'boolean': true,
},
'rewrite-blacklist': {
description: 'Update parserTests-blacklist.js with failing tests.',
'default': false,
'boolean': true,
},
'exit-zero': {
description: "Don't exit with nonzero status if failures are found.",
'default': false,
'boolean': true,
},
xml: {
description: 'Print output in JUnit XML format.',
'default': false,
'boolean': true,
},
'exit-unexpected': {
description: 'Exit after the first unexpected result.',
'default': false,
'boolean': true,
},
'update-tests': {
description: 'Update parserTests.txt with results from wt2html fails.',
},
'update-unexpected': {
description: 'Update parserTests.txt with results from wt2html unexpected fails.',
'default': false,
'boolean': true,
},
}, {
// override defaults for standard options
fetchTemplates: false,
usePHPPreProcessor: false,
fetchConfig: false,
});
return yargs.usage(
'Usage: $0 [options] [tests-file]',
standardOpts
).check(function(argv, aliases) {
if (argv.filter === true) {
throw "--filter needs an argument";
}
if (argv.regex === true) {
throw "--regex needs an argument";
}
return true;
}).strict();
};
TestUtils.prepareOptions = function() {
var popts = getOpts();
var options = popts.argv;
if (options.help) {
popts.showHelp();
console.log("Additional dump options specific to parserTests script:");
console.log("* dom:post-changes : Dumps DOM after applying selser changetree\n");
console.log("Examples");
console.log("$ node parserTests --selser --filter '...' --dump dom:post-changes");
console.log("$ node parserTests --selser --filter '...' --changetree '...' --dump dom:post-changes\n");
process.exit(0);
}
Util.setColorFlags(options);
if (!(options.wt2wt || options.wt2html || options.html2wt || options.html2html || options.selser)) {
options.wt2wt = true;
options.wt2html = true;
options.html2html = true;
options.html2wt = true;
if (Util.booleanOption(options['rewrite-blacklist'])) {
// turn on all modes by default for --rewrite-blacklist
options.selser = true;
// sanity checking (T53448 asks to be able to use --filter here)
if (options.filter || options.regex || options.maxtests || options['exit-unexpected']) {
console.log("\nERROR> can't combine --rewrite-blacklist with --filter, --maxtests or --exit-unexpected");
process.exit(1);
}
}
}
if (options.xml) {
options.reportResult = reportResultXML;
options.reportStart = reportStartXML;
options.reportSummary = reportSummaryXML;
options.reportFailure = reportFailureXML;
colors.mode = 'none';
}
if (typeof options.reportFailure !== 'function') {
// default failure reporting is standard out,
// see printFailure for documentation of the default.
options.reportFailure = printFailure;
}
if (typeof options.reportSuccess !== 'function') {
// default success reporting is standard out,
// see printSuccess for documentation of the default.
options.reportSuccess = printSuccess;
}
if (typeof options.reportStart !== 'function') {
// default summary reporting is standard out,
// see reportStart for documentation of the default.
options.reportStart = reportStartOfTests;
}
if (typeof options.reportSummary !== 'function') {
// default summary reporting is standard out,
// see reportSummary for documentation of the default.
options.reportSummary = reportSummary;
}
if (typeof options.reportResult !== 'function') {
// default result reporting is standard out,
// see printResult for documentation of the default.
options.reportResult = printResult.bind(null, options.reportFailure, options.reportSuccess);
}
if (typeof options.getDiff !== 'function') {
// this is the default for diff-getting, but it can be overridden
// see doDiff for documentation of the default.
options.getDiff = doDiff;
}
if (typeof options.getActualExpected !== 'function') {
// this is the default for getting the actual and expected
// outputs, but it can be overridden
// see getActualExpected for documentation of the default.
options.getActualExpected = getActualExpected;
}
options.modes = [];
if (options.wt2html) {
options.modes.push('wt2html');
}
if (options.wt2wt) {
options.modes.push('wt2wt');
}
if (options.html2html) {
options.modes.push('html2html');
}
if (options.html2wt) {
options.modes.push('html2wt');
}
if (options.selser) {
options.modes.push('selser');
}
return options;
};
// Hard-code some interwiki prefixes, as is done
// in parserTest.inc:setupInterwikis()
TestUtils.iwl = {
local: {
url: 'http://doesnt.matter.org/$1',
localinterwiki: '',
},
wikipedia: {
url: 'http://en.wikipedia.org/wiki/$1',
},
meatball: {
// this has been updated in the live wikis, but the parser tests
// expect the old value (as set in parserTest.inc:setupInterwikis())
url: 'http://www.usemod.com/cgi-bin/mb.pl?$1',
},
memoryalpha: {
url: 'http://www.memory-alpha.org/en/index.php/$1',
},
zh: {
url: 'http://zh.wikipedia.org/wiki/$1',
language: '\u4e2d\u6587',
local: '',
},
es: {
url: 'http://es.wikipedia.org/wiki/$1',
language: 'espa\u00f1ol',
local: '',
},
fr: {
url: 'http://fr.wikipedia.org/wiki/$1',
language: 'fran\u00e7ais',
local: '',
},
ru: {
url: 'http://ru.wikipedia.org/wiki/$1',
language: '\u0440\u0443\u0441\u0441\u043a\u0438\u0439',
local: '',
},
mi: {
url: 'http://mi.wikipedia.org/wiki/$1',
// better for testing if one of the
// localinterwiki prefixes is also a
// language
language: 'Test',
local: '',
localinterwiki: '',
},
mul: {
url: 'http://wikisource.org/wiki/$1',
extralanglink: '',
linktext: 'Multilingual',
sitename: 'WikiSource',
local: '',
},
// not in PHP setupInterwikis(), but needed
en: {
url: 'http://en.wikipedia.org/wiki/$1',
language: 'English',
local: '',
protorel: '',
},
};
TestUtils.addNamespace = function(wikiConf, name) {
var nsid = name.id;
var old = wikiConf.siteInfo.namespaces[nsid];
if (old) { // Id may already be defined; if so, clear it.
if (old === name) { return; } // ParserTests does a lot redundantly.
wikiConf.namespaceIds.delete(Util.normalizeNamespaceName(old['*']));
wikiConf.canonicalNamespaces[Util.normalizeNamespaceName(old.canonical ? old.canonical : old['*'])] = undefined;
}
wikiConf.namespaceNames[nsid] = name['*'];
wikiConf.namespaceIds.set(Util.normalizeNamespaceName(name['*']), Number(nsid));
wikiConf.canonicalNamespaces[Util.normalizeNamespaceName(name.canonical ? name.canonical : name['*'])] = Number(nsid);
wikiConf.namespacesWithSubpages[nsid] = true;
wikiConf.siteInfo.namespaces[nsid] = name;
};
if (typeof module === "object") {
module.exports.TestUtils = TestUtils;
}
diff --git a/tests/citeParserTests-blacklist.js b/tests/citeParserTests-blacklist.js
index 18fb7d04c..880d4c1eb 100644
--- a/tests/citeParserTests-blacklist.js
+++ b/tests/citeParserTests-blacklist.js
@@ -1,865 +1,860 @@
/* A map of tests which we know Parsoid currently fails.
*
* New patches which fix previously-broken tests should also patch this
* file to document which tests are now expected to succeed.
*
* This helps clean up 'npm test' output, documents known bugs, and helps
* Jenkins make sense of the parserTest output.
*
* NOTE that the selser blacklist depends on tests/selser.changes.json
* If the selser change list is modified, this blacklist should be refreshed.
*
* This blacklist can be automagically updated by running
* parserTests.js --rewrite-blacklist
* You might want to do this after you fix some bug that makes more tests
* pass. It is still your responsibility to carefully review the blacklist
* diff to ensure there are no unexpected new failures (lines added).
*/
/*
* This should map test titles to an array of test types (wt2html, wt2wt,
* html2html, html2wt, selser) which are known to fail.
* For easier maintenance, we group each test type together, and use a
* helper function to create the array if needed then append the test type.
*/
'use strict';
var testBlackList = {};
var add = function(mode, title, raw) { // eslint-disable-line
if (typeof (testBlackList[title]) !== 'object') {
testBlackList[title] = {};
}
testBlackList[title][mode] = raw;
};
// ### DO NOT REMOVE THIS LINE ### (start of automatically-generated section)
// Blacklist for wt2html
add("wt2html", "Simple <ref>, no <references/>", "<p data-parsoid='{\"dsr\":[0,58,0,0]}'>Wikipedia rocks!<sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[16,58,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;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt3\" data-parsoid='{\"dsr\":[58,58,0,0]}' data-mw='{\"name\":\"references\",\"attrs\":{},\"autoGenerated\":true}'><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=\"{}\">Proceeds of Rockology, vol. XXI</span></li></ol>");
add("wt2html", "Simple <ref>, with <references/>", "<p data-parsoid='{\"dsr\":[0,58,0,0]}'>Wikipedia rocks!<sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[16,58,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;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt4\" data-parsoid='{\"dsr\":[60,73,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=\"{}\">Proceeds of Rockology, vol. XXI</span></li></ol>");
add("wt2html", "<ref> with a simple template", "<p data-parsoid='{\"dsr\":[0,40,0,0]}'>Templating<sup about=\"#mwt5\" class=\"mw-ref\" id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[10,40,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;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt4\" data-parsoid='{\"dsr\":[42,55,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=\"{}\"><span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[15,34,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"simple template\",\"href\":\"./Template:Simple_template\"},\"params\":{},\"i\":0}}]}'>A </span><i about=\"#mwt2\" data-parsoid=\"{}\">simple</i><span about=\"#mwt2\" data-parsoid=\"{}\"> template.</span></span></li></ol>");
add("wt2html", "<ref> with a <nowiki>", "<p data-parsoid='{\"dsr\":[0,57,0,0]}'>Templating<sup about=\"#mwt3\" class=\"mw-ref\" id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[10,57,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;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt5\" data-parsoid='{\"dsr\":[59,72,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=\"{}\">{{simple template}}</span></li></ol>");
add("wt2html", "<ref> in a <nowiki>", "<p data-parsoid='{\"dsr\":[0,57,0,0]}'>Templating<span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[10,57,8,9]}'>&lt;ref>{{simple template}}&lt;/ref></span></p>\n\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt3\" data-parsoid='{\"dsr\":[59,72,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{}}'></ol>");
add("wt2html", "<ref> in a <!--comment-->", "<p data-parsoid='{\"dsr\":[0,10,0,0]}'>Templating</p><!--<ref&#x3E;{{simple template}}</ref&#x3E;-->\n\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt2\" data-parsoid='{\"dsr\":[49,62,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{}}'></ol>");
add("wt2html", "<!--comment--> in a <ref> (bug 5384)", "<p data-parsoid='{\"dsr\":[0,39,0,0]}'>Templating<sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[10,39,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;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt4\" data-parsoid='{\"dsr\":[41,54,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=\"{}\">Text<!--comment--></span></li></ol>");
add("wt2html", "<references> after <gallery> (bug 6164)", "<p data-parsoid='{\"dsr\":[0,14,0,0]}'><sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[0,14,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;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n\n<ul class=\"gallery mw-gallery-traditional\" typeof=\"mw:Extension/gallery\" about=\"#mwt6\" data-parsoid='{\"dsr\":[16,51,2,2]}' data-mw='{\"name\":\"gallery\",\"attrs\":{},\"body\":{\"extsrc\":\"Image:Foobar.jpg\"}}'>\n<li class=\"gallerybox\" style=\"width: 155px;\"><div class=\"thumb\" style=\"width: 150px; height: 150px;\"><figure-inline typeof=\"mw:Image\"><a href=\"./File:Foobar.jpg\"><img resource=\"./File:Foobar.jpg\" src=\"//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg\" data-file-width=\"1941\" data-file-height=\"220\" data-file-type=\"bitmap\" height=\"14\" width=\"120\"/></a></figure-inline></div><div class=\"gallerytext\"></div></li>\n</ul>\n\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt5\" data-parsoid='{\"dsr\":[53,66,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=\"{}\">one</span></li></ol>");
add("wt2html", "{{REVISIONID}} on page with <ref> (bug 6299)", "<p data-parsoid='{\"dsr\":[0,30,0,0]}'><span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[0,14,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"REVISIONID\",\"function\":\"revisionid\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_revisionid missing in Parsoid.</span><sup about=\"#mwt3\" class=\"mw-ref\" id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[14,30,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;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt4\" data-parsoid='{\"dsr\":[30,30,0,0]}' data-mw='{\"name\":\"references\",\"attrs\":{},\"autoGenerated\":true}'><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=\"{}\">elite</span></li></ol>");
add("wt2html", "{{REVISIONID}} on page without <ref> (bug 6299 sanity check)", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,14,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"REVISIONID\",\"function\":\"revisionid\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_revisionid missing in Parsoid.</p>");
add("wt2html", "Ref with content followed by blank ref", "<p data-parsoid='{\"dsr\":[0,31,0,0]}'><sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-blank_1-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[0,31,18,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-blank-1\"},\"attrs\":{\"name\":\"blank\"}}'><a href=\"./Main_Page#cite_note-blank-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n\n<p data-parsoid='{\"dsr\":[33,52,0,0]}'><sup about=\"#mwt4\" class=\"mw-ref\" id=\"cite_ref-blank_1-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[33,52,19,0]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"blank\"}}'><a href=\"./Main_Page#cite_note-blank-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt6\" data-parsoid='{\"dsr\":[54,67,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{}}'><li about=\"#cite_note-blank-1\" id=\"cite_note-blank-1\"><span rel=\"mw:referencedBy\"><a href=\"./Main_Page#cite_ref-blank_1-0\"><span class=\"mw-linkback-text\">1 </span></a><a href=\"./Main_Page#cite_ref-blank_1-1\"><span class=\"mw-linkback-text\">2 </span></a></span> <span id=\"mw-reference-text-cite_note-blank-1\" class=\"mw-reference-text\" data-parsoid=\"{}\">content</span></li></ol>");
add("wt2html", "Blank ref followed by ref with content", "<p data-parsoid='{\"dsr\":[0,19,0,0]}'><sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-blank_1-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[0,19,19,0]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"blank\"}}'><a href=\"./Main_Page#cite_note-blank-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n\n<p data-parsoid='{\"dsr\":[21,52,0,0]}'><sup about=\"#mwt4\" class=\"mw-ref\" id=\"cite_ref-blank_1-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[21,52,18,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-blank-1\"},\"attrs\":{\"name\":\"blank\"}}'><a href=\"./Main_Page#cite_note-blank-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt6\" data-parsoid='{\"dsr\":[54,67,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{}}'><li about=\"#cite_note-blank-1\" id=\"cite_note-blank-1\"><span rel=\"mw:referencedBy\"><a href=\"./Main_Page#cite_ref-blank_1-0\"><span class=\"mw-linkback-text\">1 </span></a><a href=\"./Main_Page#cite_ref-blank_1-1\"><span class=\"mw-linkback-text\">2 </span></a></span> <span id=\"mw-reference-text-cite_note-blank-1\" class=\"mw-reference-text\" data-parsoid=\"{}\">content</span></li></ol>");
add("wt2html", "Regression: non-blank ref \"0\" followed by ref with content", "<p data-parsoid='{\"dsr\":[0,25,0,0]}'><sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-blank_1-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[0,25,18,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-blank-1\"},\"attrs\":{\"name\":\"blank\"}}'><a href=\"./Main_Page#cite_note-blank-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n\n<p data-parsoid='{\"dsr\":[27,58,0,0]}'><sup about=\"#mwt4\" class=\"mw-ref\" id=\"cite_ref-blank_1-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[27,58,18,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"html\":\"content\"},\"attrs\":{\"name\":\"blank\"}}'><a href=\"./Main_Page#cite_note-blank-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt6\" data-parsoid='{\"dsr\":[60,73,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{}}'><li about=\"#cite_note-blank-1\" id=\"cite_note-blank-1\"><span rel=\"mw:referencedBy\"><a href=\"./Main_Page#cite_ref-blank_1-0\"><span class=\"mw-linkback-text\">1 </span></a><a href=\"./Main_Page#cite_ref-blank_1-1\"><span class=\"mw-linkback-text\">2 </span></a></span> <span id=\"mw-reference-text-cite_note-blank-1\" class=\"mw-reference-text\" data-parsoid=\"{}\">0</span></li></ol>");
add("wt2html", "Regression sanity check: non-blank ref \"1\" followed by ref with content", "<p data-parsoid='{\"dsr\":[0,25,0,0]}'><sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-blank_1-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[0,25,18,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-blank-1\"},\"attrs\":{\"name\":\"blank\"}}'><a href=\"./Main_Page#cite_note-blank-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n\n<p data-parsoid='{\"dsr\":[27,58,0,0]}'><sup about=\"#mwt4\" class=\"mw-ref\" id=\"cite_ref-blank_1-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[27,58,18,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"html\":\"content\"},\"attrs\":{\"name\":\"blank\"}}'><a href=\"./Main_Page#cite_note-blank-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt6\" data-parsoid='{\"dsr\":[60,73,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{}}'><li about=\"#cite_note-blank-1\" id=\"cite_note-blank-1\"><span rel=\"mw:referencedBy\"><a href=\"./Main_Page#cite_ref-blank_1-0\"><span class=\"mw-linkback-text\">1 </span></a><a href=\"./Main_Page#cite_ref-blank_1-1\"><span class=\"mw-linkback-text\">2 </span></a></span> <span id=\"mw-reference-text-cite_note-blank-1\" class=\"mw-reference-text\" data-parsoid=\"{}\">1</span></li></ol>");
add("wt2html", "Ref names containing a number", "<p data-parsoid='{\"dsr\":[0,95,0,0]}'><sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-test123test_1-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[0,33,24,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-test123test-1\"},\"attrs\":{\"name\":\"test123test\"}}'><a href=\"./Main_Page#cite_note-test123test-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup>\n<sup about=\"#mwt4\" class=\"mw-ref\" id=\"cite_ref-123test_2-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[34,63,20,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-123test-2\"},\"attrs\":{\"name\":\"123test\"}}'><a href=\"./Main_Page#cite_note-123test-2\" style=\"counter-reset: mw-Ref 2;\"><span class=\"mw-reflink-text\">[2]</span></a></sup>\n<sup about=\"#mwt6\" class=\"mw-ref\" id=\"cite_ref-test123_3-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[64,95,20,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-test123-3\"},\"attrs\":{\"name\":\"test123\"}}'><a href=\"./Main_Page#cite_note-test123-3\" style=\"counter-reset: mw-Ref 3;\"><span class=\"mw-reflink-text\">[3]</span></a></sup></p>\n\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt8\" data-parsoid='{\"dsr\":[97,111,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{}}'><li about=\"#cite_note-test123test-1\" id=\"cite_note-test123test-1\"><a href=\"./Main_Page#cite_ref-test123test_1-0\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-test123test-1\" class=\"mw-reference-text\" data-parsoid=\"{}\">One</span></li><li about=\"#cite_note-123test-2\" id=\"cite_note-123test-2\"><a href=\"./Main_Page#cite_ref-123test_2-0\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-123test-2\" class=\"mw-reference-text\" data-parsoid=\"{}\">Two</span></li><li about=\"#cite_note-test123-3\" id=\"cite_note-test123-3\"><a href=\"./Main_Page#cite_ref-test123_3-0\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-test123-3\" class=\"mw-reference-text\" data-parsoid=\"{}\">Three</span></li></ol>");
add("wt2html", "Erroneous refs", "<p data-parsoid='{\"dsr\":[0,24,0,0]}'><sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-0_1-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[0,24,14,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-0-1\"},\"attrs\":{\"name\":\"0\"}}'><a href=\"./Main_Page#cite_note-0-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n\n<p data-parsoid='{\"dsr\":[26,77,0,0]}'><sup about=\"#mwt4\" class=\"mw-ref\" id=\"cite_ref-2\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[26,77,5,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-2\"},\"attrs\":{}}'><a href=\"./Main_Page#cite_note-2\" style=\"counter-reset: mw-Ref 2;\"><span class=\"mw-reflink-text\">[2]</span></a></sup></p>\n\n<p data-parsoid='{\"dsr\":[79,86,0,0]}'><sup about=\"#mwt6\" class=\"mw-ref\" id=\"cite_ref-3\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[79,86,7,0]}' data-mw='{\"name\":\"ref\",\"attrs\":{}}'><a href=\"./Main_Page#cite_note-3\" style=\"counter-reset: mw-Ref 3;\"><span class=\"mw-reflink-text\">[3]</span></a></sup></p>\n\n<p data-parsoid='{\"dsr\":[88,117,0,0]}'><sup about=\"#mwt8\" class=\"mw-ref\" id=\"cite_ref-bar_4-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[88,117,29,0]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"bar\"}}'><a href=\"./Main_Page#cite_note-bar-4\" style=\"counter-reset: mw-Ref 4;\"><span class=\"mw-reflink-text\">[4]</span></a></sup></p>\n\n<p data-parsoid='{\"dsr\":[119,154,0,0]}'><sup about=\"#mwt10\" class=\"mw-ref\" id=\"cite_ref-blankwithnoreference_5-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[119,154,35,0]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"blankwithnoreference\"}}'><a href=\"./Main_Page#cite_note-blankwithnoreference-5\" style=\"counter-reset: mw-Ref 5;\"><span class=\"mw-reflink-text\">[5]</span></a></sup></p>\n\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt12\" data-parsoid='{\"dsr\":[156,184,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{}}'><li about=\"#cite_note-0-1\" id=\"cite_note-0-1\"><a href=\"./Main_Page#cite_ref-0_1-0\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-0-1\" class=\"mw-reference-text\" data-parsoid=\"{}\">Zero</span></li><li about=\"#cite_note-2\" id=\"cite_note-2\"><a href=\"./Main_Page#cite_ref-2\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-2\" class=\"mw-reference-text\" data-parsoid=\"{}\">Also zero, but differently! (Normal ref)</span></li><li about=\"#cite_note-3\" id=\"cite_note-3\"><a href=\"./Main_Page#cite_ref-3\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-3\" class=\"mw-reference-text\" data-parsoid=\"{}\"></span></li><li about=\"#cite_note-bar-4\" id=\"cite_note-bar-4\"><a href=\"./Main_Page#cite_ref-bar_4-0\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-bar-4\" class=\"mw-reference-text\" data-parsoid=\"{}\"></span></li><li about=\"#cite_note-blankwithnoreference-5\" id=\"cite_note-blankwithnoreference-5\"><a href=\"./Main_Page#cite_ref-blankwithnoreference_5-0\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-blankwithnoreference-5\" class=\"mw-reference-text\" data-parsoid=\"{}\"></span></li></ol>\n\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt14\" data-parsoid='{\"dsr\":[186,200,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{}}'></ol>");
add("wt2html", "Simple <ref>, with <references/> in group", "<p data-parsoid='{\"dsr\":[0,128,0,0]}'>Wikipedia rocks!<sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[16,58,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;\"><span class=\"mw-reflink-text\">[1]</span></a></sup>\nWikipedia rocks!<sup about=\"#mwt4\" class=\"mw-ref\" id=\"cite_ref-2\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[75,128,16,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-2\"},\"attrs\":{\"group\":\"note\"}}'><a href=\"./Main_Page#cite_note-2\" style=\"counter-reset: mw-Ref 1;\" data-mw-group=\"note\"><span class=\"mw-reflink-text\">[note 1]</span></a></sup></p>\n\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt6\" data-parsoid='{\"dsr\":[130,143,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=\"{}\">Proceeds of Rockology, vol. XXI</span></li></ol>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt8\" data-mw-group=\"note\" data-parsoid='{\"group\":\"note\",\"dsr\":[144,168,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{\"group\":\"note\"}}'><li about=\"#cite_note-2\" id=\"cite_note-2\"><a href=\"./Main_Page#cite_ref-2\" data-mw-group=\"note\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-2\" class=\"mw-reference-text\" data-parsoid=\"{}\">Proceeds of Rockology, vol. XXI</span></li></ol>");
add("wt2html", "Simple <ref>, with <references/> in group, with groupname in Chinese", "<p data-parsoid='{\"dsr\":[0,88,0,0]}'>AAA<sup about=\"#mwt4\" class=\"mw-ref\" id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[3,29,15,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-1\"},\"attrs\":{\"group\":\"参\"}}'><a href=\"./Main_Page#cite_note-1\" style=\"counter-reset: mw-Ref 1;\" data-mw-group=\"参\"><span class=\"mw-reflink-text\">[参 1]</span></a></sup>BBB<sup about=\"#mwt5\" class=\"mw-ref\" id=\"cite_ref-2\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[32,59,15,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-2\"},\"attrs\":{\"group\":\"注\"}}'><a href=\"./Main_Page#cite_note-2\" style=\"counter-reset: mw-Ref 1;\" data-mw-group=\"注\"><span class=\"mw-reflink-text\">[注 1]</span></a></sup>CCC<sup about=\"#mwt6\" class=\"mw-ref\" id=\"cite_ref-3\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[62,88,15,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-3\"},\"attrs\":{\"group\":\"参\"}}'><a href=\"./Main_Page#cite_note-3\" style=\"counter-reset: mw-Ref 2;\" data-mw-group=\"参\"><span class=\"mw-reflink-text\">[参 2]</span></a></sup></p>\n\n<dl data-parsoid='{\"dsr\":[90,95,0,0]}'><dt data-parsoid='{\"dsr\":[90,95,1,0]}'>refs</dt></dl>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt8\" data-mw-group=\"参\" data-parsoid='{\"group\":\"参\",\"dsr\":[96,120,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{\"group\":\"参\"}}'><li about=\"#cite_note-1\" id=\"cite_note-1\"><a href=\"./Main_Page#cite_ref-1\" data-mw-group=\"参\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-1\" class=\"mw-reference-text\" data-parsoid=\"{}\">ref a</span></li><li about=\"#cite_note-3\" id=\"cite_note-3\"><a href=\"./Main_Page#cite_ref-3\" data-mw-group=\"参\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-3\" class=\"mw-reference-text\" data-parsoid=\"{}\">ref c</span></li></ol>\n\n<dl data-parsoid='{\"dsr\":[122,128,0,0]}'><dt data-parsoid='{\"dsr\":[122,128,1,0]}'>notes</dt></dl>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt10\" data-mw-group=\"注\" data-parsoid='{\"group\":\"注\",\"dsr\":[129,153,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{\"group\":\"注\"}}'><li about=\"#cite_note-2\" id=\"cite_note-2\"><a href=\"./Main_Page#cite_ref-2\" data-mw-group=\"注\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-2\" class=\"mw-reference-text\" data-parsoid=\"{}\">note b</span></li></ol>");
add("wt2html", "<ref> defined in <references>", "<p data-parsoid='{\"dsr\":[0,17,0,0]}'><sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-foo_1-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[0,17,17,0]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"foo\"}}'><a href=\"./Main_Page#cite_note-foo-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt4\" data-parsoid='{\"dsr\":[19,71,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{},\"body\":{\"html\":\"\\n&lt;sup about=\\\"#mwt6\\\" class=\\\"mw-ref\\\" rel=\\\"dc:references\\\" typeof=\\\"mw:Extension/ref\\\" data-parsoid=&apos;{\\\"dsr\\\":[32,57,16,6]}&apos; data-mw=&apos;{\\\"name\\\":\\\"ref\\\",\\\"body\\\":{\\\"id\\\":\\\"mw-reference-text-cite_note-foo-1\\\"},\\\"attrs\\\":{\\\"name\\\":\\\"foo\\\"}}&apos;>&lt;a href=\\\"./Main_Page#cite_note-foo-1\\\" style=\\\"counter-reset: mw-Ref 1;\\\" data-parsoid=\\\"{}\\\">&lt;span class=\\\"mw-reflink-text\\\" data-parsoid=\\\"{}\\\">[1]&lt;/span>&lt;/a>&lt;/sup>\\n\"}}'><li about=\"#cite_note-foo-1\" id=\"cite_note-foo-1\"><a href=\"./Main_Page#cite_ref-foo_1-0\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-foo-1\" class=\"mw-reference-text\" data-parsoid=\"{}\">BAR</span></li></ol>");
add("wt2html", "<ref> defined in <references> called with #tag", "<p data-parsoid='{\"dsr\":[0,17,0,0]}'><sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-foo_1-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[0,17,17,0]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"foo\"}}'><a href=\"./Main_Page#cite_note-foo-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n\n<p data-parsoid='{\"dsr\":[19,66,0,0]}'><references about=\"#mwt4\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[19,66,null,null],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#tag:references\",\"function\":\"tag\"},\"params\":{\"1\":{\"wt\":\"\\n&lt;ref name=\\\"foo\\\">BAR&lt;/ref>\\n\"}},\"i\":0}}]}'>\n<sup about=\"#mwt5\" class=\"mw-ref\" id=\"cite_ref-foo_1-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-foo-1\"},\"attrs\":{\"name\":\"foo\"}}'><a href=\"./Main_Page#cite_note-foo-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup>\n</references></p>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt6\" data-parsoid='{\"dsr\":[66,66,0,0]}' data-mw='{\"name\":\"references\",\"attrs\":{},\"autoGenerated\":true}'><li about=\"#cite_note-foo-1\" id=\"cite_note-foo-1\"><span rel=\"mw:referencedBy\"><a href=\"./Main_Page#cite_ref-foo_1-0\"><span class=\"mw-linkback-text\">1 </span></a><a href=\"./Main_Page#cite_ref-foo_1-1\"><span class=\"mw-linkback-text\">2 </span></a></span> <span id=\"mw-reference-text-cite_note-foo-1\" class=\"mw-reference-text\" data-parsoid=\"{}\">BAR</span></li></ol>");
add("wt2html", "<ref> defined in <references> error conditions", "<p data-parsoid='{\"dsr\":[0,27,0,0]}'><sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-foo_1-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[0,27,27,0]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"group\":\"2\",\"name\":\"foo\"}}'><a href=\"./Main_Page#cite_note-foo-1\" style=\"counter-reset: mw-Ref 1;\" data-mw-group=\"2\"><span class=\"mw-reflink-text\">[2 1]</span></a></sup></p>\n\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt4\" data-mw-group=\"2\" data-parsoid='{\"group\":\"2\",\"dsr\":[29,173,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{\"group\":\"2\"},\"body\":{\"html\":\"\\n&lt;sup about=\\\"#mwt6\\\" class=\\\"mw-ref\\\" rel=\\\"dc:references\\\" typeof=\\\"mw:Extension/ref\\\" data-parsoid=&apos;{\\\"dsr\\\":[52,69,17,0]}&apos; data-mw=&apos;{\\\"name\\\":\\\"ref\\\",\\\"attrs\\\":{\\\"name\\\":\\\"foo\\\"}}&apos;>&lt;a href=\\\"./Main_Page#cite_note-foo-1\\\" style=\\\"counter-reset: mw-Ref 1;\\\" data-mw-group=\\\"2\\\" data-parsoid=\\\"{}\\\">&lt;span class=\\\"mw-reflink-text\\\" data-parsoid=\\\"{}\\\">[2 1]&lt;/span>&lt;/a>&lt;/sup>\\n&lt;sup about=\\\"#mwt8\\\" class=\\\"mw-ref\\\" rel=\\\"dc:references\\\" typeof=\\\"mw:Extension/ref\\\" data-parsoid=&apos;{\\\"dsr\\\":[70,98,19,6]}&apos; data-mw=&apos;{\\\"name\\\":\\\"ref\\\",\\\"body\\\":{\\\"id\\\":\\\"mw-reference-text-cite_note-unused-2\\\"},\\\"attrs\\\":{\\\"name\\\":\\\"unused\\\"}}&apos;>&lt;a href=\\\"./Main_Page#cite_note-unused-2\\\" style=\\\"counter-reset: mw-Ref 2;\\\" data-mw-group=\\\"2\\\" data-parsoid=\\\"{}\\\">&lt;span class=\\\"mw-reflink-text\\\" data-parsoid=\\\"{}\\\">[2 2]&lt;/span>&lt;/a>&lt;/sup>\\n&lt;sup about=\\\"#mwt10\\\" class=\\\"mw-ref\\\" rel=\\\"dc:references\\\" typeof=\\\"mw:Extension/ref\\\" data-parsoid=&apos;{\\\"dsr\\\":[99,140,26,6]}&apos; data-mw=&apos;{\\\"name\\\":\\\"ref\\\",\\\"body\\\":{\\\"id\\\":\\\"mw-reference-text-cite_note-foo-3\\\"},\\\"attrs\\\":{\\\"group\\\":\\\"1\\\",\\\"name\\\":\\\"foo\\\"}}&apos;>&lt;a href=\\\"./Main_Page#cite_note-foo-3\\\" style=\\\"counter-reset: mw-Ref 1;\\\" data-mw-group=\\\"1\\\" data-parsoid=\\\"{}\\\">&lt;span class=\\\"mw-reflink-text\\\" data-parsoid=\\\"{}\\\">[1 1]&lt;/span>&lt;/a>&lt;/sup>\\n&lt;sup about=\\\"#mwt12\\\" class=\\\"mw-ref\\\" rel=\\\"dc:references\\\" typeof=\\\"mw:Extension/ref\\\" data-parsoid=&apos;{\\\"dsr\\\":[141,159,5,6]}&apos; data-mw=&apos;{\\\"name\\\":\\\"ref\\\",\\\"body\\\":{\\\"id\\\":\\\"mw-reference-text-cite_note-4\\\"},\\\"attrs\\\":{}}&apos;>&lt;a href=\\\"./Main_Page#cite_note-4\\\" style=\\\"counter-reset: mw-Ref 3;\\\" data-mw-group=\\\"2\\\" data-parsoid=\\\"{}\\\">&lt;span class=\\\"mw-reflink-text\\\" data-parsoid=\\\"{}\\\">[2 3]&lt;/span>&lt;/a>&lt;/sup>\\n\"}}'><li about=\"#cite_note-foo-1\" id=\"cite_note-foo-1\"><a href=\"./Main_Page#cite_ref-foo_1-0\" data-mw-group=\"2\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-foo-1\" class=\"mw-reference-text\" data-parsoid=\"{}\"></span></li><li about=\"#cite_note-unused-2\" id=\"cite_note-unused-2\"><span rel=\"mw:referencedBy\"></span> <span id=\"mw-reference-text-cite_note-unused-2\" class=\"mw-reference-text\" data-parsoid=\"{}\">BAR</span></li><li about=\"#cite_note-4\" id=\"cite_note-4\"><span rel=\"mw:referencedBy\"></span> <span id=\"mw-reference-text-cite_note-4\" class=\"mw-reference-text\" data-parsoid=\"{}\">BAR BAR</span></li></ol>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt13\" data-mw-group=\"1\" data-parsoid='{\"group\":\"1\",\"dsr\":[173,173,0,0]}' data-mw='{\"name\":\"references\",\"attrs\":{\"group\":\"1\"},\"autoGenerated\":true}'><li about=\"#cite_note-foo-3\" id=\"cite_note-foo-3\"><span rel=\"mw:referencedBy\"></span> <span id=\"mw-reference-text-cite_note-foo-3\" class=\"mw-reference-text\" data-parsoid=\"{}\">bad group</span></li></ol>");
add("wt2html", "<ref> with custom group link with number names in Klingon", "<p data-parsoid='{\"dsr\":[0,74,0,0]}'>Wikipedia rocks!<sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[16,74,21,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-1\"},\"attrs\":{\"group\":\"klingon\"}}'><a href=\"./Main_Page#cite_note-1\" style=\"counter-reset: mw-Ref 1;\" data-mw-group=\"klingon\"><span class=\"mw-reflink-text\">[klingon 1]</span></a></sup></p>\n\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt4\" data-mw-group=\"klingon\" data-parsoid='{\"group\":\"klingon\",\"dsr\":[76,105,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{\"group\":\"klingon\"}}'><li about=\"#cite_note-1\" id=\"cite_note-1\"><a href=\"./Main_Page#cite_ref-1\" data-mw-group=\"klingon\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-1\" class=\"mw-reference-text\" data-parsoid=\"{}\">Proceeds of Rockology, vol. XXI</span></li></ol>");
add("wt2html", "Bug 31374 regression check: nested strip items", "<p data-parsoid='{\"dsr\":[0,48,0,0]}'><ref about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"a\":{\"group\":null},\"sa\":{\"group\":\"Note\"},\"dsr\":[0,48,null,null],\"pi\":[[{\"k\":\"1\"},{\"k\":\"group\",\"named\":true}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#tag:ref\",\"function\":\"tag\"},\"params\":{\"1\":{\"wt\":\"note&lt;ref>reference&lt;/ref>\"},\"group\":{\"wt\":\"Note\"}},\"i\":0}}]}'>note<sup about=\"#mwt3\" class=\"mw-ref\" id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" 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;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></ref></p>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt5\" data-mw-group=\"Note\" data-parsoid='{\"group\":\"Note\",\"dsr\":[49,74,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{\"group\":\"Note\"}}'></ol>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt7\" data-parsoid='{\"dsr\":[75,89,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=\"{}\">reference</span></li></ol>");
add("wt2html", "Bug 13073 regression check: wrapped <references>", "<p data-parsoid='{\"dsr\":[0,16,0,0]}'><sup about=\"#mwt4\" class=\"mw-ref\" id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[0,16,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;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n<div data-parsoid='{\"stx\":\"html\",\"dsr\":[17,42,5,6]}'><ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt3\" data-parsoid='{\"dsr\":[22,36,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\n</span></li></ol></div>");
add("wt2html", "<ref> with no name and no content.", "<p data-parsoid='{\"dsr\":[0,15,0,0]}'>Bla.<sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[4,15,5,6]}' data-mw='{\"name\":\"ref\",\"attrs\":{}}'><a href=\"./Main_Page#cite_note-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt3\" data-parsoid='{\"dsr\":[15,15,0,0]}' data-mw='{\"name\":\"references\",\"attrs\":{},\"autoGenerated\":true}'><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=\"{}\"></span></li></ol>");
add("wt2html", "<ref> with an empty-string name parameter and no content.", "<p data-parsoid='{\"dsr\":[0,23,0,0]}'>Bla.<sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[4,23,13,6]}' data-mw='{\"name\":\"ref\",\"attrs\":{}}'><a href=\"./Main_Page#cite_note-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt3\" data-parsoid='{\"dsr\":[23,23,0,0]}' data-mw='{\"name\":\"references\",\"attrs\":{},\"autoGenerated\":true}'><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=\"{}\"></span></li></ol>");
add("wt2html", "<ref> with a non-empty name parameter and no content.", "<p data-parsoid='{\"dsr\":[0,27,0,0]}'>Bla.<sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-void_1-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[4,27,17,6]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"void\"}}'><a href=\"./Main_Page#cite_note-void-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt3\" data-parsoid='{\"dsr\":[27,27,0,0]}' data-mw='{\"name\":\"references\",\"attrs\":{},\"autoGenerated\":true}'><li about=\"#cite_note-void-1\" id=\"cite_note-void-1\"><a href=\"./Main_Page#cite_ref-void_1-0\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-void-1\" class=\"mw-reference-text\" data-parsoid=\"{}\"></span></li></ol>");
-add("wt2html", "<ref>s with the follow parameter", "<p data-parsoid='{\"dsr\":[0,62,0,0]}'>Page one.<sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-beginning_1-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[9,62,22,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-beginning-1\"},\"attrs\":{\"name\":\"beginning\"}}'><a href=\"./Main_Page#cite_note-beginning-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n\n<p data-parsoid='{\"dsr\":[64,129,0,0]}'>Page two.<sup about=\"#mwt4\" class=\"mw-ref\" id=\"cite_ref-2\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[73,129,24,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-2\"},\"attrs\":{}}'><a href=\"./Main_Page#cite_note-2\" style=\"counter-reset: mw-Ref 2;\"><span class=\"mw-reflink-text\">[2]</span></a></sup></p>\n\n<h2 id=\"References\" data-parsoid='{\"dsr\":[131,147,2,2]}'>References</h2>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt6\" data-parsoid='{\"dsr\":[148,162,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{}}'><li about=\"#cite_note-beginning-1\" id=\"cite_note-beginning-1\"><a href=\"./Main_Page#cite_ref-beginning_1-0\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-beginning-1\" class=\"mw-reference-text\" data-parsoid=\"{}\">First page footnote text.</span></li><li about=\"#cite_note-2\" id=\"cite_note-2\"><a href=\"./Main_Page#cite_ref-2\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-2\" class=\"mw-reference-text\" data-parsoid=\"{}\">Second page footnote text.</span></li></ol>");
+add("wt2html", "<ref>s with the follow parameter", "<p data-parsoid='{\"dsr\":[0,62,0,0]}'>Page one.<sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-beginning_1-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[9,62,22,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-beginning-1\"},\"attrs\":{\"name\":\"beginning\"}}'><a href=\"./Main_Page#cite_note-beginning-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n\n<p data-parsoid='{\"dsr\":[64,129,0,0]}'>Page two.<sup about=\"#mwt4\" class=\"mw-ref\" id=\"cite_ref-2\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[73,129,24,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-2\"},\"attrs\":{}}'><a href=\"./Main_Page#cite_note-2\" style=\"counter-reset: mw-Ref 2;\"><span class=\"mw-reflink-text\">[2]</span></a></sup></p>\n\n<h2 id=\"References\" data-parsoid='{\"dsr\":[131,147,2,2]}'> References </h2>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt6\" data-parsoid='{\"dsr\":[148,162,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{}}'><li about=\"#cite_note-beginning-1\" id=\"cite_note-beginning-1\"><a href=\"./Main_Page#cite_ref-beginning_1-0\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-beginning-1\" class=\"mw-reference-text\" data-parsoid=\"{}\">First page footnote text.</span></li><li about=\"#cite_note-2\" id=\"cite_note-2\"><a href=\"./Main_Page#cite_ref-2\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-2\" class=\"mw-reference-text\" data-parsoid=\"{}\">Second page footnote text.</span></li></ol>");
add("wt2html", "<ref> with both name and follow parameters - invalid", "<p data-parsoid='{\"dsr\":[0,74,0,0]}'>Page one.<sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-the-name_1-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[9,74,39,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-the-name-1\"},\"attrs\":{\"name\":\"the-name\"}}'><a href=\"./Main_Page#cite_note-the-name-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt4\" data-parsoid='{\"dsr\":[75,89,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{}}'><li about=\"#cite_note-the-name-1\" id=\"cite_note-the-name-1\"><a href=\"./Main_Page#cite_ref-the-name_1-0\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-the-name-1\" class=\"mw-reference-text\" data-parsoid=\"{}\">This ref is invalid.</span></li></ol>");
add("wt2html", "Multiple definition (outside <references/>)", "<p data-parsoid='{\"dsr\":[0,43,0,0]}'><sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-a_1-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[0,21,12,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-a-1\"},\"attrs\":{\"name\":\"a\"}}'><a href=\"./Main_Page#cite_note-a-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup>\n<sup about=\"#mwt4\" class=\"mw-ref\" id=\"cite_ref-a_1-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[22,43,12,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"html\":\"def\"},\"attrs\":{\"name\":\"a\"}}'><a href=\"./Main_Page#cite_note-a-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt6\" data-parsoid='{\"dsr\":[44,58,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{}}'><li about=\"#cite_note-a-1\" id=\"cite_note-a-1\"><span rel=\"mw:referencedBy\"><a href=\"./Main_Page#cite_ref-a_1-0\"><span class=\"mw-linkback-text\">1 </span></a><a href=\"./Main_Page#cite_ref-a_1-1\"><span class=\"mw-linkback-text\">2 </span></a></span> <span id=\"mw-reference-text-cite_note-a-1\" class=\"mw-reference-text\" data-parsoid=\"{}\">abc</span></li></ol>");
add("wt2html", "Multiple definition (inside <references/>)", "<p data-parsoid='{\"dsr\":[0,14,0,0]}'><sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-a_1-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[0,14,14,0]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"a\"}}'><a href=\"./Main_Page#cite_note-a-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt4\" data-parsoid='{\"dsr\":[15,85,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{},\"body\":{\"html\":\"\\n&lt;sup about=\\\"#mwt6\\\" class=\\\"mw-ref\\\" rel=\\\"dc:references\\\" typeof=\\\"mw:Extension/ref\\\" data-parsoid=&apos;{\\\"dsr\\\":[28,49,12,6]}&apos; data-mw=&apos;{\\\"name\\\":\\\"ref\\\",\\\"body\\\":{\\\"id\\\":\\\"mw-reference-text-cite_note-a-1\\\"},\\\"attrs\\\":{\\\"name\\\":\\\"a\\\"}}&apos;>&lt;a href=\\\"./Main_Page#cite_note-a-1\\\" style=\\\"counter-reset: mw-Ref 1;\\\" data-parsoid=\\\"{}\\\">&lt;span class=\\\"mw-reflink-text\\\" data-parsoid=\\\"{}\\\">[1]&lt;/span>&lt;/a>&lt;/sup>\\n&lt;sup about=\\\"#mwt8\\\" class=\\\"mw-ref\\\" rel=\\\"dc:references\\\" typeof=\\\"mw:Extension/ref\\\" data-parsoid=&apos;{\\\"dsr\\\":[50,71,12,6]}&apos; data-mw=&apos;{\\\"name\\\":\\\"ref\\\",\\\"body\\\":{\\\"html\\\":\\\"def\\\"},\\\"attrs\\\":{\\\"name\\\":\\\"a\\\"}}&apos;>&lt;a href=\\\"./Main_Page#cite_note-a-1\\\" style=\\\"counter-reset: mw-Ref 1;\\\" data-parsoid=\\\"{}\\\">&lt;span class=\\\"mw-reflink-text\\\" data-parsoid=\\\"{}\\\">[1]&lt;/span>&lt;/a>&lt;/sup>\\n\"}}'><li about=\"#cite_note-a-1\" id=\"cite_note-a-1\"><a href=\"./Main_Page#cite_ref-a_1-0\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-a-1\" class=\"mw-reference-text\" data-parsoid=\"{}\">abc</span></li></ol>");
add("wt2html", "Multiple definition (mixed outside/inside)", "<p data-parsoid='{\"dsr\":[0,21,0,0]}'><sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-a_1-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[0,21,12,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-a-1\"},\"attrs\":{\"name\":\"a\"}}'><a href=\"./Main_Page#cite_note-a-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup></p>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt4\" data-parsoid='{\"dsr\":[22,70,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{},\"body\":{\"html\":\"\\n&lt;sup about=\\\"#mwt6\\\" class=\\\"mw-ref\\\" rel=\\\"dc:references\\\" typeof=\\\"mw:Extension/ref\\\" data-parsoid=&apos;{\\\"dsr\\\":[35,56,12,6]}&apos; data-mw=&apos;{\\\"name\\\":\\\"ref\\\",\\\"body\\\":{\\\"html\\\":\\\"def\\\"},\\\"attrs\\\":{\\\"name\\\":\\\"a\\\"}}&apos;>&lt;a href=\\\"./Main_Page#cite_note-a-1\\\" style=\\\"counter-reset: mw-Ref 1;\\\" data-parsoid=\\\"{}\\\">&lt;span class=\\\"mw-reflink-text\\\" data-parsoid=\\\"{}\\\">[1]&lt;/span>&lt;/a>&lt;/sup>\\n\"}}'><li about=\"#cite_note-a-1\" id=\"cite_note-a-1\"><a href=\"./Main_Page#cite_ref-a_1-0\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-a-1\" class=\"mw-reference-text\" data-parsoid=\"{}\">abc</span></li></ol>");
add("wt2html", "Multiple definition (inside {{#tag:references}})", "<p data-parsoid='{\"dsr\":[0,80,0,0]}'><sup about=\"#mwt2\" class=\"mw-ref\" id=\"cite_ref-a_1-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[0,14,14,0]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"a\"}}'><a href=\"./Main_Page#cite_note-a-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup>\n<references about=\"#mwt5\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[15,80,null,null],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#tag:references\",\"function\":\"tag\"},\"params\":{\"1\":{\"wt\":\"\\n&lt;ref name=a>abc&lt;/ref>\\n&lt;ref name=a>def&lt;/ref>\\n\"}},\"i\":0}}]}'>\n<sup about=\"#mwt6\" class=\"mw-ref\" id=\"cite_ref-a_1-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-a-1\"},\"attrs\":{\"name\":\"a\"}}'><a href=\"./Main_Page#cite_note-a-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup>\n<sup about=\"#mwt7\" class=\"mw-ref\" id=\"cite_ref-a_1-2\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-mw='{\"name\":\"ref\",\"body\":{\"html\":\"def\"},\"attrs\":{\"name\":\"a\"}}'><a href=\"./Main_Page#cite_note-a-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup>\n</references></p>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt8\" data-parsoid='{\"dsr\":[80,80,0,0]}' data-mw='{\"name\":\"references\",\"attrs\":{},\"autoGenerated\":true}'><li about=\"#cite_note-a-1\" id=\"cite_note-a-1\"><span rel=\"mw:referencedBy\"><a href=\"./Main_Page#cite_ref-a_1-0\"><span class=\"mw-linkback-text\">1 </span></a><a href=\"./Main_Page#cite_ref-a_1-1\"><span class=\"mw-linkback-text\">2 </span></a><a href=\"./Main_Page#cite_ref-a_1-2\"><span class=\"mw-linkback-text\">3 </span></a></span> <span id=\"mw-reference-text-cite_note-a-1\" class=\"mw-reference-text\" data-parsoid=\"{}\">abc</span></li></ol>");
// Blacklist for wt2wt
add("wt2wt", "Simple <ref>, no <references/>", "Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\n<references />");
add("wt2wt", "Simple <ref>, with <references/>", "Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\n\n<references />");
add("wt2wt", "<ref> with a simple template", "Templating<ref>{{simple template}}</ref>\n\n<references />");
add("wt2wt", "<ref> with a <nowiki>", "Templating<ref><nowiki>{{simple template}}</nowiki></ref>\n\n<references />");
add("wt2wt", "<ref> in a <nowiki>", "Templating<nowiki><ref>{{simple template}}</ref></nowiki>\n\n<references />");
add("wt2wt", "<ref> in a <!--comment-->", "Templating<!--<ref>{{simple template}}</ref>-->\n\n<references />");
add("wt2wt", "<!--comment--> in a <ref> (bug 5384)", "Templating<ref>Text<!--comment--></ref>\n\n<references />");
add("wt2wt", "<references> after <gallery> (bug 6164)", "<ref>one</ref>\n\n<gallery>Image:Foobar.jpg</gallery>\n\n<references />");
add("wt2wt", "{{REVISIONID}} on page with <ref> (bug 6299)", "{{REVISIONID}}<ref>elite</ref>\n<references />");
add("wt2wt", "Ref with content followed by blank ref", "<ref name=\"blank\">content</ref>\n\n<ref name=\"blank\" />\n\n<references />");
add("wt2wt", "Blank ref followed by ref with content", "<ref name=\"blank\" />\n\n<ref name=\"blank\">content</ref>\n\n<references />");
add("wt2wt", "Regression: non-blank ref \"0\" followed by ref with content", "<ref name=\"blank\">0</ref>\n\n<ref name=\"blank\">content</ref>\n\n<references />");
add("wt2wt", "Regression sanity check: non-blank ref \"1\" followed by ref with content", "<ref name=\"blank\">1</ref>\n\n<ref name=\"blank\">content</ref>\n\n<references />");
add("wt2wt", "Erroneous refs", "<ref name=\"0\">Zero</ref>\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n<ref />\n\n<ref name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\n<references />\n\n<references />");
add("wt2wt", "Simple <ref>, with <references/> in group", "Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\nWikipedia rocks!<ref group=\"note\">Proceeds of Rockology, vol. XXI</ref>\n\n<references />\n<references group=\"note\" />");
add("wt2wt", "<ref> defined in <references>", "<ref name=\"foo\" />\n\n<references>\n<ref name=\"foo\">BAR</ref>\n</references>");
add("wt2wt", "<ref> defined in <references> called with #tag", "<ref name=\"foo\" />\n\n{{#tag:references|\n<ref name=\"foo\">BAR</ref>\n}}\n<references />");
add("wt2wt", "<ref> defined in <references> error conditions", "<ref group=\"2\" name=\"foo\" />\n\n<references group=\"2\">\n<ref name=\"foo\" />\n<ref name=\"unused\">BAR</ref>\n<ref group=\"1\" name=\"foo\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>\n<references group=\"1\" />");
add("wt2wt", "<ref> with custom group link with number names in Klingon", "Wikipedia rocks!<ref group=\"klingon\">Proceeds of Rockology, vol. XXI</ref>\n\n<references group=\"klingon\" />");
add("wt2wt", "Bug 31374 regression check: nested strip items", "{{#tag:ref|note<ref>reference</ref>|group=Note}}\n<references group=\"Note\" />\n<references />");
add("wt2wt", "Bug 13073 regression check: wrapped <references>", "<ref>foo\n</ref>\n<div><references /></div>");
add("wt2wt", "<ref> with no name and no content.", "Bla.<ref />\n<references />");
add("wt2wt", "<ref> with an empty-string name parameter and no content.", "Bla.<ref />\n<references />");
add("wt2wt", "<ref> with a non-empty name parameter and no content.", "Bla.<ref name=\"void\" />\n<references />");
-add("wt2wt", "<ref>s with the follow parameter", "Page one.<ref name=\"beginning\">First page footnote text.</ref>\n\nPage two.<ref>Second page footnote text.</ref>\n\n==References==\n<references />");
+add("wt2wt", "<ref>s with the follow parameter", "Page one.<ref name=\"beginning\">First page footnote text.</ref>\n\nPage two.<ref>Second page footnote text.</ref>\n\n== References ==\n<references />");
add("wt2wt", "<ref> with both name and follow parameters - invalid", "Page one.<ref name=\"the-name\">This ref is invalid.</ref>\n<references />");
add("wt2wt", "Multiple definition (outside <references/>)", "<ref name=\"a\">abc</ref>\n<ref name=\"a\">def</ref>\n<references />");
add("wt2wt", "Multiple definition (inside <references/>)", "<ref name=\"a\" />\n<references>\n<ref name=\"a\">abc</ref>\n<ref name=\"a\">def</ref>\n</references>");
add("wt2wt", "Multiple definition (mixed outside/inside)", "<ref name=\"a\">abc</ref>\n<references>\n<ref name=\"a\">def</ref>\n</references>");
add("wt2wt", "Multiple definition (inside {{#tag:references}})", "<ref name=\"a\" />\n{{#tag:references|\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n}}\n<references />");
add("wt2wt", "Ref: 3. spaces in ref-names should be ignored", "A <ref name=\"x\">foo</ref>\nB <ref name=\"x\" />\nC <ref name=\"x\" />\n<references />");
add("wt2wt", "Ref: 5. body should accept generic wikitext", "A <ref>This is a '''[[bolded link]]''' and this is a {{echo|transclusion}}\n</ref>\n\n<references />");
add("wt2wt", "Ref: 6. indent-pres should not be output in ref-body", "A <ref>foo\n bar\n baz\n</ref>\n\n<references />");
add("wt2wt", "Ref: 7. No p-wrapping in ref-body", "A <ref>foo\nbar\nbaz\nbooz\n</ref>\n\n<references />");
add("wt2wt", "Ref: 8. transclusion wikitext has lower precedence", "A <ref><nowiki>foo {{echo|</nowiki></ref><nowiki> B C}}</nowiki>\n\n<references />");
add("wt2wt", "Ref: 9. unclosed comments should not leak out of ref-body", "A <ref>foo <!----></ref> B C\n<references />");
add("wt2wt", "Ref: 10. Unclosed HTML tags should not leak out of ref-body", "A <ref><b> foo </ref> B C\n\n<references />");
add("wt2wt", "References: 9. Generate missing references list at the end", "A <ref>foo</ref>\nB <ref group=\"inexistent\">bar</ref>\n<references />\n<references group=\"inexistent\" />");
// Blacklist for html2html
-add("html2html", "Simple <ref>, no <references/>", "<p data-parsoid='{\"dsr\":[0,81,0,0]}'>Wikipedia rocks!<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[16,81,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[55,75,15,2]}'>[1]</a></sup></p>\n<ol data-parsoid='{\"dsr\":[82,207,0,0]}'><li data-parsoid='{\"dsr\":[82,207,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[84,139,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[115,132,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[140,207,29,7]}'>Proceeds of Rockology, vol. XXI</span></li></ol>\n");
-add("html2html", "Simple <ref>, with <references/>", "<p data-parsoid='{\"dsr\":[0,81,0,0]}'>Wikipedia rocks!<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[16,81,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[55,75,15,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[83,208,0,0]}'><li data-parsoid='{\"dsr\":[83,208,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[85,140,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[116,133,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[141,208,29,7]}'>Proceeds of Rockology, vol. XXI</span></li></ol>\n");
-add("html2html", "<ref> with a simple template", "<p data-parsoid='{\"dsr\":[0,75,0,0]}'>Templating<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[10,75,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[49,69,15,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[77,193,0,0]}'><li data-parsoid='{\"dsr\":[77,193,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[79,134,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[110,127,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[135,193,29,7]}'>A <i data-parsoid='{\"dsr\":[166,176,2,2]}'>simple</i> template.</span></li></ol>\n");
-add("html2html", "<ref> with a <nowiki>", "<p data-parsoid='{\"dsr\":[0,75,0,0]}'>Templating<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[10,75,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[49,69,15,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[77,207,0,0]}'><li data-parsoid='{\"dsr\":[77,207,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[79,134,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[110,127,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[135,207,29,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[164,200,8,9]}'>{{simple template}}</span></span></li></ol>\n");
-add("html2html", "<!--comment--> in a <ref> (bug 5384)", "<p data-parsoid='{\"dsr\":[0,75,0,0]}'>Templating<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[10,75,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[49,69,15,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[77,175,0,0]}'><li data-parsoid='{\"dsr\":[77,175,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[79,134,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[110,127,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[135,175,29,7]}'>Text</span></li></ol>\n");
-add("html2html", "<references> after <gallery> (bug 6164)", "<p data-parsoid='{\"dsr\":[0,65,0,0]}'><sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,65,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[39,59,15,2]}'>[1]</a></sup></p>\n\n<p data-parsoid='{\"dsr\":[67,71,0,0]}'>\t\t* </p><div style=\"width: 155px\" data-parsoid='{\"stx\":\"html\",\"dsr\":[71,296,26,6]}'> \t\t\t<div class=\"thumb\" style=\"width: 150px;\" data-parsoid='{\"stx\":\"html\",\"dsr\":[101,249,41,6]}'><div style=\"margin:68px auto;\" data-parsoid='{\"stx\":\"html\",\"dsr\":[142,243,31,6]}'><img src=\"http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg\" alt=\"120px-Foobar.jpg\" rel=\"mw:externalImage\" data-parsoid='{\"dsr\":[173,237,null,null]}'/></div></div> \t\t\t<div class=\"gallerytext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[253,287,25,6]}'>\t\t\t</div> \t\t</div>\n\n<ol data-parsoid='{\"dsr\":[298,395,0,0]}'><li data-parsoid='{\"dsr\":[298,395,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[300,355,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[331,348,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[356,395,29,7]}'>one</span></li></ol>\n");
-add("html2html", "{{REVISIONID}} on page with <ref> (bug 6299)", "<p data-parsoid='{\"dsr\":[0,69,0,0]}'>1337<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[4,69,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[43,63,15,2]}'>[1]</a></sup></p>\n<ol data-parsoid='{\"dsr\":[70,169,0,0]}'><li data-parsoid='{\"dsr\":[70,169,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[72,127,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[103,120,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[128,169,29,7]}'>elite</span></li></ol>\n");
-add("html2html", "Ref with content followed by blank ref", "<p data-parsoid='{\"dsr\":[0,79,0,0]}'><sup id=\"cite_ref-blank_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,79,47,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-blank-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-blank-1\"},\"sa\":{\"href\":\"#cite_note-blank-1\"},\"dsr\":[47,73,21,2]}'>[1]</a></sup></p>\n\n<p data-parsoid='{\"dsr\":[81,160,0,0]}'><sup id=\"cite_ref-blank_1-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[81,160,47,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-blank-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-blank-1\"},\"sa\":{\"href\":\"#cite_note-blank-1\"},\"dsr\":[128,154,21,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[162,325,0,0]}'><li data-parsoid='{\"dsr\":[162,325,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[164,281,31,7]}'>↑ <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[197,235,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-blank_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-blank_1-0\"},\"sa\":{\"href\":\"#cite_ref-blank_1-0\"},\"dsr\":[202,229,22,2]}'>1.0</a></sup> <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[236,274,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-blank_1-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-blank_1-1\"},\"sa\":{\"href\":\"#cite_ref-blank_1-1\"},\"dsr\":[241,268,22,2]}'>1.1</a></sup></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[282,325,29,7]}'>content</span></li></ol>\n");
-add("html2html", "Blank ref followed by ref with content", "<p data-parsoid='{\"dsr\":[0,79,0,0]}'><sup id=\"cite_ref-blank_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,79,47,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-blank-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-blank-1\"},\"sa\":{\"href\":\"#cite_note-blank-1\"},\"dsr\":[47,73,21,2]}'>[1]</a></sup></p>\n\n<p data-parsoid='{\"dsr\":[81,160,0,0]}'><sup id=\"cite_ref-blank_1-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[81,160,47,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-blank-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-blank-1\"},\"sa\":{\"href\":\"#cite_note-blank-1\"},\"dsr\":[128,154,21,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[162,325,0,0]}'><li data-parsoid='{\"dsr\":[162,325,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[164,281,31,7]}'>↑ <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[197,235,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-blank_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-blank_1-0\"},\"sa\":{\"href\":\"#cite_ref-blank_1-0\"},\"dsr\":[202,229,22,2]}'>1.0</a></sup> <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[236,274,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-blank_1-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-blank_1-1\"},\"sa\":{\"href\":\"#cite_ref-blank_1-1\"},\"dsr\":[241,268,22,2]}'>1.1</a></sup></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[282,325,29,7]}'>content</span></li></ol>\n");
-add("html2html", "Regression: non-blank ref \"0\" followed by ref with content", "<p data-parsoid='{\"dsr\":[0,79,0,0]}'><sup id=\"cite_ref-blank_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,79,47,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-blank-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-blank-1\"},\"sa\":{\"href\":\"#cite_note-blank-1\"},\"dsr\":[47,73,21,2]}'>[1]</a></sup></p>\n\n<p data-parsoid='{\"dsr\":[81,160,0,0]}'><sup id=\"cite_ref-blank_1-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[81,160,47,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-blank-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-blank-1\"},\"sa\":{\"href\":\"#cite_note-blank-1\"},\"dsr\":[128,154,21,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[162,504,0,0]}'><li data-parsoid='{\"dsr\":[162,504,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[164,281,31,7]}'>↑ <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[197,235,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-blank_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-blank_1-0\"},\"sa\":{\"href\":\"#cite_ref-blank_1-0\"},\"dsr\":[202,229,22,2]}'>1.0</a></sup> <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[236,274,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-blank_1-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-blank_1-1\"},\"sa\":{\"href\":\"#cite_ref-blank_1-1\"},\"dsr\":[241,268,22,2]}'>1.1</a></sup></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[282,504,29,7]}'>0 <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[313,497,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[391,426,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[397,419,8,9]}'>&lt;ref></span></code> tag; name \"blank\" defined multiple times with different content</span></span></li></ol>\n");
-add("html2html", "Regression sanity check: non-blank ref \"1\" followed by ref with content", "<p data-parsoid='{\"dsr\":[0,79,0,0]}'><sup id=\"cite_ref-blank_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,79,47,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-blank-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-blank-1\"},\"sa\":{\"href\":\"#cite_note-blank-1\"},\"dsr\":[47,73,21,2]}'>[1]</a></sup></p>\n\n<p data-parsoid='{\"dsr\":[81,160,0,0]}'><sup id=\"cite_ref-blank_1-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[81,160,47,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-blank-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-blank-1\"},\"sa\":{\"href\":\"#cite_note-blank-1\"},\"dsr\":[128,154,21,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[162,504,0,0]}'><li data-parsoid='{\"dsr\":[162,504,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[164,281,31,7]}'>↑ <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[197,235,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-blank_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-blank_1-0\"},\"sa\":{\"href\":\"#cite_ref-blank_1-0\"},\"dsr\":[202,229,22,2]}'>1.0</a></sup> <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[236,274,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-blank_1-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-blank_1-1\"},\"sa\":{\"href\":\"#cite_ref-blank_1-1\"},\"dsr\":[241,268,22,2]}'>1.1</a></sup></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[282,504,29,7]}'>1 <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[313,497,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[391,426,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[397,419,8,9]}'>&lt;ref></span></code> tag; name \"blank\" defined multiple times with different content</span></span></li></ol>\n");
-add("html2html", "Ref names containing a number", "<p data-parsoid='{\"dsr\":[0,259,0,0]}'><sup id=\"cite_ref-test123test_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,91,53,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-test123test-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-test123test-1\"},\"sa\":{\"href\":\"#cite_note-test123test-1\"},\"dsr\":[53,85,27,2]}'>[1]</a></sup>\n<sup id=\"cite_ref-123test_2-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[92,175,49,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-123test-2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-123test-2\"},\"sa\":{\"href\":\"#cite_note-123test-2\"},\"dsr\":[141,169,23,2]}'>[2]</a></sup>\n<sup id=\"cite_ref-test123_3-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[176,259,49,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-test123-3\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-test123-3\"},\"sa\":{\"href\":\"#cite_note-test123-3\"},\"dsr\":[225,253,23,2]}'>[3]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[261,590,0,0]}'><li data-parsoid='{\"dsr\":[261,372,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[263,332,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-test123test_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-test123test_1-0\"},\"sa\":{\"href\":\"#cite_ref-test123test_1-0\"},\"dsr\":[294,325,28,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[333,372,29,7]}'>One</span></li>\n<li data-parsoid='{\"dsr\":[373,480,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[375,440,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-123test_2-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-123test_2-0\"},\"sa\":{\"href\":\"#cite_ref-123test_2-0\"},\"dsr\":[406,433,24,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[441,480,29,7]}'>Two</span></li>\n<li data-parsoid='{\"dsr\":[481,590,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[483,548,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-test123_3-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-test123_3-0\"},\"sa\":{\"href\":\"#cite_ref-test123_3-0\"},\"dsr\":[514,541,24,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[549,590,29,7]}'>Three</span></li></ol>\n");
-add("html2html", "Erroneous refs", "<p data-parsoid='{\"dsr\":[0,182,0,0]}'><span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,182,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[78,113,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[84,106,8,9]}'>&lt;ref></span></code> tag;\nname cannot be a simple integer. Use a descriptive title</span></p>\n\n<p data-parsoid='{\"dsr\":[184,249,0,0]}'><sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[184,249,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[223,243,15,2]}'>[1]</a></sup></p>\n\n<p data-parsoid='{\"dsr\":[251,410,0,0]}'><span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[251,410,58,7]}'>Cite error: The opening <code data-parsoid='{\"stx\":\"html\",\"dsr\":[333,368,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[339,361,8,9]}'>&lt;ref></span></code> tag is malformed or has a bad name</span></p>\n\n<p data-parsoid='{\"dsr\":[412,487,0,0]}'><sup id=\"cite_ref-bar_2-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[412,487,45,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-bar-2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-bar-2\"},\"sa\":{\"href\":\"#cite_note-bar-2\"},\"dsr\":[457,481,19,2]}'>[2]</a></sup></p>\n\n<p data-parsoid='{\"dsr\":[489,598,0,0]}'><sup id=\"cite_ref-blankwithnoreference_3-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[489,598,62,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-blankwithnoreference-3\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-blankwithnoreference-3\"},\"sa\":{\"href\":\"#cite_note-blankwithnoreference-3\"},\"dsr\":[551,592,36,2]}'>[3]</a></sup></p>\n\n<p data-parsoid='{\"dsr\":[600,744,0,0]}'><span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[600,744,58,7]}'>Cite error: Invalid parameter in <code data-parsoid='{\"stx\":\"html\",\"dsr\":[691,733,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[697,726,8,9]}'>&lt;references></span></code> tag</span></p>\n\n<ol data-parsoid='{\"dsr\":[746,1400,0,0]}'><li data-parsoid='{\"dsr\":[746,880,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[748,803,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[779,796,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[804,880,29,7]}'>Also zero, but differently! (Normal ref)</span></li>\n<li data-parsoid='{\"dsr\":[881,1123,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[883,944,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-bar_2-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-bar_2-0\"},\"sa\":{\"href\":\"#cite_ref-bar_2-0\"},\"dsr\":[914,937,20,2]}'>↑</a></span> <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[945,1123,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[1023,1058,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[1029,1051,8,9]}'>&lt;ref></span></code> tag; no text was provided for refs named <code data-parsoid='{\"stx\":\"html\",\"dsr\":[1100,1116,6,7]}'>bar</code></span></li>\n<li data-parsoid='{\"dsr\":[1124,1400,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[1126,1204,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-blankwithnoreference_3-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-blankwithnoreference_3-0\"},\"sa\":{\"href\":\"#cite_ref-blankwithnoreference_3-0\"},\"dsr\":[1157,1197,37,2]}'>↑</a></span> <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[1205,1400,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[1283,1318,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[1289,1311,8,9]}'>&lt;ref></span></code> tag; no text was provided for refs named <code data-parsoid='{\"stx\":\"html\",\"dsr\":[1360,1393,6,7]}'>blankwithnoreference</code></span></li></ol>\n");
-add("html2html", "Simple <ref>, with <references/> in group", "<p data-parsoid='{\"dsr\":[0,168,0,0]}'>Wikipedia rocks!<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[16,81,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[55,75,15,2]}'>[1]</a></sup>\nWikipedia rocks!<sup id=\"cite_ref-2\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[98,168,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-2\"},\"sa\":{\"href\":\"#cite_note-2\"},\"dsr\":[137,162,15,2]}'>[note 1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[170,295,0,0]}'><li data-parsoid='{\"dsr\":[170,295,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[172,227,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[203,220,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[228,295,29,7]}'>Proceeds of Rockology, vol. XXI</span></li></ol>\n\n<ol data-parsoid='{\"dsr\":[297,422,0,0]}'><li data-parsoid='{\"dsr\":[297,422,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[299,354,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-2\"},\"sa\":{\"href\":\"#cite_ref-2\"},\"dsr\":[330,347,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[355,422,29,7]}'>Proceeds of Rockology, vol. XXI</span></li></ol>\n");
-add("html2html", "Simple <ref>, with <references/> in group, with groupname in Chinese", "<p data-parsoid='{\"dsr\":[0,210,0,0]}'>AAA<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[3,70,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[42,64,15,2]}'>[参 1]</a></sup>BBB<sup id=\"cite_ref-2\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[73,140,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-2\"},\"sa\":{\"href\":\"#cite_note-2\"},\"dsr\":[112,134,15,2]}'>[注 1]</a></sup>CCC<sup id=\"cite_ref-3\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[143,210,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-3\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-3\"},\"sa\":{\"href\":\"#cite_note-3\"},\"dsr\":[182,204,15,2]}'>[参 2]</a></sup></p>\n\n<dl data-parsoid='{\"dsr\":[212,218,0,0]}'><dt data-parsoid='{\"dsr\":[212,218,1,0]}'>refs</dt></dl>\n\n<ol data-parsoid='{\"dsr\":[220,419,0,0]}'><li data-parsoid='{\"dsr\":[220,319,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[222,277,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[253,270,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[278,319,29,7]}'>ref a</span></li>\n<li data-parsoid='{\"dsr\":[320,419,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[322,377,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-3\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-3\"},\"sa\":{\"href\":\"#cite_ref-3\"},\"dsr\":[353,370,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[378,419,29,7]}'>ref c</span></li></ol>\n\n<dl data-parsoid='{\"dsr\":[421,428,0,0]}'><dt data-parsoid='{\"dsr\":[421,428,1,0]}'>notes</dt></dl>\n\n<ol data-parsoid='{\"dsr\":[430,530,0,0]}'><li data-parsoid='{\"dsr\":[430,530,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[432,487,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-2\"},\"sa\":{\"href\":\"#cite_ref-2\"},\"dsr\":[463,480,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[488,530,29,7]}'>note b</span></li></ol>\n");
-add("html2html", "<ref> defined in <references>", "<p data-parsoid='{\"dsr\":[0,75,0,0]}'><sup id=\"cite_ref-foo_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,75,45,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-foo-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-foo-1\"},\"sa\":{\"href\":\"#cite_note-foo-1\"},\"dsr\":[45,69,19,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[77,180,0,0]}'><li data-parsoid='{\"dsr\":[77,180,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[79,140,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-foo_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-foo_1-0\"},\"sa\":{\"href\":\"#cite_ref-foo_1-0\"},\"dsr\":[110,133,20,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[141,180,29,7]}'>BAR</span></li></ol>\n");
-add("html2html", "<ref> defined in <references> called with #tag", "<p data-parsoid='{\"dsr\":[0,75,0,0]}'><sup id=\"cite_ref-foo_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,75,45,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-foo-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-foo-1\"},\"sa\":{\"href\":\"#cite_note-foo-1\"},\"dsr\":[45,69,19,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[77,180,0,0]}'><li data-parsoid='{\"dsr\":[77,180,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[79,140,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-foo_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-foo_1-0\"},\"sa\":{\"href\":\"#cite_ref-foo_1-0\"},\"dsr\":[110,133,20,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[141,180,29,7]}'>BAR</span></li></ol>\n");
-add("html2html", "<ref> defined in <references> error conditions", "<p data-parsoid='{\"dsr\":[0,77,0,0]}'><sup id=\"cite_ref-foo_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,77,45,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-foo-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-foo-1\"},\"sa\":{\"href\":\"#cite_note-foo-1\"},\"dsr\":[45,71,19,2]}'>[2 1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[79,321,0,0]}'><li data-parsoid='{\"dsr\":[79,321,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[81,142,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-foo_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-foo_1-0\"},\"sa\":{\"href\":\"#cite_ref-foo_1-0\"},\"dsr\":[112,135,20,2]}'>↑</a></span> <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[143,321,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[221,256,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[227,249,8,9]}'>&lt;ref></span></code> tag; no text was provided for refs named <code data-parsoid='{\"stx\":\"html\",\"dsr\":[298,314,6,7]}'>foo</code></span></li></ol>\n\n<p data-parsoid='{\"dsr\":[323,933,0,0]}'><span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[323,539,58,7]}'>Cite error: <code data-parsoid='{\"stx\":\"html\",\"dsr\":[393,428,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[399,421,8,9]}'>&lt;ref></span></code> tag with name \"unused\" defined in <code data-parsoid='{\"stx\":\"html\",\"dsr\":[463,505,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[469,498,8,9]}'>&lt;references></span></code> is not used in prior text.</span>\n<span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[540,739,58,7]}'>Cite error: <code data-parsoid='{\"stx\":\"html\",\"dsr\":[610,645,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[616,638,8,9]}'>&lt;ref></span></code> tag in <code data-parsoid='{\"stx\":\"html\",\"dsr\":[653,695,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[659,688,8,9]}'>&lt;references></span></code> has conflicting group attribute \"1\".</span>\n<span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[740,933,58,7]}'>Cite error: <code data-parsoid='{\"stx\":\"html\",\"dsr\":[810,845,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[816,838,8,9]}'>&lt;ref></span></code> tag defined in <code data-parsoid='{\"stx\":\"html\",\"dsr\":[861,903,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[867,896,8,9]}'>&lt;references></span></code> has no name attribute.</span></p>\n");
-add("html2html", "<ref> with custom group link with number names in Klingon", "<p data-parsoid='{\"dsr\":[0,83,0,0]}'>Wikipedia rocks!<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[16,83,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[55,76,15,2]}'>[wa'</a>]</sup></p>\n\n<ol data-parsoid='{\"dsr\":[85,210,0,0]}'><li data-parsoid='{\"dsr\":[85,210,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[87,142,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[118,135,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[143,210,29,7]}'>Proceeds of Rockology, vol. XXI</span></li></ol>\n");
-add("html2html", "Bug 31374 regression check: nested strip items", "<p data-parsoid='{\"dsr\":[0,70,0,0]}'><sup id=\"cite_ref-2\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,70,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-2\"},\"sa\":{\"href\":\"#cite_note-2\"},\"dsr\":[39,64,15,2]}'>[Note 1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[72,235,0,0]}'><li data-parsoid='{\"dsr\":[72,235,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[74,129,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-2\"},\"sa\":{\"href\":\"#cite_ref-2\"},\"dsr\":[105,122,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[130,235,29,7]}'>note<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[163,228,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[202,222,15,2]}'>[1]</a></sup></span></li></ol>\n\n<ol data-parsoid='{\"dsr\":[237,340,0,0]}'><li data-parsoid='{\"dsr\":[237,340,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[239,294,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[270,287,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[295,340,29,7]}'>reference</span></li></ol>\n");
-add("html2html", "Bug 13073 regression check: wrapped <references>", "<p data-parsoid='{\"dsr\":[0,65,0,0]}'><sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,65,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[39,59,15,2]}'>[1]</a></sup></p>\n\n<div data-parsoid='{\"stx\":\"html\",\"dsr\":[67,179,5,6]}'>\n<ol data-parsoid='{\"dsr\":[73,171,0,0]}'><li data-parsoid='{\"dsr\":[73,171,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[75,130,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[106,123,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[131,171,29,7]}'> foo</span></li></ol>\n\n</div>\n");
-add("html2html", "<ref> with a non-empty name parameter and no content.", "<p data-parsoid='{\"dsr\":[0,81,0,0]}'>Bla.<sup id=\"cite_ref-void_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[4,81,46,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-void-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-void-1\"},\"sa\":{\"href\":\"#cite_note-void-1\"},\"dsr\":[50,75,20,2]}'>[1]</a></sup></p>\n<ol data-parsoid='{\"dsr\":[82,326,0,0]}'><li data-parsoid='{\"dsr\":[82,326,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[84,146,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-void_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-void_1-0\"},\"sa\":{\"href\":\"#cite_ref-void_1-0\"},\"dsr\":[115,139,21,2]}'>↑</a></span> <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[147,326,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[225,260,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[231,253,8,9]}'>&lt;ref></span></code> tag; no text was provided for refs named <code data-parsoid='{\"stx\":\"html\",\"dsr\":[302,319,6,7]}'>void</code></span></li></ol>\n");
-add("html2html", "<ref>s with the follow parameter", "<p data-parsoid='{\"dsr\":[0,96,0,0]}'>Page one.<sup id=\"cite_ref-beginning_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[9,96,51,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-beginning-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-beginning-1\"},\"sa\":{\"href\":\"#cite_note-beginning-1\"},\"dsr\":[60,90,25,2]}'>[1]</a></sup></p>\n\n<p data-parsoid='{\"dsr\":[98,107,0,0]}'>Page two.</p>\n\n<h2 id=\"References\" data-parsoid='{\"dsr\":[109,125,2,2]}'>References</h2>\n\n<ol data-parsoid='{\"dsr\":[127,285,0,0]}'><li data-parsoid='{\"dsr\":[127,285,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[129,196,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-beginning_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-beginning_1-0\"},\"sa\":{\"href\":\"#cite_ref-beginning_1-0\"},\"dsr\":[160,189,26,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[197,285,29,7]}'>First page footnote text. Second page footnote text.</span></li></ol>\n");
-add("html2html", "Multiple definition (outside <references/>)", "<p data-parsoid='{\"dsr\":[0,143,0,0]}'><sup id=\"cite_ref-a_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,71,43,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-a-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-a-1\"},\"sa\":{\"href\":\"#cite_note-a-1\"},\"dsr\":[43,65,17,2]}'>[1]</a></sup>\n<sup id=\"cite_ref-a_1-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[72,143,43,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-a-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-a-1\"},\"sa\":{\"href\":\"#cite_note-a-1\"},\"dsr\":[115,137,17,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[145,477,0,0]}'><li data-parsoid='{\"dsr\":[145,477,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[147,256,31,7]}'>↑ <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[180,214,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-a_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-a_1-0\"},\"sa\":{\"href\":\"#cite_ref-a_1-0\"},\"dsr\":[185,208,18,2]}'>1.0</a></sup> <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[215,249,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-a_1-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-a_1-1\"},\"sa\":{\"href\":\"#cite_ref-a_1-1\"},\"dsr\":[220,243,18,2]}'>1.1</a></sup></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[257,477,29,7]}'>abc <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[290,470,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[368,403,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[374,396,8,9]}'>&lt;ref></span></code> tag; name \"a\" defined multiple times with different content</span></span></li></ol>\n");
-add("html2html", "Multiple definition (inside <references/>)", "<p data-parsoid='{\"dsr\":[0,71,0,0]}'><sup id=\"cite_ref-a_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,71,43,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-a-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-a-1\"},\"sa\":{\"href\":\"#cite_note-a-1\"},\"dsr\":[43,65,17,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[73,355,0,0]}'><li data-parsoid='{\"dsr\":[73,355,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[75,134,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-a_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-a_1-0\"},\"sa\":{\"href\":\"#cite_ref-a_1-0\"},\"dsr\":[106,127,18,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[135,355,29,7]}'>abc <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[168,348,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[246,281,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[252,274,8,9]}'>&lt;ref></span></code> tag; name \"a\" defined multiple times with different content</span></span></li></ol>\n");
-add("html2html", "Multiple definition (mixed outside/inside)", "<p data-parsoid='{\"dsr\":[0,71,0,0]}'><sup id=\"cite_ref-a_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,71,43,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-a-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-a-1\"},\"sa\":{\"href\":\"#cite_note-a-1\"},\"dsr\":[43,65,17,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[73,355,0,0]}'><li data-parsoid='{\"dsr\":[73,355,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[75,134,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-a_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-a_1-0\"},\"sa\":{\"href\":\"#cite_ref-a_1-0\"},\"dsr\":[106,127,18,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[135,355,29,7]}'>abc <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[168,348,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[246,281,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[252,274,8,9]}'>&lt;ref></span></code> tag; name \"a\" defined multiple times with different content</span></span></li></ol>\n");
-add("html2html", "Multiple definition (inside {{#tag:references}})", "<p data-parsoid='{\"dsr\":[0,71,0,0]}'><sup id=\"cite_ref-a_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,71,43,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-a-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-a-1\"},\"sa\":{\"href\":\"#cite_note-a-1\"},\"dsr\":[43,65,17,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[73,355,0,0]}'><li data-parsoid='{\"dsr\":[73,355,1,0]}'><span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[75,134,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-a_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-a_1-0\"},\"sa\":{\"href\":\"#cite_ref-a_1-0\"},\"dsr\":[106,127,18,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[135,355,29,7]}'>abc <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[168,348,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[246,281,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[252,274,8,9]}'>&lt;ref></span></code> tag; name \"a\" defined multiple times with different content</span></span></li></ol>\n");
+add("html2html", "Simple <ref>, no <references/>", "<p data-parsoid='{\"dsr\":[0,81,0,0]}'>Wikipedia rocks!<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[16,81,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[55,75,15,2]}'>[1]</a></sup></p>\n<ol data-parsoid='{\"dsr\":[82,207,0,0]}'><li data-parsoid='{\"dsr\":[82,207,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[84,139,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[115,132,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[140,207,29,7]}'>Proceeds of Rockology, vol. XXI</span></li></ol>\n");
+add("html2html", "Simple <ref>, with <references/>", "<p data-parsoid='{\"dsr\":[0,81,0,0]}'>Wikipedia rocks!<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[16,81,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[55,75,15,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[83,208,0,0]}'><li data-parsoid='{\"dsr\":[83,208,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[85,140,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[116,133,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[141,208,29,7]}'>Proceeds of Rockology, vol. XXI</span></li></ol>\n");
+add("html2html", "<ref> with a simple template", "<p data-parsoid='{\"dsr\":[0,75,0,0]}'>Templating<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[10,75,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[49,69,15,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[77,193,0,0]}'><li data-parsoid='{\"dsr\":[77,193,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[79,134,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[110,127,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[135,193,29,7]}'>A <i data-parsoid='{\"dsr\":[166,176,2,2]}'>simple</i> template.</span></li></ol>\n");
+add("html2html", "<ref> with a <nowiki>", "<p data-parsoid='{\"dsr\":[0,75,0,0]}'>Templating<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[10,75,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[49,69,15,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[77,207,0,0]}'><li data-parsoid='{\"dsr\":[77,207,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[79,134,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[110,127,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[135,207,29,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[164,200,8,9]}'>{{simple template}}</span></span></li></ol>\n");
+add("html2html", "<!--comment--> in a <ref> (bug 5384)", "<p data-parsoid='{\"dsr\":[0,75,0,0]}'>Templating<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[10,75,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[49,69,15,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[77,175,0,0]}'><li data-parsoid='{\"dsr\":[77,175,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[79,134,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[110,127,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[135,175,29,7]}'>Text</span></li></ol>\n");
+add("html2html", "<references> after <gallery> (bug 6164)", "<p data-parsoid='{\"dsr\":[0,65,0,0]}'><sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,65,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[39,59,15,2]}'>[1]</a></sup></p>\n\n<p data-parsoid='{\"dsr\":[67,71,0,0]}'>\t\t* </p><div style=\"width: 155px\" data-parsoid='{\"stx\":\"html\",\"dsr\":[71,296,26,6]}'> \t\t\t<div class=\"thumb\" style=\"width: 150px;\" data-parsoid='{\"stx\":\"html\",\"dsr\":[101,249,41,6]}'><div style=\"margin:68px auto;\" data-parsoid='{\"stx\":\"html\",\"dsr\":[142,243,31,6]}'><img src=\"http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg\" alt=\"120px-Foobar.jpg\" rel=\"mw:externalImage\" data-parsoid='{\"dsr\":[173,237,null,null]}'/></div></div> \t\t\t<div class=\"gallerytext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[253,287,25,6]}'>\t\t\t</div> \t\t</div>\n\n<ol data-parsoid='{\"dsr\":[298,395,0,0]}'><li data-parsoid='{\"dsr\":[298,395,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[300,355,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[331,348,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[356,395,29,7]}'>one</span></li></ol>\n");
+add("html2html", "{{REVISIONID}} on page with <ref> (bug 6299)", "<p data-parsoid='{\"dsr\":[0,69,0,0]}'>1337<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[4,69,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[43,63,15,2]}'>[1]</a></sup></p>\n<ol data-parsoid='{\"dsr\":[70,169,0,0]}'><li data-parsoid='{\"dsr\":[70,169,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[72,127,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[103,120,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[128,169,29,7]}'>elite</span></li></ol>\n");
+add("html2html", "Ref with content followed by blank ref", "<p data-parsoid='{\"dsr\":[0,79,0,0]}'><sup id=\"cite_ref-blank_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,79,47,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-blank-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-blank-1\"},\"sa\":{\"href\":\"#cite_note-blank-1\"},\"dsr\":[47,73,21,2]}'>[1]</a></sup></p>\n\n<p data-parsoid='{\"dsr\":[81,160,0,0]}'><sup id=\"cite_ref-blank_1-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[81,160,47,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-blank-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-blank-1\"},\"sa\":{\"href\":\"#cite_note-blank-1\"},\"dsr\":[128,154,21,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[162,325,0,0]}'><li data-parsoid='{\"dsr\":[162,325,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[164,281,31,7]}'>↑ <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[197,235,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-blank_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-blank_1-0\"},\"sa\":{\"href\":\"#cite_ref-blank_1-0\"},\"dsr\":[202,229,22,2]}'>1.0</a></sup> <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[236,274,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-blank_1-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-blank_1-1\"},\"sa\":{\"href\":\"#cite_ref-blank_1-1\"},\"dsr\":[241,268,22,2]}'>1.1</a></sup></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[282,325,29,7]}'>content</span></li></ol>\n");
+add("html2html", "Blank ref followed by ref with content", "<p data-parsoid='{\"dsr\":[0,79,0,0]}'><sup id=\"cite_ref-blank_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,79,47,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-blank-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-blank-1\"},\"sa\":{\"href\":\"#cite_note-blank-1\"},\"dsr\":[47,73,21,2]}'>[1]</a></sup></p>\n\n<p data-parsoid='{\"dsr\":[81,160,0,0]}'><sup id=\"cite_ref-blank_1-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[81,160,47,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-blank-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-blank-1\"},\"sa\":{\"href\":\"#cite_note-blank-1\"},\"dsr\":[128,154,21,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[162,325,0,0]}'><li data-parsoid='{\"dsr\":[162,325,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[164,281,31,7]}'>↑ <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[197,235,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-blank_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-blank_1-0\"},\"sa\":{\"href\":\"#cite_ref-blank_1-0\"},\"dsr\":[202,229,22,2]}'>1.0</a></sup> <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[236,274,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-blank_1-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-blank_1-1\"},\"sa\":{\"href\":\"#cite_ref-blank_1-1\"},\"dsr\":[241,268,22,2]}'>1.1</a></sup></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[282,325,29,7]}'>content</span></li></ol>\n");
+add("html2html", "Regression: non-blank ref \"0\" followed by ref with content", "<p data-parsoid='{\"dsr\":[0,79,0,0]}'><sup id=\"cite_ref-blank_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,79,47,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-blank-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-blank-1\"},\"sa\":{\"href\":\"#cite_note-blank-1\"},\"dsr\":[47,73,21,2]}'>[1]</a></sup></p>\n\n<p data-parsoid='{\"dsr\":[81,160,0,0]}'><sup id=\"cite_ref-blank_1-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[81,160,47,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-blank-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-blank-1\"},\"sa\":{\"href\":\"#cite_note-blank-1\"},\"dsr\":[128,154,21,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[162,504,0,0]}'><li data-parsoid='{\"dsr\":[162,504,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[164,281,31,7]}'>↑ <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[197,235,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-blank_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-blank_1-0\"},\"sa\":{\"href\":\"#cite_ref-blank_1-0\"},\"dsr\":[202,229,22,2]}'>1.0</a></sup> <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[236,274,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-blank_1-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-blank_1-1\"},\"sa\":{\"href\":\"#cite_ref-blank_1-1\"},\"dsr\":[241,268,22,2]}'>1.1</a></sup></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[282,504,29,7]}'>0 <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[313,497,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[391,426,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[397,419,8,9]}'>&lt;ref></span></code> tag; name \"blank\" defined multiple times with different content</span></span></li></ol>\n");
+add("html2html", "Regression sanity check: non-blank ref \"1\" followed by ref with content", "<p data-parsoid='{\"dsr\":[0,79,0,0]}'><sup id=\"cite_ref-blank_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,79,47,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-blank-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-blank-1\"},\"sa\":{\"href\":\"#cite_note-blank-1\"},\"dsr\":[47,73,21,2]}'>[1]</a></sup></p>\n\n<p data-parsoid='{\"dsr\":[81,160,0,0]}'><sup id=\"cite_ref-blank_1-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[81,160,47,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-blank-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-blank-1\"},\"sa\":{\"href\":\"#cite_note-blank-1\"},\"dsr\":[128,154,21,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[162,504,0,0]}'><li data-parsoid='{\"dsr\":[162,504,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[164,281,31,7]}'>↑ <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[197,235,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-blank_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-blank_1-0\"},\"sa\":{\"href\":\"#cite_ref-blank_1-0\"},\"dsr\":[202,229,22,2]}'>1.0</a></sup> <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[236,274,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-blank_1-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-blank_1-1\"},\"sa\":{\"href\":\"#cite_ref-blank_1-1\"},\"dsr\":[241,268,22,2]}'>1.1</a></sup></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[282,504,29,7]}'>1 <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[313,497,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[391,426,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[397,419,8,9]}'>&lt;ref></span></code> tag; name \"blank\" defined multiple times with different content</span></span></li></ol>\n");
+add("html2html", "Ref names containing a number", "<p data-parsoid='{\"dsr\":[0,259,0,0]}'><sup id=\"cite_ref-test123test_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,91,53,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-test123test-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-test123test-1\"},\"sa\":{\"href\":\"#cite_note-test123test-1\"},\"dsr\":[53,85,27,2]}'>[1]</a></sup>\n<sup id=\"cite_ref-123test_2-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[92,175,49,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-123test-2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-123test-2\"},\"sa\":{\"href\":\"#cite_note-123test-2\"},\"dsr\":[141,169,23,2]}'>[2]</a></sup>\n<sup id=\"cite_ref-test123_3-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[176,259,49,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-test123-3\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-test123-3\"},\"sa\":{\"href\":\"#cite_note-test123-3\"},\"dsr\":[225,253,23,2]}'>[3]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[261,590,0,0]}'><li data-parsoid='{\"dsr\":[261,372,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[263,332,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-test123test_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-test123test_1-0\"},\"sa\":{\"href\":\"#cite_ref-test123test_1-0\"},\"dsr\":[294,325,28,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[333,372,29,7]}'>One</span></li>\n<li data-parsoid='{\"dsr\":[373,480,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[375,440,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-123test_2-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-123test_2-0\"},\"sa\":{\"href\":\"#cite_ref-123test_2-0\"},\"dsr\":[406,433,24,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[441,480,29,7]}'>Two</span></li>\n<li data-parsoid='{\"dsr\":[481,590,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[483,548,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-test123_3-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-test123_3-0\"},\"sa\":{\"href\":\"#cite_ref-test123_3-0\"},\"dsr\":[514,541,24,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[549,590,29,7]}'>Three</span></li></ol>\n");
+add("html2html", "Erroneous refs", "<p data-parsoid='{\"dsr\":[0,182,0,0]}'><span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,182,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[78,113,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[84,106,8,9]}'>&lt;ref></span></code> tag;\nname cannot be a simple integer. Use a descriptive title</span></p>\n\n<p data-parsoid='{\"dsr\":[184,249,0,0]}'><sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[184,249,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[223,243,15,2]}'>[1]</a></sup></p>\n\n<p data-parsoid='{\"dsr\":[251,410,0,0]}'><span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[251,410,58,7]}'>Cite error: The opening <code data-parsoid='{\"stx\":\"html\",\"dsr\":[333,368,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[339,361,8,9]}'>&lt;ref></span></code> tag is malformed or has a bad name</span></p>\n\n<p data-parsoid='{\"dsr\":[412,487,0,0]}'><sup id=\"cite_ref-bar_2-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[412,487,45,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-bar-2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-bar-2\"},\"sa\":{\"href\":\"#cite_note-bar-2\"},\"dsr\":[457,481,19,2]}'>[2]</a></sup></p>\n\n<p data-parsoid='{\"dsr\":[489,598,0,0]}'><sup id=\"cite_ref-blankwithnoreference_3-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[489,598,62,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-blankwithnoreference-3\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-blankwithnoreference-3\"},\"sa\":{\"href\":\"#cite_note-blankwithnoreference-3\"},\"dsr\":[551,592,36,2]}'>[3]</a></sup></p>\n\n<p data-parsoid='{\"dsr\":[600,744,0,0]}'><span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[600,744,58,7]}'>Cite error: Invalid parameter in <code data-parsoid='{\"stx\":\"html\",\"dsr\":[691,733,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[697,726,8,9]}'>&lt;references></span></code> tag</span></p>\n\n<ol data-parsoid='{\"dsr\":[746,1400,0,0]}'><li data-parsoid='{\"dsr\":[746,880,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[748,803,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[779,796,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[804,880,29,7]}'>Also zero, but differently! (Normal ref)</span></li>\n<li data-parsoid='{\"dsr\":[881,1123,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[883,944,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-bar_2-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-bar_2-0\"},\"sa\":{\"href\":\"#cite_ref-bar_2-0\"},\"dsr\":[914,937,20,2]}'>↑</a></span> <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[945,1123,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[1023,1058,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[1029,1051,8,9]}'>&lt;ref></span></code> tag; no text was provided for refs named <code data-parsoid='{\"stx\":\"html\",\"dsr\":[1100,1116,6,7]}'>bar</code></span></li>\n<li data-parsoid='{\"dsr\":[1124,1400,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[1126,1204,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-blankwithnoreference_3-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-blankwithnoreference_3-0\"},\"sa\":{\"href\":\"#cite_ref-blankwithnoreference_3-0\"},\"dsr\":[1157,1197,37,2]}'>↑</a></span> <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[1205,1400,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[1283,1318,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[1289,1311,8,9]}'>&lt;ref></span></code> tag; no text was provided for refs named <code data-parsoid='{\"stx\":\"html\",\"dsr\":[1360,1393,6,7]}'>blankwithnoreference</code></span></li></ol>\n");
+add("html2html", "Simple <ref>, with <references/> in group", "<p data-parsoid='{\"dsr\":[0,168,0,0]}'>Wikipedia rocks!<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[16,81,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[55,75,15,2]}'>[1]</a></sup>\nWikipedia rocks!<sup id=\"cite_ref-2\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[98,168,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-2\"},\"sa\":{\"href\":\"#cite_note-2\"},\"dsr\":[137,162,15,2]}'>[note 1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[170,295,0,0]}'><li data-parsoid='{\"dsr\":[170,295,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[172,227,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[203,220,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[228,295,29,7]}'>Proceeds of Rockology, vol. XXI</span></li></ol>\n\n<ol data-parsoid='{\"dsr\":[297,422,0,0]}'><li data-parsoid='{\"dsr\":[297,422,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[299,354,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-2\"},\"sa\":{\"href\":\"#cite_ref-2\"},\"dsr\":[330,347,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[355,422,29,7]}'>Proceeds of Rockology, vol. XXI</span></li></ol>\n");
+add("html2html", "Simple <ref>, with <references/> in group, with groupname in Chinese", "<p data-parsoid='{\"dsr\":[0,210,0,0]}'>AAA<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[3,70,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[42,64,15,2]}'>[参 1]</a></sup>BBB<sup id=\"cite_ref-2\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[73,140,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-2\"},\"sa\":{\"href\":\"#cite_note-2\"},\"dsr\":[112,134,15,2]}'>[注 1]</a></sup>CCC<sup id=\"cite_ref-3\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[143,210,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-3\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-3\"},\"sa\":{\"href\":\"#cite_note-3\"},\"dsr\":[182,204,15,2]}'>[参 2]</a></sup></p>\n\n<dl data-parsoid='{\"dsr\":[212,218,0,0]}'><dt data-parsoid='{\"dsr\":[212,218,1,0]}'> refs</dt></dl>\n\n<ol data-parsoid='{\"dsr\":[220,419,0,0]}'><li data-parsoid='{\"dsr\":[220,319,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[222,277,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[253,270,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[278,319,29,7]}'>ref a</span></li>\n<li data-parsoid='{\"dsr\":[320,419,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[322,377,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-3\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-3\"},\"sa\":{\"href\":\"#cite_ref-3\"},\"dsr\":[353,370,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[378,419,29,7]}'>ref c</span></li></ol>\n\n<dl data-parsoid='{\"dsr\":[421,428,0,0]}'><dt data-parsoid='{\"dsr\":[421,428,1,0]}'> notes</dt></dl>\n\n<ol data-parsoid='{\"dsr\":[430,530,0,0]}'><li data-parsoid='{\"dsr\":[430,530,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[432,487,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-2\"},\"sa\":{\"href\":\"#cite_ref-2\"},\"dsr\":[463,480,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[488,530,29,7]}'>note b</span></li></ol>\n");
+add("html2html", "<ref> defined in <references>", "<p data-parsoid='{\"dsr\":[0,75,0,0]}'><sup id=\"cite_ref-foo_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,75,45,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-foo-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-foo-1\"},\"sa\":{\"href\":\"#cite_note-foo-1\"},\"dsr\":[45,69,19,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[77,180,0,0]}'><li data-parsoid='{\"dsr\":[77,180,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[79,140,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-foo_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-foo_1-0\"},\"sa\":{\"href\":\"#cite_ref-foo_1-0\"},\"dsr\":[110,133,20,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[141,180,29,7]}'>BAR</span></li></ol>\n");
+add("html2html", "<ref> defined in <references> called with #tag", "<p data-parsoid='{\"dsr\":[0,75,0,0]}'><sup id=\"cite_ref-foo_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,75,45,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-foo-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-foo-1\"},\"sa\":{\"href\":\"#cite_note-foo-1\"},\"dsr\":[45,69,19,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[77,180,0,0]}'><li data-parsoid='{\"dsr\":[77,180,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[79,140,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-foo_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-foo_1-0\"},\"sa\":{\"href\":\"#cite_ref-foo_1-0\"},\"dsr\":[110,133,20,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[141,180,29,7]}'>BAR</span></li></ol>\n");
+add("html2html", "<ref> defined in <references> error conditions", "<p data-parsoid='{\"dsr\":[0,77,0,0]}'><sup id=\"cite_ref-foo_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,77,45,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-foo-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-foo-1\"},\"sa\":{\"href\":\"#cite_note-foo-1\"},\"dsr\":[45,71,19,2]}'>[2 1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[79,321,0,0]}'><li data-parsoid='{\"dsr\":[79,321,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[81,142,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-foo_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-foo_1-0\"},\"sa\":{\"href\":\"#cite_ref-foo_1-0\"},\"dsr\":[112,135,20,2]}'>↑</a></span> <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[143,321,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[221,256,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[227,249,8,9]}'>&lt;ref></span></code> tag; no text was provided for refs named <code data-parsoid='{\"stx\":\"html\",\"dsr\":[298,314,6,7]}'>foo</code></span></li></ol>\n\n<p data-parsoid='{\"dsr\":[323,933,0,0]}'><span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[323,539,58,7]}'>Cite error: <code data-parsoid='{\"stx\":\"html\",\"dsr\":[393,428,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[399,421,8,9]}'>&lt;ref></span></code> tag with name \"unused\" defined in <code data-parsoid='{\"stx\":\"html\",\"dsr\":[463,505,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[469,498,8,9]}'>&lt;references></span></code> is not used in prior text.</span>\n<span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[540,739,58,7]}'>Cite error: <code data-parsoid='{\"stx\":\"html\",\"dsr\":[610,645,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[616,638,8,9]}'>&lt;ref></span></code> tag in <code data-parsoid='{\"stx\":\"html\",\"dsr\":[653,695,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[659,688,8,9]}'>&lt;references></span></code> has conflicting group attribute \"1\".</span>\n<span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[740,933,58,7]}'>Cite error: <code data-parsoid='{\"stx\":\"html\",\"dsr\":[810,845,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[816,838,8,9]}'>&lt;ref></span></code> tag defined in <code data-parsoid='{\"stx\":\"html\",\"dsr\":[861,903,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[867,896,8,9]}'>&lt;references></span></code> has no name attribute.</span></p>\n");
+add("html2html", "<ref> with custom group link with number names in Klingon", "<p data-parsoid='{\"dsr\":[0,83,0,0]}'>Wikipedia rocks!<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[16,83,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[55,76,15,2]}'>[wa'</a>]</sup></p>\n\n<ol data-parsoid='{\"dsr\":[85,210,0,0]}'><li data-parsoid='{\"dsr\":[85,210,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[87,142,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[118,135,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[143,210,29,7]}'>Proceeds of Rockology, vol. XXI</span></li></ol>\n");
+add("html2html", "Bug 31374 regression check: nested strip items", "<p data-parsoid='{\"dsr\":[0,70,0,0]}'><sup id=\"cite_ref-2\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,70,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-2\"},\"sa\":{\"href\":\"#cite_note-2\"},\"dsr\":[39,64,15,2]}'>[Note 1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[72,235,0,0]}'><li data-parsoid='{\"dsr\":[72,235,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[74,129,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-2\"},\"sa\":{\"href\":\"#cite_ref-2\"},\"dsr\":[105,122,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[130,235,29,7]}'>note<sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[163,228,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[202,222,15,2]}'>[1]</a></sup></span></li></ol>\n\n<ol data-parsoid='{\"dsr\":[237,340,0,0]}'><li data-parsoid='{\"dsr\":[237,340,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[239,294,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[270,287,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[295,340,29,7]}'>reference</span></li></ol>\n");
+add("html2html", "Bug 13073 regression check: wrapped <references>", "<p data-parsoid='{\"dsr\":[0,65,0,0]}'><sup id=\"cite_ref-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,65,39,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-1\"},\"sa\":{\"href\":\"#cite_note-1\"},\"dsr\":[39,59,15,2]}'>[1]</a></sup></p>\n\n<div data-parsoid='{\"stx\":\"html\",\"dsr\":[67,179,5,6]}'>\n<ol data-parsoid='{\"dsr\":[73,171,0,0]}'><li data-parsoid='{\"dsr\":[73,171,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[75,130,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-1\"},\"sa\":{\"href\":\"#cite_ref-1\"},\"dsr\":[106,123,14,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[131,171,29,7]}'> foo</span></li></ol>\n\n</div>\n");
+add("html2html", "<ref> with a non-empty name parameter and no content.", "<p data-parsoid='{\"dsr\":[0,81,0,0]}'>Bla.<sup id=\"cite_ref-void_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[4,81,46,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-void-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-void-1\"},\"sa\":{\"href\":\"#cite_note-void-1\"},\"dsr\":[50,75,20,2]}'>[1]</a></sup></p>\n<ol data-parsoid='{\"dsr\":[82,326,0,0]}'><li data-parsoid='{\"dsr\":[82,326,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[84,146,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-void_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-void_1-0\"},\"sa\":{\"href\":\"#cite_ref-void_1-0\"},\"dsr\":[115,139,21,2]}'>↑</a></span> <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[147,326,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[225,260,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[231,253,8,9]}'>&lt;ref></span></code> tag; no text was provided for refs named <code data-parsoid='{\"stx\":\"html\",\"dsr\":[302,319,6,7]}'>void</code></span></li></ol>\n");
+add("html2html", "<ref>s with the follow parameter", "<p data-parsoid='{\"dsr\":[0,96,0,0]}'>Page one.<sup id=\"cite_ref-beginning_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[9,96,51,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-beginning-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-beginning-1\"},\"sa\":{\"href\":\"#cite_note-beginning-1\"},\"dsr\":[60,90,25,2]}'>[1]</a></sup></p>\n\n<p data-parsoid='{\"dsr\":[98,107,0,0]}'>Page two.</p>\n\n<h2 id=\"References\" data-parsoid='{\"dsr\":[109,125,2,2]}'> References </h2>\n\n<ol data-parsoid='{\"dsr\":[127,285,0,0]}'><li data-parsoid='{\"dsr\":[127,285,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[129,196,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-beginning_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-beginning_1-0\"},\"sa\":{\"href\":\"#cite_ref-beginning_1-0\"},\"dsr\":[160,189,26,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[197,285,29,7]}'>First page footnote text. Second page footnote text.</span></li></ol>\n");
+add("html2html", "Multiple definition (outside <references/>)", "<p data-parsoid='{\"dsr\":[0,143,0,0]}'><sup id=\"cite_ref-a_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,71,43,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-a-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-a-1\"},\"sa\":{\"href\":\"#cite_note-a-1\"},\"dsr\":[43,65,17,2]}'>[1]</a></sup>\n<sup id=\"cite_ref-a_1-1\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[72,143,43,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-a-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-a-1\"},\"sa\":{\"href\":\"#cite_note-a-1\"},\"dsr\":[115,137,17,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[145,477,0,0]}'><li data-parsoid='{\"dsr\":[145,477,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[147,256,31,7]}'>↑ <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[180,214,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-a_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-a_1-0\"},\"sa\":{\"href\":\"#cite_ref-a_1-0\"},\"dsr\":[185,208,18,2]}'>1.0</a></sup> <sup data-parsoid='{\"stx\":\"html\",\"dsr\":[215,249,5,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-a_1-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-a_1-1\"},\"sa\":{\"href\":\"#cite_ref-a_1-1\"},\"dsr\":[220,243,18,2]}'>1.1</a></sup></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[257,477,29,7]}'>abc <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[290,470,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[368,403,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[374,396,8,9]}'>&lt;ref></span></code> tag; name \"a\" defined multiple times with different content</span></span></li></ol>\n");
+add("html2html", "Multiple definition (inside <references/>)", "<p data-parsoid='{\"dsr\":[0,71,0,0]}'><sup id=\"cite_ref-a_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,71,43,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-a-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-a-1\"},\"sa\":{\"href\":\"#cite_note-a-1\"},\"dsr\":[43,65,17,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[73,355,0,0]}'><li data-parsoid='{\"dsr\":[73,355,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[75,134,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-a_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-a_1-0\"},\"sa\":{\"href\":\"#cite_ref-a_1-0\"},\"dsr\":[106,127,18,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[135,355,29,7]}'>abc <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[168,348,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[246,281,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[252,274,8,9]}'>&lt;ref></span></code> tag; name \"a\" defined multiple times with different content</span></span></li></ol>\n");
+add("html2html", "Multiple definition (mixed outside/inside)", "<p data-parsoid='{\"dsr\":[0,71,0,0]}'><sup id=\"cite_ref-a_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,71,43,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-a-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-a-1\"},\"sa\":{\"href\":\"#cite_note-a-1\"},\"dsr\":[43,65,17,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[73,355,0,0]}'><li data-parsoid='{\"dsr\":[73,355,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[75,134,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-a_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-a_1-0\"},\"sa\":{\"href\":\"#cite_ref-a_1-0\"},\"dsr\":[106,127,18,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[135,355,29,7]}'>abc <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[168,348,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[246,281,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[252,274,8,9]}'>&lt;ref></span></code> tag; name \"a\" defined multiple times with different content</span></span></li></ol>\n");
+add("html2html", "Multiple definition (inside {{#tag:references}})", "<p data-parsoid='{\"dsr\":[0,71,0,0]}'><sup id=\"cite_ref-a_1-0\" class=\"reference\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,71,43,6]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_note-a-1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_note-a-1\"},\"sa\":{\"href\":\"#cite_note-a-1\"},\"dsr\":[43,65,17,2]}'>[1]</a></sup></p>\n\n<ol data-parsoid='{\"dsr\":[73,355,0,0]}'><li data-parsoid='{\"dsr\":[73,355,1,0]}'> <span class=\"mw-cite-backlink\" data-parsoid='{\"stx\":\"html\",\"dsr\":[75,134,31,7]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#cite_ref-a_1-0\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#cite_ref-a_1-0\"},\"sa\":{\"href\":\"#cite_ref-a_1-0\"},\"dsr\":[106,127,18,2]}'>↑</a></span> <span class=\"reference-text\" data-parsoid='{\"stx\":\"html\",\"dsr\":[135,355,29,7]}'>abc <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[168,348,58,7]}'>Cite error: Invalid <code data-parsoid='{\"stx\":\"html\",\"dsr\":[246,281,6,7]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[252,274,8,9]}'>&lt;ref></span></code> tag; name \"a\" defined multiple times with different content</span></span></li></ol>\n");
add("html2html", "Ref: 8. transclusion wikitext has lower precedence", "<p data-parsoid='{\"dsr\":[0,64,0,0]}'>A <sup about=\"#mwt4\" class=\"mw-ref\" id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[2,41,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;\"><span class=\"mw-reflink-text\">[1]</span></a></sup><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[41,64,8,9]}'> B C}}</span></p>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt6\" data-parsoid='{\"dsr\":[65,79,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 {{echo|</span></li></ol>");
add("html2html", "References: 9. Generate missing references list at the end", "<p data-parsoid='{\"dsr\":[0,52,0,0]}'>A <sup about=\"#mwt3\" class=\"mw-ref\" id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[2,16,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;\"><span class=\"mw-reflink-text\">[1]</span></a></sup> B <sup about=\"#mwt4\" class=\"mw-ref\" id=\"cite_ref-2\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[19,52,24,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-2\"},\"attrs\":{\"group\":\"inexistent\"}}'><a href=\"./Main_Page#cite_note-2\" style=\"counter-reset: mw-Ref 1;\" data-mw-group=\"inexistent\"><span class=\"mw-reflink-text\">[inexistent 1]</span></a></sup></p>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt6\" data-parsoid='{\"dsr\":[53,67,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>\n<ol class=\"mw-references references\" typeof=\"mw:Extension/references\" about=\"#mwt8\" data-mw-group=\"inexistent\" data-parsoid='{\"group\":\"inexistent\",\"dsr\":[68,101,2,2]}' data-mw='{\"name\":\"references\",\"attrs\":{\"group\":\"inexistent\"}}'><li about=\"#cite_note-2\" id=\"cite_note-2\"><a href=\"./Main_Page#cite_ref-2\" data-mw-group=\"inexistent\" rel=\"mw:referencedBy\"><span class=\"mw-linkback-text\">↑ </span></a> <span id=\"mw-reference-text-cite_note-2\" class=\"mw-reference-text\" data-parsoid=\"{}\">bar</span></li></ol>");
// Blacklist for html2wt
add("html2wt", "Simple <ref>, no <references/>", "Wikipedia rocks!<sup id=\"cite_ref-1\" class=\"reference\">[[#cite_note-1|[1]]]</sup>\n# <span class=\"mw-cite-backlink\">[[#cite_ref-1|↑]]</span> <span class=\"reference-text\">Proceeds of Rockology, vol. XXI</span>\n");
add("html2wt", "Simple <ref>, with <references/>", "Wikipedia rocks!<sup id=\"cite_ref-1\" class=\"reference\">[[#cite_note-1|[1]]]</sup>\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-1|↑]]</span> <span class=\"reference-text\">Proceeds of Rockology, vol. XXI</span>\n");
add("html2wt", "<ref> with a simple template", "Templating<sup id=\"cite_ref-1\" class=\"reference\">[[#cite_note-1|[1]]]</sup>\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-1|↑]]</span> <span class=\"reference-text\">A ''simple'' template.</span>\n");
add("html2wt", "<ref> with a <nowiki>", "Templating<sup id=\"cite_ref-1\" class=\"reference\">[[#cite_note-1|[1]]]</sup>\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-1|↑]]</span> <span class=\"reference-text\"><nowiki>{{simple template}}</nowiki></span>\n");
add("html2wt", "<ref> in a <nowiki>", "Templating<nowiki><ref>{{simple template}}</ref></nowiki>\n\n\n");
add("html2wt", "<ref> in a <!--comment-->", "Templating\n\n\n");
add("html2wt", "<!--comment--> in a <ref> (bug 5384)", "Templating<sup id=\"cite_ref-1\" class=\"reference\">[[#cite_note-1|[1]]]</sup>\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-1|↑]]</span> <span class=\"reference-text\">Text</span>\n");
add("html2wt", "<references> after <gallery> (bug 6164)", "<sup id=\"cite_ref-1\" class=\"reference\">[[#cite_note-1|[1]]]</sup>\n\n\t\t* <div style=\"width: 155px\"> \t\t\t<div class=\"thumb\" style=\"width: 150px;\"><div style=\"margin:68px auto;\">http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg</div></div> \t\t\t<div class=\"gallerytext\">\t\t\t</div> \t\t</div>\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-1|↑]]</span> <span class=\"reference-text\">one</span>\n");
add("html2wt", "{{REVISIONID}} on page with <ref> (bug 6299)", "1337<sup id=\"cite_ref-1\" class=\"reference\">[[#cite_note-1|[1]]]</sup>\n# <span class=\"mw-cite-backlink\">[[#cite_ref-1|↑]]</span> <span class=\"reference-text\">elite</span>\n");
add("html2wt", "{{REVISIONID}} on page without <ref> (bug 6299 sanity check)", "1337\n");
add("html2wt", "Ref with content followed by blank ref", "<sup id=\"cite_ref-blank_1-0\" class=\"reference\">[[#cite_note-blank-1|[1]]]</sup>\n\n<sup id=\"cite_ref-blank_1-1\" class=\"reference\">[[#cite_note-blank-1|[1]]]</sup>\n\n# <span class=\"mw-cite-backlink\">↑ <sup>[[#cite_ref-blank_1-0|1.0]]</sup> <sup>[[#cite_ref-blank_1-1|1.1]]</sup></span> <span class=\"reference-text\">content</span>\n");
add("html2wt", "Blank ref followed by ref with content", "<sup id=\"cite_ref-blank_1-0\" class=\"reference\">[[#cite_note-blank-1|[1]]]</sup>\n\n<sup id=\"cite_ref-blank_1-1\" class=\"reference\">[[#cite_note-blank-1|[1]]]</sup>\n\n# <span class=\"mw-cite-backlink\">↑ <sup>[[#cite_ref-blank_1-0|1.0]]</sup> <sup>[[#cite_ref-blank_1-1|1.1]]</sup></span> <span class=\"reference-text\">content</span>\n");
add("html2wt", "Regression: non-blank ref \"0\" followed by ref with content", "<sup id=\"cite_ref-blank_1-0\" class=\"reference\">[[#cite_note-blank-1|[1]]]</sup>\n\n<sup id=\"cite_ref-blank_1-1\" class=\"reference\">[[#cite_note-blank-1|[1]]]</sup>\n\n# <span class=\"mw-cite-backlink\">↑ <sup>[[#cite_ref-blank_1-0|1.0]]</sup> <sup>[[#cite_ref-blank_1-1|1.1]]</sup></span> <span class=\"reference-text\">0 <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: Invalid <code><nowiki><ref></nowiki></code> tag; name \"blank\" defined multiple times with different content</span></span>\n");
add("html2wt", "Regression sanity check: non-blank ref \"1\" followed by ref with content", "<sup id=\"cite_ref-blank_1-0\" class=\"reference\">[[#cite_note-blank-1|[1]]]</sup>\n\n<sup id=\"cite_ref-blank_1-1\" class=\"reference\">[[#cite_note-blank-1|[1]]]</sup>\n\n# <span class=\"mw-cite-backlink\">↑ <sup>[[#cite_ref-blank_1-0|1.0]]</sup> <sup>[[#cite_ref-blank_1-1|1.1]]</sup></span> <span class=\"reference-text\">1 <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: Invalid <code><nowiki><ref></nowiki></code> tag; name \"blank\" defined multiple times with different content</span></span>\n");
add("html2wt", "Ref names containing a number", "<sup id=\"cite_ref-test123test_1-0\" class=\"reference\">[[#cite_note-test123test-1|[1]]]</sup>\n<sup id=\"cite_ref-123test_2-0\" class=\"reference\">[[#cite_note-123test-2|[2]]]</sup>\n<sup id=\"cite_ref-test123_3-0\" class=\"reference\">[[#cite_note-test123-3|[3]]]</sup>\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-test123test_1-0|↑]]</span> <span class=\"reference-text\">One</span>\n# <span class=\"mw-cite-backlink\">[[#cite_ref-123test_2-0|↑]]</span> <span class=\"reference-text\">Two</span>\n# <span class=\"mw-cite-backlink\">[[#cite_ref-test123_3-0|↑]]</span> <span class=\"reference-text\">Three</span>\n");
add("html2wt", "Erroneous refs", "<span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: Invalid <code><nowiki><ref></nowiki></code> tag;\nname cannot be a simple integer. Use a descriptive title</span>\n\n<sup id=\"cite_ref-1\" class=\"reference\">[[#cite_note-1|[1]]]</sup>\n\n<span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: The opening <code><nowiki><ref></nowiki></code> tag is malformed or has a bad name</span>\n\n<sup id=\"cite_ref-bar_2-0\" class=\"reference\">[[#cite_note-bar-2|[2]]]</sup>\n\n<sup id=\"cite_ref-blankwithnoreference_3-0\" class=\"reference\">[[#cite_note-blankwithnoreference-3|[3]]]</sup>\n\n<span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: Invalid parameter in <code><nowiki><references></nowiki></code> tag</span>\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-1|↑]]</span> <span class=\"reference-text\">Also zero, but differently! (Normal ref)</span>\n# <span class=\"mw-cite-backlink\">[[#cite_ref-bar_2-0|↑]]</span> <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: Invalid <code><nowiki><ref></nowiki></code> tag; no text was provided for refs named <code>bar</code></span>\n# <span class=\"mw-cite-backlink\">[[#cite_ref-blankwithnoreference_3-0|↑]]</span> <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: Invalid <code><nowiki><ref></nowiki></code> tag; no text was provided for refs named <code>blankwithnoreference</code></span>\n");
add("html2wt", "Simple <ref>, with <references/> in group", "Wikipedia rocks!<sup id=\"cite_ref-1\" class=\"reference\">[[#cite_note-1|[1]]]</sup>\nWikipedia rocks!<sup id=\"cite_ref-2\" class=\"reference\">[[#cite_note-2|[note 1]]]</sup>\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-1|↑]]</span> <span class=\"reference-text\">Proceeds of Rockology, vol. XXI</span>\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-2|↑]]</span> <span class=\"reference-text\">Proceeds of Rockology, vol. XXI</span>\n");
add("html2wt", "Simple <ref>, with <references/> in group, with groupname in Chinese", "AAA<sup id=\"cite_ref-1\" class=\"reference\">[[#cite_note-1|[参 1]]]</sup>BBB<sup id=\"cite_ref-2\" class=\"reference\">[[#cite_note-2|[注 1]]]</sup>CCC<sup id=\"cite_ref-3\" class=\"reference\">[[#cite_note-3|[参 2]]]</sup>\n\n; refs\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-1|↑]]</span> <span class=\"reference-text\">ref a</span>\n# <span class=\"mw-cite-backlink\">[[#cite_ref-3|↑]]</span> <span class=\"reference-text\">ref c</span>\n\n; notes\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-2|↑]]</span> <span class=\"reference-text\">note b</span>\n");
add("html2wt", "<ref> defined in <references>", "<sup id=\"cite_ref-foo_1-0\" class=\"reference\">[[#cite_note-foo-1|[1]]]</sup>\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-foo_1-0|↑]]</span> <span class=\"reference-text\">BAR</span>\n");
add("html2wt", "<ref> defined in <references> called with #tag", "<sup id=\"cite_ref-foo_1-0\" class=\"reference\">[[#cite_note-foo-1|[1]]]</sup>\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-foo_1-0|↑]]</span> <span class=\"reference-text\">BAR</span>\n");
add("html2wt", "<ref> defined in <references> error conditions", "<sup id=\"cite_ref-foo_1-0\" class=\"reference\">[[#cite_note-foo-1|[2 1]]]</sup>\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-foo_1-0|↑]]</span> <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: Invalid <code><nowiki><ref></nowiki></code> tag; no text was provided for refs named <code>foo</code></span>\n\n<span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: <code><nowiki><ref></nowiki></code> tag with name \"unused\" defined in <code><nowiki><references></nowiki></code> is not used in prior text.</span>\n<span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: <code><nowiki><ref></nowiki></code> tag in <code><nowiki><references></nowiki></code> has conflicting group attribute \"1\".</span>\n<span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: <code><nowiki><ref></nowiki></code> tag defined in <code><nowiki><references></nowiki></code> has no name attribute.</span>\n");
add("html2wt", "<ref> with custom group link with number names in Klingon", "Wikipedia rocks!<sup id=\"cite_ref-1\" class=\"reference\">[[#cite_note-1|[wa']]]</sup>\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-1|↑]]</span> <span class=\"reference-text\">Proceeds of Rockology, vol. XXI</span>\n");
add("html2wt", "Bug 31374 regression check: nested strip items", "<sup id=\"cite_ref-2\" class=\"reference\">[[#cite_note-2|[Note 1]]]</sup>\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-2|↑]]</span> <span class=\"reference-text\">note<sup id=\"cite_ref-1\" class=\"reference\">[[#cite_note-1|[1]]]</sup></span>\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-1|↑]]</span> <span class=\"reference-text\">reference</span>\n");
add("html2wt", "Bug 13073 regression check: wrapped <references>", "<sup id=\"cite_ref-1\" class=\"reference\">[[#cite_note-1|[1]]]</sup>\n\n<div>\n# <span class=\"mw-cite-backlink\">[[#cite_ref-1|↑]]</span> <span class=\"reference-text\"> foo</span>\n\n</div>\n");
add("html2wt", "<ref> with no name and no content.", "Bla.<span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: Invalid <code><nowiki><ref></nowiki></code> tag;\nrefs with no name must have content</span>\n");
add("html2wt", "<ref> with an empty-string name parameter and no content.", "Bla.<span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: Invalid <code><nowiki><ref></nowiki></code> tag;\nrefs with no name must have content</span>\n");
add("html2wt", "<ref> with a non-empty name parameter and no content.", "Bla.<sup id=\"cite_ref-void_1-0\" class=\"reference\">[[#cite_note-void-1|[1]]]</sup>\n# <span class=\"mw-cite-backlink\">[[#cite_ref-void_1-0|↑]]</span> <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: Invalid <code><nowiki><ref></nowiki></code> tag; no text was provided for refs named <code>void</code></span>\n");
add("html2wt", "<ref>s with the follow parameter", "Page one.<sup id=\"cite_ref-beginning_1-0\" class=\"reference\">[[#cite_note-beginning-1|[1]]]</sup>\n\nPage two.\n\n== References ==\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-beginning_1-0|↑]]</span> <span class=\"reference-text\">First page footnote text. Second page footnote text.</span>\n");
add("html2wt", "<ref> with both name and follow parameters - invalid", "Page one.<span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: Invalid <code><nowiki><ref></nowiki></code> tag;\ninvalid names, e.g. too many</span>\n");
add("html2wt", "Multiple definition (outside <references/>)", "<sup id=\"cite_ref-a_1-0\" class=\"reference\">[[#cite_note-a-1|[1]]]</sup>\n<sup id=\"cite_ref-a_1-1\" class=\"reference\">[[#cite_note-a-1|[1]]]</sup>\n\n# <span class=\"mw-cite-backlink\">↑ <sup>[[#cite_ref-a_1-0|1.0]]</sup> <sup>[[#cite_ref-a_1-1|1.1]]</sup></span> <span class=\"reference-text\">abc <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: Invalid <code><nowiki><ref></nowiki></code> tag; name \"a\" defined multiple times with different content</span></span>\n");
add("html2wt", "Multiple definition (inside <references/>)", "<sup id=\"cite_ref-a_1-0\" class=\"reference\">[[#cite_note-a-1|[1]]]</sup>\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-a_1-0|↑]]</span> <span class=\"reference-text\">abc <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: Invalid <code><nowiki><ref></nowiki></code> tag; name \"a\" defined multiple times with different content</span></span>\n");
add("html2wt", "Multiple definition (mixed outside/inside)", "<sup id=\"cite_ref-a_1-0\" class=\"reference\">[[#cite_note-a-1|[1]]]</sup>\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-a_1-0|↑]]</span> <span class=\"reference-text\">abc <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: Invalid <code><nowiki><ref></nowiki></code> tag; name \"a\" defined multiple times with different content</span></span>\n");
add("html2wt", "Multiple definition (inside {{#tag:references}})", "<sup id=\"cite_ref-a_1-0\" class=\"reference\">[[#cite_note-a-1|[1]]]</sup>\n\n# <span class=\"mw-cite-backlink\">[[#cite_ref-a_1-0|↑]]</span> <span class=\"reference-text\">abc <span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: Invalid <code><nowiki><ref></nowiki></code> tag; name \"a\" defined multiple times with different content</span></span>\n");
add("html2wt", "Ref: 3. spaces in ref-names should be ignored", "A <ref name=\"x\">foo</ref>\nB <ref name=\"x\" />\nC <ref name=\"x\" />\n<references />");
add("html2wt", "Ref: 5. body should accept generic wikitext", "A <ref>This is a '''[[bolded link]]''' and this is a {{echo|transclusion}}\n</ref>\n\n<references />");
add("html2wt", "Ref: 6. indent-pres should not be output in ref-body", "A <ref>foo\n bar\n baz\n</ref>\n\n<references />");
add("html2wt", "Ref: 7. No p-wrapping in ref-body", "A <ref>foo\nbar\nbaz\nbooz\n</ref>\n\n<references />");
add("html2wt", "Ref: 8. transclusion wikitext has lower precedence", "A <ref><nowiki>foo {{echo|</nowiki></ref><nowiki> B C}}</nowiki>\n<references />");
add("html2wt", "Ref: 9. unclosed comments should not leak out of ref-body", "A <ref>foo <!----></ref> B C\n<references />");
add("html2wt", "Ref: 10. Unclosed HTML tags should not leak out of ref-body", "A <ref><b> foo </ref> B C\n\n<references />");
add("html2wt", "References: 9. Generate missing references list at the end", "A <ref>foo</ref> B <ref group=\"inexistent\">bar</ref>\n<references />\n<references group=\"inexistent\" />");
// Blacklist for selser
add("selser", "Simple <ref>, no <references/> [2,0,0]", "1618kiq\n\nWikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>");
add("selser", "Simple <ref>, no <references/> [3,0,0]", "\n");
add("selser", "Simple <ref>, no <references/> [[3,0],0,0]", "<ref>Proceeds of Rockology, vol. XXI</ref>\n");
add("selser", "Simple <ref>, no <references/> [[4,0],2,0]", "vkomsc<ref>Proceeds of Rockology, vol. XXI</ref>\n\nx9946h\n");
add("selser", "Simple <ref>, no <references/> [4,4,0]", "1xru5nr\n\n17y1u9b");
add("selser", "Simple <ref>, no <references/> [4,0,0]", "11giwoh\n");
add("selser", "Simple <ref>, no <references/> [3,4,0]", "1um7ibt");
add("selser", "Simple <ref>, no <references/> [[2,0],0,0]", "10ki8pmWikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\n");
add("selser", "Simple <ref>, no <references/> [3,2,0]", "163orz7\n");
add("selser", "Simple <ref>, no <references/> [1,2,0]", "Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\n\n18t4cte\n");
add("selser", "Simple <ref>, no <references/> [[4,0],4,0]", "4q5ua9<ref>Proceeds of Rockology, vol. XXI</ref>\n\n1e0uxzv");
add("selser", "Simple <ref>, no <references/> [1,4,0]", "Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\n\nbzza9r");
add("selser", "Simple <ref>, no <references/> [4,2,0]", "1s4gyw0\n\n1ixbzjf\n");
add("selser", "Simple <ref>, no <references/> [0,4,0]", "Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\n\n1rdol44");
add("selser", "Simple <ref>, no <references/> [[4,0],0,0]", "1l3ibd<ref>Proceeds of Rockology, vol. XXI</ref>\n");
add("selser", "Simple <ref>, no <references/> [0,3,0]", "Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>");
add("selser", "Simple <ref>, no <references/> [[3,0],3,0]", "<ref>Proceeds of Rockology, vol. XXI</ref>");
add("selser", "Simple <ref>, no <references/> [1,0,0]", "Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\n");
add("selser", "Simple <ref>, no <references/> [0,2,0]", "Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\n\nhlajmc\n");
add("selser", "Simple <ref>, with <references/> [0,3,0]", "Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref><references/>");
add("selser", "Simple <ref>, with <references/> [[3,0],0,0]", "<ref>Proceeds of Rockology, vol. XXI</ref>\n\n<references/>");
add("selser", "Simple <ref>, with <references/> [0,4,0]", "Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\n\nac295a<references/>");
add("selser", "Simple <ref>, with <references/> [2,4,0]", "1pgtgnm\n\nWikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\n\npkn61x<references/>");
add("selser", "Simple <ref>, with <references/> [1,0,0]", "Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\n\n<references/>");
add("selser", "Simple <ref>, with <references/> [3,0,0]", "\n<references/>");
add("selser", "Simple <ref>, with <references/> [[4,0],2,0]", "jgrqqr<ref>Proceeds of Rockology, vol. XXI</ref>\n\n6evs22\n\n<references/>");
add("selser", "Simple <ref>, with <references/> [[4,0],4,0]", "sry0si<ref>Proceeds of Rockology, vol. XXI</ref>\n\n1lcnz50<references/>");
add("selser", "Simple <ref>, with <references/> [4,0,0]", "cq6zns\n\n<references/>");
add("selser", "Simple <ref>, with <references/> [4,2,0]", "1moyztu\n\n5fvpzu\n\n<references/>");
add("selser", "Simple <ref>, with <references/> [[2,0],2,0]", "ldo2d3Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\n\n1k84dd\n\n<references/>");
add("selser", "Simple <ref>, with <references/> [[2,0],0,0]", "bx6qyqWikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\n\n<references/>");
add("selser", "Simple <ref>, with <references/> [3,4,0]", "1u7einu<references/>");
add("selser", "Simple <ref>, with <references/> [4,3,0]", "yy0v55<references/>");
add("selser", "Simple <ref>, with <references/> [4,4,0]", "1i10sg1\n\n1pfvs3z<references/>");
add("selser", "Simple <ref>, with <references/> [[3,0],4,0]", "<ref>Proceeds of Rockology, vol. XXI</ref>\n\nykrjys<references/>");
add("selser", "Simple <ref>, with <references/> [[4,0],0,0]", "zhh349<ref>Proceeds of Rockology, vol. XXI</ref>\n\n<references/>");
add("selser", "Simple <ref>, with <references/> [[3,0],2,0]", "<ref>Proceeds of Rockology, vol. XXI</ref>\n\nqftp90\n\n<references/>");
add("selser", "Simple <ref>, with <references/> [1,2,0]", "Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\n\n2uaj73\n\n<references/>");
add("selser", "<ref> with a simple template [[4,0],0,0]", "lb3xqw<ref>{{simple template}}</ref>\n\n<references/>");
add("selser", "<ref> with a simple template [1,0,0]", "Templating<ref>{{simple template}}</ref>\n\n<references/>");
add("selser", "<ref> with a simple template [3,4,0]", "13kdddv<references/>");
add("selser", "<ref> with a simple template [3,0,0]", "\n<references/>");
add("selser", "<ref> with a simple template [4,0,0]", "1x2sbvn\n\n<references/>");
add("selser", "<ref> with a simple template [[2,0],0,0]", "8rkf5iTemplating<ref>{{simple template}}</ref>\n\n<references/>");
add("selser", "<ref> with a simple template [1,4,0]", "Templating<ref>{{simple template}}</ref>\n\n1arywk<references/>");
add("selser", "<ref> with a simple template [[2,0],4,0]", "1ylwnw5Templating<ref>{{simple template}}</ref>\n\n1dilcka<references/>");
add("selser", "<ref> with a simple template [[3,0],0,0]", "<ref>{{simple template}}</ref>\n\n<references/>");
add("selser", "<ref> with a simple template [2,0,0]", "lqtr8f\n\nTemplating<ref>{{simple template}}</ref>\n\n<references/>");
add("selser", "<ref> with a simple template [[4,0],4,0]", "lvn73v<ref>{{simple template}}</ref>\n\n13g5xj1<references/>");
add("selser", "<ref> with a simple template [2,4,0]", "lmnok8\n\nTemplating<ref>{{simple template}}</ref>\n\n11ciaoq<references/>");
add("selser", "<ref> with a simple template [[3,0],3,0]", "<ref>{{simple template}}</ref><references/>");
add("selser", "<ref> with a simple template [0,3,0]", "Templating<ref>{{simple template}}</ref><references/>");
add("selser", "<ref> with a simple template [0,2,0]", "Templating<ref>{{simple template}}</ref>\n\n1467oep\n\n<references/>");
add("selser", "<ref> with a simple template [4,3,0]", "11zr9xh<references/>");
add("selser", "<ref> with a simple template [4,4,0]", "1saychx\n\n1k2o19k<references/>");
add("selser", "<ref> with a simple template [1,2,0]", "Templating<ref>{{simple template}}</ref>\n\n6zmw0a\n\n<references/>");
add("selser", "<ref> with a simple template [3,2,0]", "16thjyc\n\n<references/>");
add("selser", "<ref> with a <nowiki> [3,0,0]", "\n<references/>");
add("selser", "<ref> with a <nowiki> [[2,0],4,0]", "815zw4Templating<ref><nowiki>{{simple template}}</nowiki></ref>\n\n1vxfv0d<references/>");
add("selser", "<ref> with a <nowiki> [0,3,0]", "Templating<ref><nowiki>{{simple template}}</nowiki></ref><references/>");
add("selser", "<ref> with a <nowiki> [[4,0],2,0]", "sn49i7<ref><nowiki>{{simple template}}</nowiki></ref>\n\njfscwo\n\n<references/>");
add("selser", "<ref> with a <nowiki> [2,0,0]", "1slm8od\n\nTemplating<ref><nowiki>{{simple template}}</nowiki></ref>\n\n<references/>");
add("selser", "<ref> with a <nowiki> [4,0,0]", "zlvr2w\n\n<references/>");
add("selser", "<ref> with a <nowiki> [[3,0],3,0]", "<ref><nowiki>{{simple template}}</nowiki></ref><references/>");
add("selser", "<ref> with a <nowiki> [[3,0],0,0]", "<ref><nowiki>{{simple template}}</nowiki></ref>\n\n<references/>");
add("selser", "<ref> with a <nowiki> [4,4,0]", "14zf7do\n\n1y7pom4<references/>");
add("selser", "<ref> with a <nowiki> [4,2,0]", "1jtfzh7\n\n1xaufno\n\n<references/>");
add("selser", "<ref> with a <nowiki> [0,4,0]", "Templating<ref><nowiki>{{simple template}}</nowiki></ref>\n\nwwyku0<references/>");
add("selser", "<ref> with a <nowiki> [1,0,0]", "Templating<ref><nowiki>{{simple template}}</nowiki></ref>\n\n<references/>");
add("selser", "<ref> with a <nowiki> [1,3,0]", "Templating<ref><nowiki>{{simple template}}</nowiki></ref><references/>");
add("selser", "<ref> with a <nowiki> [[2,0],3,0]", "kskp27Templating<ref><nowiki>{{simple template}}</nowiki></ref><references/>");
add("selser", "<ref> with a <nowiki> [[2,0],2,0]", "x0plwbTemplating<ref><nowiki>{{simple template}}</nowiki></ref>\n\n1pwd9nz\n\n<references/>");
add("selser", "<ref> with a <nowiki> [4,3,0]", "18tlh49<references/>");
add("selser", "<ref> with a <nowiki> [1,4,0]", "Templating<ref><nowiki>{{simple template}}</nowiki></ref>\n\n3vxy3g<references/>");
add("selser", "<ref> with a <nowiki> [2,2,0]", "bihj86\n\nTemplating<ref><nowiki>{{simple template}}</nowiki></ref>\n\n12p56t9\n\n<references/>");
add("selser", "<ref> with a <nowiki> [3,3,0]", "<references/>");
add("selser", "<ref> in a <nowiki> [[4,0],0,0]", "bxdyes<nowiki><ref>{{simple template}}</ref></nowiki>\n\n<references/>");
add("selser", "<ref> in a <nowiki> [4,0,0]", "136ce6g\n\n<references/>");
add("selser", "<ref> in a <nowiki> [[0,[4]],3,0]", "Templating<nowiki>5q0mfn</nowiki><references/>");
add("selser", "<ref> in a <nowiki> [4,2,0]", "11g8nx5\n\n1nnng1i\n\n<references/>");
add("selser", "<ref> in a <nowiki> [1,3,0]", "Templating<nowiki><ref>{{simple template}}</ref></nowiki><references/>");
add("selser", "<ref> in a <nowiki> [[0,1],2,0]", "Templating<nowiki><ref>{{simple template}}</ref></nowiki>\n\n1b84t9k\n\n<references/>");
add("selser", "<ref> in a <nowiki> [[0,[4]],2,0]", "Templating<nowiki>hq50k0</nowiki>\n\n2l8xhs\n\n<references/>");
add("selser", "<ref> in a <nowiki> [0,4,0]", "Templating<nowiki><ref>{{simple template}}</ref></nowiki>\n\nq3ojhu<references/>");
add("selser", "<ref> in a <nowiki> [4,3,0]", "1j940eo<references/>");
add("selser", "<ref> in a <nowiki> [[0,[2]],4,0]", "Templating<nowiki>jha8g5<ref>{{simple template}}</ref></nowiki>\n\n5i0zgj<references/>");
add("selser", "<ref> in a <nowiki> [3,4,0]", "1bhwg82<references/>");
add("selser", "<ref> in a <nowiki> [4,4,0]", "1e7ynwk\n\n1ob6y4b<references/>");
add("selser", "<ref> in a <nowiki> [[4,[4]],0,0]", "1kka8jp<nowiki>1l2n4rh</nowiki>\n\n<references/>");
add("selser", "<ref> in a <nowiki> [2,2,0]", "1cf0bfy\n\nTemplating<nowiki><ref>{{simple template}}</ref></nowiki>\n\nu7tl59\n\n<references/>");
add("selser", "<ref> in a <nowiki> [[0,2],4,0]", "Templatingzgch3g<nowiki><ref>{{simple template}}</ref></nowiki>\n\niasye4<references/>");
add("selser", "<ref> in a <nowiki> [[3,3],0,0]", "\n<references/>");
add("selser", "<ref> in a <nowiki> [1,2,0]", "Templating<nowiki><ref>{{simple template}}</ref></nowiki>\n\n2qfc6m\n\n<references/>");
add("selser", "<ref> in a <nowiki> [3,0,0]", "\n<references/>");
add("selser", "<ref> in a <nowiki> [[3,1],2,0]", "<nowiki><ref>{{simple template}}</ref></nowiki>\n\n19ujeno\n\n<references/>");
add("selser", "<ref> in a <!--comment--> [1,0,3,0]", "Templating<!--<ref>{{simple template}}</ref>--><references/>");
add("selser", "<ref> in a <!--comment--> [3,2,2,0]", "12jhvgu<!--<ref>{{simple template}}</ref>-->\n\n18g17b7\n\n<references/>");
add("selser", "<ref> in a <!--comment--> [1,4,0,0]", "Templating\n\n5zp45m\n\n<references/>");
add("selser", "<ref> in a <!--comment--> [4,0,0,0]", "1glzb0q<!--<ref>{{simple template}}</ref>-->\n\n<references/>");
add("selser", "<ref> in a <!--comment--> [2,2,2,0]", "zmfmbh\n\nTemplating\n\n1tj3fp8<!--<ref>{{simple template}}</ref>-->\n\nezc5i\n\n<references/>");
add("selser", "<ref> in a <!--comment--> [2,0,0,0]", "1tl5fpe\n\nTemplating<!--<ref>{{simple template}}</ref>-->\n\n<references/>");
add("selser", "<ref> in a <!--comment--> [[2],0,0,0]", "spqmvkTemplating<!--<ref>{{simple template}}</ref>-->\n\n<references/>");
add("selser", "<ref> in a <!--comment--> [1,2,0,0]", "Templating\n\n1bmgt0<!--<ref>{{simple template}}</ref>-->\n\n<references/>");
add("selser", "<ref> in a <!--comment--> [[3],0,3,0]", "<!--<ref>{{simple template}}</ref>--><references/>");
add("selser", "<ref> in a <!--comment--> [[3],4,3,0]", "\nzvdyi6<references/>");
add("selser", "<ref> in a <!--comment--> [0,0,4,0]", "Templating<!--<ref>{{simple template}}</ref>-->\n\nv5f64a<references/>");
add("selser", "<ref> in a <!--comment--> [0,2,0,0]", "Templating\n\njl0u6z<!--<ref>{{simple template}}</ref>-->\n\n<references/>");
add("selser", "<ref> in a <!--comment--> [4,2,0,0]", "cxbie7\n\n193651b<!--<ref>{{simple template}}</ref>-->\n\n<references/>");
add("selser", "<ref> in a <!--comment--> [[4],4,0,0]", "rwr21j\n\n3i4vbo\n\n<references/>");
add("selser", "<ref> in a <!--comment--> [0,4,4,0]", "Templating\n\njorx4s\n\novhwlu<references/>");
add("selser", "<ref> in a <!--comment--> [[4],0,0,0]", "55xsbo<!--<ref>{{simple template}}</ref>-->\n\n<references/>");
add("selser", "<ref> in a <!--comment--> [2,0,2,0]", "1o6rlh6\n\nTemplating<!--<ref>{{simple template}}</ref>-->\n\nkvy2h5\n\n<references/>");
add("selser", "<ref> in a <!--comment--> [2,3,0,0]", "1jfh1jf\n\nTemplating\n\n<references/>");
add("selser", "<ref> in a <!--comment--> [0,3,0,0]", "Templating\n\n<references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [[3,0],0,0]", "<ref>Text<!--comment--></ref>\n\n<references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [1,0,0]", "Templating<ref>Text<!--comment--></ref>\n\n<references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [0,4,0]", "Templating<ref>Text<!--comment--></ref>\n\n1eah8c<references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [4,0,0]", "1j2vvn2\n\n<references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [[2,0],0,0]", "qhx68cTemplating<ref>Text<!--comment--></ref>\n\n<references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [1,4,0]", "Templating<ref>Text<!--comment--></ref>\n\ng8kaa8<references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [2,4,0]", "45xvae\n\nTemplating<ref>Text<!--comment--></ref>\n\nz6f8s6<references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [[2,0],3,0]", "kd52goTemplating<ref>Text<!--comment--></ref><references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [0,3,0]", "Templating<ref>Text<!--comment--></ref><references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [0,2,0]", "Templating<ref>Text<!--comment--></ref>\n\n5uxjrm\n\n<references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [2,3,0]", "199xj06\n\nTemplating<ref>Text<!--comment--></ref><references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [4,2,0]", "1yeg3bf\n\n1oxoafc\n\n<references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [[4,0],0,0]", "ipbopo<ref>Text<!--comment--></ref>\n\n<references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [2,0,0]", "8bxrbo\n\nTemplating<ref>Text<!--comment--></ref>\n\n<references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [[4,0],4,0]", "h89q3f<ref>Text<!--comment--></ref>\n\n11enah3<references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [[4,0],2,0]", "qwc1z0<ref>Text<!--comment--></ref>\n\n1kyl4mw\n\n<references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [[3,0],2,0]", "<ref>Text<!--comment--></ref>\n\n1rgnu6\n\n<references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [2,2,0]", "q3ljrl\n\nTemplating<ref>Text<!--comment--></ref>\n\nieou6m\n\n<references/>");
add("selser", "<!--comment--> in a <ref> (bug 5384) [[2,0],2,0]", "20seleTemplating<ref>Text<!--comment--></ref>\n\n1e060aj\n\n<references/>");
add("selser", "<references> after <gallery> (bug 6164) [0,2,0,0,0]", "<ref>one</ref>\n\nojcdyo\n\n<gallery>Image:Foobar.jpg</gallery>\n\n<references/>");
add("selser", "<references> after <gallery> (bug 6164) [0,4,0,2,0]", "<ref>one</ref>\n\n5bjxgx<gallery>Image:Foobar.jpg</gallery>r5xxp1\n\n<references/>");
add("selser", "<references> after <gallery> (bug 6164) [3,3,0,0,0]", "<gallery>Image:Foobar.jpg</gallery>\n\n<references/>");
add("selser", "<references> after <gallery> (bug 6164) [3,0,0,3,0]", "\n<gallery>Image:Foobar.jpg</gallery><references/>");
add("selser", "<references> after <gallery> (bug 6164) [2,0,0,0,0]", "1t7eryg\n\n<ref>one</ref>\n\n<gallery>Image:Foobar.jpg</gallery>\n\n<references/>");
add("selser", "<references> after <gallery> (bug 6164) [0,4,0,3,0]", "<ref>one</ref>\n\nur2cbg<gallery>Image:Foobar.jpg</gallery><references/>");
add("selser", "<references> after <gallery> (bug 6164) [3,0,0,2,0]", "\n<gallery>Image:Foobar.jpg</gallery>1cz0im3\n\n<references/>");
add("selser", "<references> after <gallery> (bug 6164) [2,3,0,0,0]", "1ofgkto\n\n<ref>one</ref><gallery>Image:Foobar.jpg</gallery>\n\n<references/>");
add("selser", "<references> after <gallery> (bug 6164) [1,0,0,0,0]", "<ref>one</ref>\n\n<gallery>Image:Foobar.jpg</gallery>\n\n<references/>");
add("selser", "<references> after <gallery> (bug 6164) [0,0,0,4,0]", "<ref>one</ref>\n\n<gallery>Image:Foobar.jpg</gallery>rbafmv<references/>");
add("selser", "<references> after <gallery> (bug 6164) [0,3,0,4,0]", "<ref>one</ref><gallery>Image:Foobar.jpg</gallery>pa7vx<references/>");
add("selser", "<references> after <gallery> (bug 6164) [4,3,0,0,0]", "145fhvu<gallery>Image:Foobar.jpg</gallery>\n\n<references/>");
add("selser", "<references> after <gallery> (bug 6164) [0,4,0,4,0]", "<ref>one</ref>\n\nxr7goe<gallery>Image:Foobar.jpg</gallery>1gt7p5z<references/>");
add("selser", "<references> after <gallery> (bug 6164) [4,4,0,2,0]", "xw5zvu\n\ned4faj<gallery>Image:Foobar.jpg</gallery>13rjxop\n\n<references/>");
add("selser", "<references> after <gallery> (bug 6164) [1,2,0,0,0]", "<ref>one</ref>\n\n5b6n8b\n\n<gallery>Image:Foobar.jpg</gallery>\n\n<references/>");
add("selser", "<references> after <gallery> (bug 6164) [3,0,0,0,0]", "\n<gallery>Image:Foobar.jpg</gallery>\n\n<references/>");
add("selser", "<references> after <gallery> (bug 6164) [0,3,0,2,0]", "<ref>one</ref><gallery>Image:Foobar.jpg</gallery>bdtml6\n\n<references/>");
add("selser", "<references> after <gallery> (bug 6164) [2,0,0,2,0]", "1auvsbr\n\n<ref>one</ref>\n\n<gallery>Image:Foobar.jpg</gallery>171rlvk\n\n<references/>");
add("selser", "<references> after <gallery> (bug 6164) [4,2,0,4,0]", "1eftrz2\n\nwaul9f\n\n<gallery>Image:Foobar.jpg</gallery>yuawyo<references/>");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [0,3,0]", "{{REVISIONID}}<ref>elite</ref>");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [1,2,0]", "{{REVISIONID}}<ref>elite</ref>\n\n2w1ylf\n");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [2,2,0]", "1sqvfrd\n\n{{REVISIONID}}<ref>elite</ref>\n\nmuq1xa\n");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [3,0,0]", "\n");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [2,0,0]", "1sc27yk\n\n{{REVISIONID}}<ref>elite</ref>");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [0,4,0]", "{{REVISIONID}}<ref>elite</ref>\n\n6820q5");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [4,3,0]", "o1rvrs");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [1,4,0]", "{{REVISIONID}}<ref>elite</ref>\n\n755jmj");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [4,0,0]", "12u7cbe\n");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [1,3,0]", "{{REVISIONID}}<ref>elite</ref>");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [3,3,0]", "");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [0,2,0]", "{{REVISIONID}}<ref>elite</ref>\n\n42lwa3\n");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [3,4,0]", "hc2c9y");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [2,4,0]", "4mfowb\n\n{{REVISIONID}}<ref>elite</ref>\n\nq8t2f8");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [4,4,0]", "ibohng\n\n166o2nr");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [1,0,0]", "{{REVISIONID}}<ref>elite</ref>\n");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [2,3,0]", "dwrha5\n\n{{REVISIONID}}<ref>elite</ref>");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [3,2,0]", "kl65oh\n");
add("selser", "{{REVISIONID}} on page with <ref> (bug 6299) [4,2,0]", "5uvqjo\n\n7gww77\n");
add("selser", "Ref with content followed by blank ref [1,3,0,0,0]", "<ref name=\"blank\">content</ref>\n\n<ref name=\"blank\"/>\n\n<references/>");
add("selser", "Ref with content followed by blank ref [3,0,0,3,0]", "\n<ref name=\"blank\"/><references/>");
add("selser", "Ref with content followed by blank ref [0,3,4,4,0]", "<ref name=\"blank\">content</ref>\n\nkq1u2m\n\n1vq0g7y<references/>");
add("selser", "Ref with content followed by blank ref [4,0,1,3,0]", "1i0rav0\n\n<ref name=\"blank\"/><references/>");
add("selser", "Ref with content followed by blank ref [0,4,0,3,0]", "<ref name=\"blank\">content</ref>\n\nshsg9u\n\n<ref name=\"blank\"/><references/>");
add("selser", "Ref with content followed by blank ref [0,3,1,0,0]", "<ref name=\"blank\">content</ref>\n\n<ref name=\"blank\"/>\n\n<references/>");
add("selser", "Ref with content followed by blank ref [4,0,3,0,0]", "177jxhv\n\n<references/>");
add("selser", "Ref with content followed by blank ref [0,0,0,4,0]", "<ref name=\"blank\">content</ref>\n\n<ref name=\"blank\"/>\n\nunii5u<references/>");
add("selser", "Ref with content followed by blank ref [3,0,0,4,0]", "\n<ref name=\"blank\"/>\n\n1kspqll<references/>");
add("selser", "Ref with content followed by blank ref [1,3,1,2,0]", "<ref name=\"blank\">content</ref>\n\n<ref name=\"blank\"/>\n\nwfab6u\n\n<references/>");
add("selser", "Ref with content followed by blank ref [3,0,2,4,0]", "\n140yw3d\n\n<ref name=\"blank\"/>\n\n19b1euz<references/>");
add("selser", "Ref with content followed by blank ref [0,0,2,0,0]", "<ref name=\"blank\">content</ref>\n\ncycfe2\n\n<ref name=\"blank\"/>\n\n<references/>");
add("selser", "Ref with content followed by blank ref [0,0,1,3,0]", "<ref name=\"blank\">content</ref>\n\n<ref name=\"blank\"/><references/>");
add("selser", "Ref with content followed by blank ref [4,4,0,2,0]", "1eou0ss\n\n1hrex9q\n\n<ref name=\"blank\"/>\n\n1gx9civ\n\n<references/>");
add("selser", "Ref with content followed by blank ref [4,0,0,0,0]", "102jqv0\n\n<ref name=\"blank\"/>\n\n<references/>");
add("selser", "Ref with content followed by blank ref [0,4,2,0,0]", "<ref name=\"blank\">content</ref>\n\ntiwdz5\n\n1ghy8ad\n\n<ref name=\"blank\"/>\n\n<references/>");
add("selser", "Ref with content followed by blank ref [0,0,3,0,0]", "<ref name=\"blank\">content</ref>\n\n<references/>");
add("selser", "Ref with content followed by blank ref [1,2,3,2,0]", "<ref name=\"blank\">content</ref>\n\nbovja2\n\n1l3kwy7\n\n<references/>");
add("selser", "Ref with content followed by blank ref [4,2,0,3,0]", "19i8cn8\n\n1i7mkad\n\n<ref name=\"blank\"/><references/>");
add("selser", "Ref with content followed by blank ref [4,0,0,4,0]", "1wgafau\n\n<ref name=\"blank\"/>\n\n1jfcrdq<references/>");
add("selser", "Blank ref followed by ref with content [0,2,0,0,0]", "<ref name=\"blank\"/>\n\nhegfnt\n\n<ref name=\"blank\">content</ref>\n\n<references/>");
add("selser", "Blank ref followed by ref with content [0,0,4,0,0]", "<ref name=\"blank\"/>\n\nr3u74s\n\n<references/>");
add("selser", "Blank ref followed by ref with content [1,0,0,0,0]", "<ref name=\"blank\"/>\n\n<ref name=\"blank\">content</ref>\n\n<references/>");
add("selser", "Blank ref followed by ref with content [2,0,0,0,0]", "1k4tg3v\n\n<ref name=\"blank\"/>\n\n<ref name=\"blank\">content</ref>\n\n<references/>");
add("selser", "Blank ref followed by ref with content [0,0,0,4,0]", "<ref name=\"blank\"/>\n\n<ref name=\"blank\">content</ref>\n\nvqa4r8<references/>");
add("selser", "Blank ref followed by ref with content [0,4,1,3,0]", "<ref name=\"blank\"/>\n\n2oyky3\n\n<ref name=\"blank\">content</ref>\n\n<references/>");
add("selser", "Blank ref followed by ref with content [3,2,4,3,0]", "1qkxkfu\n\n1f7e3wf<references/>");
add("selser", "Blank ref followed by ref with content [2,2,3,0,0]", "1vrai6u\n\n<ref name=\"blank\"/>\n\nl4hz2e\n\n<references/>");
add("selser", "Blank ref followed by ref with content [3,0,0,2,0]", "\n<ref name=\"blank\">content</ref>\n\n13vx502\n\n<references/>");
add("selser", "Blank ref followed by ref with content [0,4,0,3,0]", "<ref name=\"blank\"/>\n\n6o33ca\n\n<ref name=\"blank\">content</ref><references/>");
add("selser", "Blank ref followed by ref with content [3,2,1,3,0]", "1q469t2\n\n<ref name=\"blank\">content</ref><references/>");
add("selser", "Blank ref followed by ref with content [4,0,2,0,0]", "173370a\n\n1j87mwj\n\n<ref name=\"blank\">content</ref>\n\n<references/>");
add("selser", "Blank ref followed by ref with content [0,4,0,0,0]", "<ref name=\"blank\"/>\n\n1wqpem3\n\n<ref name=\"blank\">content</ref>\n\n<references/>");
add("selser", "Blank ref followed by ref with content [3,4,3,0,0]", "1512cr6\n\n<references/>");
add("selser", "Blank ref followed by ref with content [2,4,0,2,0]", "1smy595\n\n<ref name=\"blank\"/>\n\nw67z4d\n\n<ref name=\"blank\">content</ref>\n\nzsl98a\n\n<references/>");
add("selser", "Blank ref followed by ref with content [0,4,2,2,0]", "<ref name=\"blank\"/>\n\ny1m954\n\n103gv13\n\n<ref name=\"blank\">content</ref>\n\n1uslacl\n\n<references/>");
add("selser", "Blank ref followed by ref with content [0,0,4,4,0]", "<ref name=\"blank\"/>\n\nmb9mxt\n\nejkd51<references/>");
add("selser", "Blank ref followed by ref with content [1,0,4,4,0]", "<ref name=\"blank\"/>\n\n16wgg3z\n\nsz3xdu<references/>");
add("selser", "Blank ref followed by ref with content [2,3,0,0,0]", "dmkd7e\n\n<ref name=\"blank\"/>\n\n<ref name=\"blank\">content</ref>\n\n<references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [4,3,0,3,0]", "1i7daij\n\n<ref name=\"blank\">content</ref><references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [0,0,0,4,0]", "<ref name=\"blank\">0</ref>\n\n<ref name=\"blank\">content</ref>\n\nis44vx<references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [4,4,0,2,0]", "1is855h\n\n1q13jpf\n\n<ref name=\"blank\">content</ref>\n\n15f5ydm\n\n<references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [1,4,0,4,0]", "<ref name=\"blank\">0</ref>\n\n93cdjt\n\n<ref name=\"blank\">content</ref>\n\n1ngflci<references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [0,0,1,0,0]", "<ref name=\"blank\">0</ref>\n\n<ref name=\"blank\">content</ref>\n\n<references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [0,3,3,2,0]", "<ref name=\"blank\">0</ref>\n\nwmi5ym\n\n<references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [3,2,3,3,0]", "1nn3f3p\n\n<references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [3,2,0,3,0]", "1lbfpn8\n\n<ref name=\"blank\">content</ref><references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [3,2,0,0,0]", "1tit865\n\n<ref name=\"blank\">content</ref>\n\n<references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [2,4,4,0,0]", "17i4led\n\n<ref name=\"blank\">0</ref>\n\nv91sd2\n\n1opjqri\n\n<references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [4,2,0,0,0]", "1ahzk52\n\n1xjd0vp\n\n<ref name=\"blank\">content</ref>\n\n<references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [0,0,2,0,0]", "<ref name=\"blank\">0</ref>\n\npamfg2\n\n<ref name=\"blank\">content</ref>\n\n<references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [0,0,3,2,0]", "<ref name=\"blank\">0</ref>\n\nq39hs3\n\n<references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [4,2,0,4,0]", "1su8zsj\n\n1l2e2ni\n\n<ref name=\"blank\">content</ref>\n\n1n8dq9i<references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [0,2,1,0,0]", "<ref name=\"blank\">0</ref>\n\nhqrxsy\n\n<ref name=\"blank\">content</ref>\n\n<references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [0,3,0,3,0]", "<ref name=\"blank\">0</ref>\n\n<ref name=\"blank\">content</ref><references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [0,2,3,2,0]", "<ref name=\"blank\">0</ref>\n\n3qi0ie\n\n1f8ysu1\n\n<references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [2,2,2,2,0]", "1muuvq7\n\n<ref name=\"blank\">0</ref>\n\nxlzkt5\n\n1jx5sqb\n\n<ref name=\"blank\">content</ref>\n\n8holmt\n\n<references/>");
add("selser", "Regression: non-blank ref \"0\" followed by ref with content [2,0,1,0,0]", "1k13q9s\n\n<ref name=\"blank\">0</ref>\n\n<ref name=\"blank\">content</ref>\n\n<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [0,0,3,0,0]", "<ref name=\"blank\">1</ref>\n\n<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [1,0,4,2,0]", "<ref name=\"blank\">1</ref>\n\n5ar3d3\n\nl7vvs6\n\n<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [1,2,0,0,0]", "<ref name=\"blank\">1</ref>\n\n7ypg7n\n\n<ref name=\"blank\">content</ref>\n\n<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [0,0,0,4,0]", "<ref name=\"blank\">1</ref>\n\n<ref name=\"blank\">content</ref>\n\n6pvwho<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [3,4,3,0,0]", "1dtufe6\n\n<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [2,3,3,0,0]", "1xi5esd\n\n<ref name=\"blank\">1</ref>\n\n<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [2,0,3,0,0]", "1xglj0x\n\n<ref name=\"blank\">1</ref>\n\n<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [1,4,1,2,0]", "<ref name=\"blank\">1</ref>\n\n3sk0ge\n\n<ref name=\"blank\">content</ref>\n\n1s1e62u\n\n<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [4,0,0,4,0]", "17chaeh\n\n<ref name=\"blank\">content</ref>\n\n1hw7bsk<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [0,4,0,4,0]", "<ref name=\"blank\">1</ref>\n\nijssqv\n\n<ref name=\"blank\">content</ref>\n\n1gt2n9a<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [0,0,4,0,0]", "<ref name=\"blank\">1</ref>\n\n7u3nkm\n\n<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [4,0,3,2,0]", "1tpmtwv\n\n1oz5iy3\n\n<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [0,4,3,0,0]", "<ref name=\"blank\">1</ref>\n\n1s16l5\n\n<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [1,3,1,0,0]", "<ref name=\"blank\">1</ref>\n\n<ref name=\"blank\">content</ref>\n\n<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [2,3,3,2,0]", "zm04t0\n\n<ref name=\"blank\">1</ref>\n\nk5qbiv\n\n<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [1,2,4,0,0]", "<ref name=\"blank\">1</ref>\n\ncsktpa\n\nzux7se\n\n<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [3,0,3,4,0]", "\n11rqfk3<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [1,0,0,0,0]", "<ref name=\"blank\">1</ref>\n\n<ref name=\"blank\">content</ref>\n\n<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [0,4,4,2,0]", "<ref name=\"blank\">1</ref>\n\nj0jln\n\n1hjeriq\n\n1ghfa4n\n\n<references/>");
add("selser", "Regression sanity check: non-blank ref \"1\" followed by ref with content [0,0,0,2,0]", "<ref name=\"blank\">1</ref>\n\n<ref name=\"blank\">content</ref>\n\nowjukk\n\n<references/>");
add("selser", "Erroneous refs [0,0,4,2,4,0,0,3,0,0,0,0,0]", "<ref name=\"0\">Zero</ref>\n\n5fiuuy\n\n1r3vk7r\n\nye789s\n\n<ref name=\"foo\" name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" />\n\n<references />");
add("selser", "Erroneous refs [3,2,0,0,1,2,0,0,1,0,0,2,0]", "1phopva\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n<ref />\n\n167t8v8\n\n<ref name=\"foo\" name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" />e8juxg\n\n<references />");
add("selser", "Erroneous refs [0,3,0,0,0,2,0,0,1,0,0,3,0]", "<ref name=\"0\">Zero</ref>\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n<ref />\n\nvxfzfv\n\n<ref name=\"foo\" name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" /><references />");
add("selser", "Erroneous refs [2,0,4,3,4,4,0,0,0,3,0,0,0]", "1ehl52g\n\n<ref name=\"0\">Zero</ref>\n\npetz7r\n\nyvg893\n\n89bcw4\n\n<ref name=\"foo\" name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" /><references name=\"quasit\" />\n\n<references />");
add("selser", "Erroneous refs [0,0,0,2,0,0,4,2,0,0,0,0,0]", "<ref name=\"0\">Zero</ref>\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\nu7n0zu\n\n<ref />\n\n70aqbt\n\n9vwwfa\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" />\n\n<references />");
add("selser", "Erroneous refs [0,4,0,3,0,0,0,0,0,3,0,0,0]", "<ref name=\"0\">Zero</ref>\n\nec3dpf\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n<ref />\n\n<ref name=\"foo\" name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" /><references name=\"quasit\" />\n\n<references />");
add("selser", "Erroneous refs [3,0,0,3,4,0,4,3,2,4,0,0,0]", "\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n1ipulhc\n\n100gk67\n\ni2dlju\n\n<ref name=\"blankwithnoreference\" />\n\niqq6bi<references name=\"quasit\" />\n\n<references />");
add("selser", "Erroneous refs [3,0,0,0,0,4,0,0,3,0,0,2,0]", "\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n<ref />\n\n1y2hyjq\n\n<ref name=\"foo\" name=\"bar\" />\n\n<references name=\"quasit\" />1co7pmk\n\n<references />");
add("selser", "Erroneous refs [3,2,4,2,4,0,0,2,3,0,0,4,0]", "1nkyb74\n\n14bmiw4\n\n1qiocud\n\nh9kl7a\n\n<ref name=\"foo\" name=\"bar\" />\n\n1r6og91\n\n<references name=\"quasit\" />1jy8o0b<references />");
add("selser", "Erroneous refs [3,0,4,2,0,2,0,0,0,0,0,4,0]", "\n1c5u2u1\n\n11wpc6k\n\n<ref />\n\niseoxu\n\n<ref name=\"foo\" name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" />1komb4y<references />");
add("selser", "Erroneous refs [0,0,1,0,0,4,0,3,1,2,0,4,0]", "<ref name=\"0\">Zero</ref>\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n<ref />\n\nmwzizm\n\n<ref name=\"foo\" name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\n1dp2vom\n\n<references name=\"quasit\" />1g0m87q<references />");
add("selser", "Erroneous refs [1,0,0,3,1,3,1,0,2,0,0,4,0]", "<ref name=\"0\">Zero</ref>\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n<ref />\n\n<ref name=\"foo\" name=\"bar\" />\n\n16q7f29\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" />onqj6h<references />");
add("selser", "Erroneous refs [2,0,3,2,0,0,2,3,4,0,0,0,0]", "151n3wc\n\n<ref name=\"0\">Zero</ref>\n\nsyitr4\n\n<ref />\n\n3ge2b1\n\n<ref name=\"foo\" name=\"bar\" />\n\nocdgrg\n\n<references name=\"quasit\" />\n\n<references />");
add("selser", "Erroneous refs [2,0,2,2,0,4,2,0,0,3,0,3,0]", "1aa5hxv\n\n<ref name=\"0\">Zero</ref>\n\njuhnew\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\np140s5\n\n<ref />\n\nqfta45\n\n1v3f3j9\n\n<ref name=\"foo\" name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" /><references name=\"quasit\" /><references />");
add("selser", "Erroneous refs [4,4,4,0,0,0,0,3,1,2,0,0,0]", "1cfen4e\n\n1ncvdsc\n\n11w4mcc\n\n<ref />\n\n<ref name=\"foo\" name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\n1w92yl4\n\n<references name=\"quasit\" />\n\n<references />");
add("selser", "Erroneous refs [0,0,2,0,2,2,2,4,0,0,0,2,0]", "<ref name=\"0\">Zero</ref>\n\nwe26ed\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n1yu98fg\n\n<ref />\n\na84x3d\n\ns774dh\n\n<ref name=\"foo\" name=\"bar\" />\n\n1rpidtp\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" />raefy5\n\n<references />");
add("selser", "Erroneous refs [0,0,1,0,0,0,0,0,0,4,0,0,0]", "<ref name=\"0\">Zero</ref>\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n<ref />\n\n<ref name=\"foo\" name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\nam6bb8<references name=\"quasit\" />\n\n<references />");
add("selser", "Erroneous refs [3,0,0,2,0,3,3,0,2,4,0,0,0]", "\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n1iau755\n\n<ref />\n\n1awciva\n\n<ref name=\"blankwithnoreference\" />\n\noqdrva<references name=\"quasit\" />\n\n<references />");
add("selser", "Erroneous refs [1,3,0,0,4,4,1,2,0,0,0,0,0]", "<ref name=\"0\">Zero</ref>\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\ndorkkr\n\n1c5f38j\n\n<ref name=\"bar\" />\n\ngw78hp\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" />\n\n<references />");
add("selser", "Erroneous refs [0,0,0,3,0,2,2,3,1,0,0,2,0]", "<ref name=\"0\">Zero</ref>\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n<ref />\n\nj7066e\n\n1a4dt8o\n\n<ref name=\"foo\" name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" />10jb3z9\n\n<references />");
add("selser", "Simple <ref>, with <references/> in group [2,4,0,3,0]", "1lplvj4\n\nWikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\nWikipedia rocks!<ref group=note>Proceeds of Rockology, vol. XXI</ref>\n\njvb1n4<references/><references group=note/>");
add("selser", "Simple <ref>, with <references/> in group [1,3,0,0,0]", "Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\nWikipedia rocks!<ref group=note>Proceeds of Rockology, vol. XXI</ref><references/>\n<references group=note/>");
add("selser", "Simple <ref>, with <references/> in group [3,3,0,0,0]", "<references/>\n<references group=note/>");
add("selser", "Simple <ref>, with <references/> in group [[2,0,0,0],0,0,0,0]", "pmtlzsWikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\nWikipedia rocks!<ref group=note>Proceeds of Rockology, vol. XXI</ref>\n\n<references/>\n<references group=note/>");
add("selser", "Simple <ref>, with <references/> in group [4,0,0,0,0]", "17bbke1\n\n<references/>\n<references group=note/>");
add("selser", "Simple <ref>, with <references/> in group [[4,0,0,0],2,0,2,0]", "4x539<ref>Proceeds of Rockology, vol. XXI</ref>\nWikipedia rocks!<ref group=note>Proceeds of Rockology, vol. XXI</ref>\n\n1mkvpob\n\n<references/>1tsfwrx\n<references group=note/>");
add("selser", "Simple <ref>, with <references/> in group [2,0,0,3,0]", "12ldvh1\n\nWikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\nWikipedia rocks!<ref group=note>Proceeds of Rockology, vol. XXI</ref>\n\n<references/><references group=note/>");
add("selser", "Simple <ref>, with <references/> in group [[2,0,2,0],2,0,0,0]", "v7rezuWikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>aikd07\nWikipedia rocks!<ref group=note>Proceeds of Rockology, vol. XXI</ref>\n\n10cozbr\n\n<references/>\n<references group=note/>");
add("selser", "Simple <ref>, with <references/> in group [0,0,0,4,0]", "Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\nWikipedia rocks!<ref group=note>Proceeds of Rockology, vol. XXI</ref>\n\n<references/>uz68nm<references group=note/>");
add("selser", "Simple <ref>, with <references/> in group [4,3,0,2,0]", "19hh0pn<references/>unhqcb\n<references group=note/>");
add("selser", "Simple <ref>, with <references/> in group [4,0,0,2,0]", "1uce4y9\n\n<references/>1l0u4bh\n<references group=note/>");
add("selser", "Simple <ref>, with <references/> in group [[3,0,0,0],2,0,0,0]", "<ref>Proceeds of Rockology, vol. XXI</ref>\nWikipedia rocks!<ref group=note>Proceeds of Rockology, vol. XXI</ref>\n\npt5oay\n\n<references/>\n<references group=note/>");
add("selser", "Simple <ref>, with <references/> in group [4,0,0,3,0]", "1etled4\n\n<references/><references group=note/>");
add("selser", "Simple <ref>, with <references/> in group [[2,0,0,0],2,0,0,0]", "eb7u01Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\nWikipedia rocks!<ref group=note>Proceeds of Rockology, vol. XXI</ref>\n\nslvigf\n\n<references/>\n<references group=note/>");
add("selser", "Simple <ref>, with <references/> in group [[4,0,0,0],4,0,0,0]", "rkabia<ref>Proceeds of Rockology, vol. XXI</ref>\nWikipedia rocks!<ref group=note>Proceeds of Rockology, vol. XXI</ref>\n\nmrdr3e<references/>\n<references group=note/>");
add("selser", "Simple <ref>, with <references/> in group [0,0,0,2,0]", "Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\nWikipedia rocks!<ref group=note>Proceeds of Rockology, vol. XXI</ref>\n\n<references/>v9q3he\n<references group=note/>");
add("selser", "Simple <ref>, with <references/> in group [[0,0,4,0],0,0,3,0]", "Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>95iiri<ref group=note>Proceeds of Rockology, vol. XXI</ref>\n\n<references/><references group=note/>");
add("selser", "Simple <ref>, with <references/> in group [[2,0,3,0],0,0,0,0]", "24b7ioWikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref><ref group=note>Proceeds of Rockology, vol. XXI</ref>\n\n<references/>\n<references group=note/>");
add("selser", "Simple <ref>, with <references/> in group [2,0,0,0,0]", "1oz1aeu\n\nWikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>\nWikipedia rocks!<ref group=note>Proceeds of Rockology, vol. XXI</ref>\n\n<references/>\n<references group=note/>");
add("selser", "<ref> defined in <references> [0,2,0]", "<ref name=\"foo\"/>\n\nhxy5y3\n\n<references>\n<ref name=\"foo\">BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> [0,3,0]", "<ref name=\"foo\"/><references>\n<ref name=\"foo\">BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> [2,4,0]", "1pixeop\n\n<ref name=\"foo\"/>\n\n1m7odyr<references>\n<ref name=\"foo\">BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> [0,4,0]", "<ref name=\"foo\"/>\n\n8blj32<references>\n<ref name=\"foo\">BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> [1,0,0]", "<ref name=\"foo\"/>\n\n<references>\n<ref name=\"foo\">BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> [1,3,0]", "<ref name=\"foo\"/><references>\n<ref name=\"foo\">BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> [2,2,0]", "16h3504\n\n<ref name=\"foo\"/>\n\npnv0m8\n\n<references>\n<ref name=\"foo\">BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> [2,0,0]", "14x1duy\n\n<ref name=\"foo\"/>\n\n<references>\n<ref name=\"foo\">BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> [1,2,0]", "<ref name=\"foo\"/>\n\nklrjmz\n\n<references>\n<ref name=\"foo\">BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> [1,4,0]", "<ref name=\"foo\"/>\n\n15v6d7g<references>\n<ref name=\"foo\">BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> [2,3,0]", "1yh61uq\n\n<ref name=\"foo\"/><references>\n<ref name=\"foo\">BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> called with #tag [0,0,0,4,0]", "<ref name=\"foo\"/>\n\n{{#tag:references|\n<ref name=\"foo\">BAR</ref>\n}}\n\nbrccs7");
add("selser", "<ref> defined in <references> called with #tag [1,3,0,3,0]", "<ref name=\"foo\"/>\n\n{{#tag:references|\n<ref name=\"foo\">BAR</ref>\n}}");
add("selser", "<ref> defined in <references> called with #tag [0,4,3,0,0]", "<ref name=\"foo\"/>\n\namo6ws\n");
add("selser", "<ref> defined in <references> called with #tag [0,3,4,0,0]", "<ref name=\"foo\"/>\n\ny49ita\n");
add("selser", "<ref> defined in <references> called with #tag [3,4,0,0,0]", "1m7d9re\n\n{{#tag:references|\n<ref name=\"foo\">BAR</ref>\n}}");
add("selser", "<ref> defined in <references> called with #tag [1,0,4,0,0]", "<ref name=\"foo\"/>\n\n7tn39e\n");
add("selser", "<ref> defined in <references> called with #tag [2,0,1,4,0]", "13owd1e\n\n<ref name=\"foo\"/>\n\n{{#tag:references|\n<ref name=\"foo\">BAR</ref>\n}}\n\nnrnshy");
add("selser", "<ref> defined in <references> called with #tag [0,4,0,0,0]", "<ref name=\"foo\"/>\n\nrdn99l\n\n{{#tag:references|\n<ref name=\"foo\">BAR</ref>\n}}");
add("selser", "<ref> defined in <references> called with #tag [4,2,0,0,0]", "1clskzx\n\n1y73y10\n\n{{#tag:references|\n<ref name=\"foo\">BAR</ref>\n}}");
add("selser", "<ref> defined in <references> called with #tag [4,0,3,3,0]", "g1897y\n\n");
add("selser", "<ref> defined in <references> called with #tag [4,2,3,4,0]", "12y1e85\n\n1kob1jt\n\n1thxs26");
add("selser", "<ref> defined in <references> called with #tag [0,3,3,3,0]", "<ref name=\"foo\"/>");
add("selser", "<ref> defined in <references> called with #tag [3,2,0,0,0]", "1rkze1y\n\n{{#tag:references|\n<ref name=\"foo\">BAR</ref>\n}}");
add("selser", "<ref> defined in <references> called with #tag [0,3,0,3,0]", "<ref name=\"foo\"/>\n\n{{#tag:references|\n<ref name=\"foo\">BAR</ref>\n}}");
add("selser", "<ref> defined in <references> called with #tag [4,0,1,4,0]", "1g2r0d1\n\n{{#tag:references|\n<ref name=\"foo\">BAR</ref>\n}}\n\nrdx18w");
add("selser", "<ref> defined in <references> called with #tag [0,0,0,3,0]", "<ref name=\"foo\"/>\n\n{{#tag:references|\n<ref name=\"foo\">BAR</ref>\n}}");
add("selser", "<ref> defined in <references> called with #tag [0,0,0,2,0]", "<ref name=\"foo\"/>\n\n{{#tag:references|\n<ref name=\"foo\">BAR</ref>\n}}\n\nfj0gen\n");
add("selser", "<ref> defined in <references> called with #tag [2,0,1,0,0]", "1d7653n\n\n<ref name=\"foo\"/>\n\n{{#tag:references|\n<ref name=\"foo\">BAR</ref>\n}}\n");
add("selser", "<ref> defined in <references> called with #tag [2,3,3,0,0]", "14bboaw\n\n<ref name=\"foo\"/>\n");
add("selser", "<ref> defined in <references> error conditions [0,0,0,4,0]", "<ref name=\"foo\" group=\"2\"/>\n\n<references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>dxumdc");
add("selser", "<ref> defined in <references> error conditions [2,4,0,2,0]", "1pumkgv\n\n<ref name=\"foo\" group=\"2\"/>\n\njvx805<references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>11l4u9n\n");
add("selser", "<ref> defined in <references> error conditions [1,0,0,3,0]", "<ref name=\"foo\" group=\"2\"/>\n\n<references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> error conditions [2,3,0,3,0]", "1n05ikg\n\n<ref name=\"foo\" group=\"2\"/><references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> error conditions [0,0,0,2,0]", "<ref name=\"foo\" group=\"2\"/>\n\n<references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>lmy9sp\n");
add("selser", "<ref> defined in <references> error conditions [1,4,0,2,0]", "<ref name=\"foo\" group=\"2\"/>\n\n51uldm<references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>1ax3od5\n");
add("selser", "<ref> defined in <references> error conditions [2,0,0,2,0]", "16xtqf7\n\n<ref name=\"foo\" group=\"2\"/>\n\n<references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>l8coyc\n");
add("selser", "<ref> defined in <references> error conditions [0,3,0,3,0]", "<ref name=\"foo\" group=\"2\"/><references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> error conditions [3,2,0,0,0]", "13kk1ep\n\n<references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> error conditions [2,3,0,0,0]", "s21hov\n\n<ref name=\"foo\" group=\"2\"/><references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> error conditions [0,0,0,3,0]", "<ref name=\"foo\" group=\"2\"/>\n\n<references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> error conditions [4,4,0,0,0]", "1pq6xj8\n\n1s9st80<references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> error conditions [4,0,0,0,0]", "1z01g6o\n\n<references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> error conditions [0,4,0,3,0]", "<ref name=\"foo\" group=\"2\"/>\n\ne6zpzy<references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> error conditions [0,3,0,0,0]", "<ref name=\"foo\" group=\"2\"/><references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> error conditions [1,3,0,3,0]", "<ref name=\"foo\" group=\"2\"/><references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> error conditions [0,2,0,0,0]", "<ref name=\"foo\" group=\"2\"/>\n\nxnimd\n\n<references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>");
add("selser", "<ref> defined in <references> error conditions [3,2,0,2,0]", "15osac8\n\n<references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>17d9429\n");
add("selser", "<ref> defined in <references> error conditions [0,4,0,4,0]", "<ref name=\"foo\" group=\"2\"/>\n\nyooxfw<references group=\"2\">\n<ref name=\"foo\"/>\n<ref name=\"unused\">BAR</ref>\n<ref name=\"foo\" group=\"1\">bad group</ref>\n<ref>BAR BAR</ref>\n</references>cfercb");
add("selser", "<ref> with custom group link with number names in Klingon [4,2,0]", "1dw6psd\n\n1rj3pfy\n\n<references group=\"klingon\"/>");
add("selser", "<ref> with custom group link with number names in Klingon [0,2,0]", "Wikipedia rocks!<ref group=\"klingon\">Proceeds of Rockology, vol. XXI</ref>\n\nda0qzb\n\n<references group=\"klingon\"/>");
add("selser", "<ref> with custom group link with number names in Klingon [1,0,0]", "Wikipedia rocks!<ref group=\"klingon\">Proceeds of Rockology, vol. XXI</ref>\n\n<references group=\"klingon\"/>");
add("selser", "<ref> with custom group link with number names in Klingon [0,4,0]", "Wikipedia rocks!<ref group=\"klingon\">Proceeds of Rockology, vol. XXI</ref>\n\nbbq4ik<references group=\"klingon\"/>");
add("selser", "<ref> with custom group link with number names in Klingon [2,0,0]", "1bajwfe\n\nWikipedia rocks!<ref group=\"klingon\">Proceeds of Rockology, vol. XXI</ref>\n\n<references group=\"klingon\"/>");
add("selser", "<ref> with custom group link with number names in Klingon [1,2,0]", "Wikipedia rocks!<ref group=\"klingon\">Proceeds of Rockology, vol. XXI</ref>\n\nha565t\n\n<references group=\"klingon\"/>");
add("selser", "<ref> with custom group link with number names in Klingon [[2,0],4,0]", "u6bhegWikipedia rocks!<ref group=\"klingon\">Proceeds of Rockology, vol. XXI</ref>\n\n1ww2iyh<references group=\"klingon\"/>");
add("selser", "<ref> with custom group link with number names in Klingon [[4,0],0,0]", "ke30tl<ref group=\"klingon\">Proceeds of Rockology, vol. XXI</ref>\n\n<references group=\"klingon\"/>");
add("selser", "<ref> with custom group link with number names in Klingon [3,2,0]", "1hl07p8\n\n<references group=\"klingon\"/>");
add("selser", "<ref> with custom group link with number names in Klingon [[3,0],0,0]", "<ref group=\"klingon\">Proceeds of Rockology, vol. XXI</ref>\n\n<references group=\"klingon\"/>");
add("selser", "<ref> with custom group link with number names in Klingon [3,0,0]", "\n<references group=\"klingon\"/>");
add("selser", "<ref> with custom group link with number names in Klingon [3,4,0]", "12itx1o<references group=\"klingon\"/>");
add("selser", "<ref> with custom group link with number names in Klingon [[4,0],3,0]", "rzesd6<ref group=\"klingon\">Proceeds of Rockology, vol. XXI</ref><references group=\"klingon\"/>");
add("selser", "<ref> with custom group link with number names in Klingon [4,0,0]", "2ysb9o\n\n<references group=\"klingon\"/>");
add("selser", "<ref> with custom group link with number names in Klingon [4,3,0]", "1hktzyz<references group=\"klingon\"/>");
add("selser", "<ref> with custom group link with number names in Klingon [[2,0],0,0]", "r0sr2bWikipedia rocks!<ref group=\"klingon\">Proceeds of Rockology, vol. XXI</ref>\n\n<references group=\"klingon\"/>");
add("selser", "<ref> with custom group link with number names in Klingon [1,4,0]", "Wikipedia rocks!<ref group=\"klingon\">Proceeds of Rockology, vol. XXI</ref>\n\n1yfv8ni<references group=\"klingon\"/>");
add("selser", "<ref> with custom group link with number names in Klingon [0,3,0]", "Wikipedia rocks!<ref group=\"klingon\">Proceeds of Rockology, vol. XXI</ref><references group=\"klingon\"/>");
add("selser", "<ref> with custom group link with number names in Klingon [1,3,0]", "Wikipedia rocks!<ref group=\"klingon\">Proceeds of Rockology, vol. XXI</ref><references group=\"klingon\"/>");
add("selser", "Bug 31374 regression check: nested strip items [4,0,0,0,0]", "1o4bkp1\n<references group=Note />\n<references />");
add("selser", "Bug 31374 regression check: nested strip items [2,4,0,0,0]", "1446r5o\n\n{{#tag:ref|note<ref>reference</ref>|group=Note}}\n\nvqvr5f<references group=Note />\n<references />");
add("selser", "Bug 31374 regression check: nested strip items [2,2,0,3,0]", "13xsxuv\n\n{{#tag:ref|note<ref>reference</ref>|group=Note}}\n\njqs94r\n<references group=Note /><references />");
add("selser", "Bug 31374 regression check: nested strip items [4,0,0,4,0]", "17opofg\n<references group=Note />1xq549u<references />");
add("selser", "Bug 31374 regression check: nested strip items [0,2,0,0,0]", "{{#tag:ref|note<ref>reference</ref>|group=Note}}\n\n616naz\n<references group=Note />\n<references />");
add("selser", "Bug 31374 regression check: nested strip items [1,2,0,0,0]", "{{#tag:ref|note<ref>reference</ref>|group=Note}}\n\nni4m5\n<references group=Note />\n<references />");
add("selser", "Bug 31374 regression check: nested strip items [2,0,0,0,0]", "1or99k3\n\n{{#tag:ref|note<ref>reference</ref>|group=Note}}\n<references group=Note />\n<references />");
add("selser", "Bug 31374 regression check: nested strip items [0,4,0,4,0]", "{{#tag:ref|note<ref>reference</ref>|group=Note}}\n\n1wykqkv<references group=Note />1q046uc<references />");
add("selser", "Bug 31374 regression check: nested strip items [2,2,0,0,0]", "1yn2ujl\n\n{{#tag:ref|note<ref>reference</ref>|group=Note}}\n\nzhya21\n<references group=Note />\n<references />");
add("selser", "Bug 31374 regression check: nested strip items [3,4,0,3,0]", "13gz2oh<references group=Note /><references />");
add("selser", "Bug 31374 regression check: nested strip items [1,3,0,0,0]", "{{#tag:ref|note<ref>reference</ref>|group=Note}}<references group=Note />\n<references />");
add("selser", "Bug 31374 regression check: nested strip items [2,3,0,2,0]", "1d5hveq\n\n{{#tag:ref|note<ref>reference</ref>|group=Note}}<references group=Note />qqc5vy\n<references />");
add("selser", "Bug 31374 regression check: nested strip items [1,0,0,0,0]", "{{#tag:ref|note<ref>reference</ref>|group=Note}}\n<references group=Note />\n<references />");
add("selser", "Bug 31374 regression check: nested strip items [0,4,0,0,0]", "{{#tag:ref|note<ref>reference</ref>|group=Note}}\n\n1t95tk<references group=Note />\n<references />");
add("selser", "Bug 31374 regression check: nested strip items [0,3,0,0,0]", "{{#tag:ref|note<ref>reference</ref>|group=Note}}<references group=Note />\n<references />");
add("selser", "Bug 31374 regression check: nested strip items [0,0,0,4,0]", "{{#tag:ref|note<ref>reference</ref>|group=Note}}\n<references group=Note />sh9tjf<references />");
add("selser", "Bug 31374 regression check: nested strip items [3,0,0,0,0]", "\n<references group=Note />\n<references />");
add("selser", "Bug 31374 regression check: nested strip items [0,0,0,2,0]", "{{#tag:ref|note<ref>reference</ref>|group=Note}}\n<references group=Note />1l28h2z\n<references />");
add("selser", "Bug 31374 regression check: nested strip items [1,4,0,0,0]", "{{#tag:ref|note<ref>reference</ref>|group=Note}}\n\n5see0h<references group=Note />\n<references />");
add("selser", "Bug 13073 regression check: wrapped <references> [0,3,3]", "<ref>\nfoo\n</ref>");
add("selser", "Bug 13073 regression check: wrapped <references> [1,0,3]", "<ref>\nfoo\n</ref>\n");
add("selser", "Bug 13073 regression check: wrapped <references> [2,0,3]", "1eulfp2\n\n<ref>\nfoo\n</ref>\n");
add("selser", "Bug 13073 regression check: wrapped <references> [0,4,1]", "<ref>\nfoo\n</ref>\n\n1uo6dw<div data-foobar=\"nadb4v\"><references /></div>");
add("selser", "Bug 13073 regression check: wrapped <references> [0,0,1]", "<ref>\nfoo\n</ref>\n<div data-foobar=\"1xpxwf9\"><references /></div>");
add("selser", "Bug 13073 regression check: wrapped <references> [0,3,1]", "<ref>\nfoo\n</ref><div data-foobar=\"1vxoixa\"><references /></div>");
add("selser", "Bug 13073 regression check: wrapped <references> [0,4,0]", "<ref>\nfoo\n</ref>\n\nqffagq<div><references /></div>");
add("selser", "Bug 13073 regression check: wrapped <references> [1,2,0]", "<ref>\nfoo\n</ref>\n\na07t9n\n<div><references /></div>");
add("selser", "Bug 13073 regression check: wrapped <references> [0,0,4]", "<ref>\nfoo\n</ref>\n\n13gonk");
add("selser", "<ref> with no name and no content. [[3,0],4,0]", "<ref></ref>\n\nohfvpx");
add("selser", "<ref> with no name and no content. [0,2,0]", "Bla.<ref></ref>\n\npn6x71\n");
add("selser", "<ref> with no name and no content. [2,0,0]", "1otmssn\n\nBla.<ref></ref>");
add("selser", "<ref> with no name and no content. [1,3,0]", "Bla.<ref></ref>");
add("selser", "<ref> with no name and no content. [4,0,0]", "1wg5cj4\n");
add("selser", "<ref> with no name and no content. [2,3,0]", "13m8hdy\n\nBla.<ref></ref>");
add("selser", "<ref> with no name and no content. [3,2,0]", "1ety4vs\n");
add("selser", "<ref> with no name and no content. [1,4,0]", "Bla.<ref></ref>\n\n6v7sxu");
add("selser", "<ref> with no name and no content. [2,2,0]", "1tdm9xw\n\nBla.<ref></ref>\n\nxbklbx\n");
add("selser", "<ref> with no name and no content. [1,0,0]", "Bla.<ref></ref>\n");
add("selser", "<ref> with no name and no content. [[3,0],0,0]", "<ref></ref>\n");
add("selser", "<ref> with no name and no content. [0,3,0]", "Bla.<ref></ref>");
add("selser", "<ref> with no name and no content. [1,2,0]", "Bla.<ref></ref>\n\nazodfi\n");
add("selser", "<ref> with no name and no content. [[3,0],3,0]", "<ref></ref>");
add("selser", "<ref> with no name and no content. [[2,0],3,0]", "slk5uoBla.<ref></ref>");
add("selser", "<ref> with no name and no content. [0,4,0]", "Bla.<ref></ref>\n\nbnx45z");
add("selser", "<ref> with no name and no content. [3,0,0]", "\n");
add("selser", "<ref> with no name and no content. [2,4,0]", "1dg2w9n\n\nBla.<ref></ref>\n\np5ul07");
add("selser", "<ref> with no name and no content. [[4,0],0,0]", "imr7ut<ref></ref>\n");
add("selser", "<ref> with an empty-string name parameter and no content. [0,4,0]", "Bla.<ref name=\"\"></ref>\n\ncyppav");
add("selser", "<ref> with an empty-string name parameter and no content. [2,3,0]", "1wlyw6b\n\nBla.<ref name=\"\"></ref>");
add("selser", "<ref> with an empty-string name parameter and no content. [[3,0],3,0]", "<ref name=\"\"></ref>");
add("selser", "<ref> with an empty-string name parameter and no content. [[4,0],2,0]", "ke1ftq<ref name=\"\"></ref>\n\n1tohng1\n");
add("selser", "<ref> with an empty-string name parameter and no content. [4,0,0]", "1bv4hgd\n");
add("selser", "<ref> with an empty-string name parameter and no content. [3,0,0]", "\n");
add("selser", "<ref> with an empty-string name parameter and no content. [0,3,0]", "Bla.<ref name=\"\"></ref>");
add("selser", "<ref> with an empty-string name parameter and no content. [1,0,0]", "Bla.<ref name=\"\"></ref>\n");
add("selser", "<ref> with an empty-string name parameter and no content. [[4,0],4,0]", "1j8fnx<ref name=\"\"></ref>\n\ntivd28");
add("selser", "<ref> with an empty-string name parameter and no content. [2,0,0]", "1pjxq6c\n\nBla.<ref name=\"\"></ref>");
add("selser", "<ref> with an empty-string name parameter and no content. [[2,0],0,0]", "6bqi1jBla.<ref name=\"\"></ref>\n");
add("selser", "<ref> with an empty-string name parameter and no content. [3,2,0]", "1odk7yh\n");
add("selser", "<ref> with an empty-string name parameter and no content. [3,4,0]", "1vax2x1");
add("selser", "<ref> with an empty-string name parameter and no content. [[3,0],4,0]", "<ref name=\"\"></ref>\n\n1puamwb");
add("selser", "<ref> with an empty-string name parameter and no content. [3,3,0]", "");
add("selser", "<ref> with an empty-string name parameter and no content. [0,2,0]", "Bla.<ref name=\"\"></ref>\n\nir8lis\n");
add("selser", "<ref> with an empty-string name parameter and no content. [2,4,0]", "174k5cy\n\nBla.<ref name=\"\"></ref>\n\ny1bnct");
add("selser", "<ref> with an empty-string name parameter and no content. [4,3,0]", "1jij3pf");
add("selser", "<ref> with an empty-string name parameter and no content. [1,4,0]", "Bla.<ref name=\"\"></ref>\n\niknz8z");
add("selser", "<ref> with a non-empty name parameter and no content. [4,0,0]", "11rs4la\n");
add("selser", "<ref> with a non-empty name parameter and no content. [3,2,0]", "1uh0cto\n");
add("selser", "<ref> with a non-empty name parameter and no content. [[2,0],2,0]", "gav99uBla.<ref name=\"void\"></ref>\n\nr5vlst\n");
add("selser", "<ref> with a non-empty name parameter and no content. [0,4,0]", "Bla.<ref name=\"void\"></ref>\n\nr7lbys");
add("selser", "<ref> with a non-empty name parameter and no content. [[4,0],3,0]", "1l6z8wu<ref name=\"void\"></ref>");
add("selser", "<ref> with a non-empty name parameter and no content. [1,3,0]", "Bla.<ref name=\"void\"></ref>");
add("selser", "<ref> with a non-empty name parameter and no content. [2,3,0]", "110ffhv\n\nBla.<ref name=\"void\"></ref>");
add("selser", "<ref> with a non-empty name parameter and no content. [2,0,0]", "1qhovxt\n\nBla.<ref name=\"void\"></ref>");
add("selser", "<ref> with a non-empty name parameter and no content. [0,2,0]", "Bla.<ref name=\"void\"></ref>\n\neyqmdo\n");
add("selser", "<ref> with a non-empty name parameter and no content. [3,0,0]", "\n");
add("selser", "<ref> with a non-empty name parameter and no content. [1,4,0]", "Bla.<ref name=\"void\"></ref>\n\n3jybx1");
add("selser", "<ref> with a non-empty name parameter and no content. [[3,0],2,0]", "<ref name=\"void\"></ref>\n\nnj05ni\n");
add("selser", "<ref> with a non-empty name parameter and no content. [0,3,0]", "Bla.<ref name=\"void\"></ref>");
add("selser", "<ref> with a non-empty name parameter and no content. [2,4,0]", "8tf7uu\n\nBla.<ref name=\"void\"></ref>\n\n7sv7bv");
add("selser", "<ref> with a non-empty name parameter and no content. [[2,0],4,0]", "1aulowoBla.<ref name=\"void\"></ref>\n\n11th9k6");
add("selser", "<ref> with a non-empty name parameter and no content. [4,3,0]", "1ml1bcw");
add("selser", "<ref> with a non-empty name parameter and no content. [3,4,0]", "11q5mfj");
add("selser", "<ref> with a non-empty name parameter and no content. [[2,0],3,0]", "1fli58lBla.<ref name=\"void\"></ref>");
add("selser", "<ref> with a non-empty name parameter and no content. [[2,0],0,0]", "v0qv1iBla.<ref name=\"void\"></ref>\n");
add("selser", "<ref>s with the follow parameter [[3,0],0,0,4,3,0,0]", "<ref name=\"beginning\">First page footnote text.</ref>\n\nPage two.<ref follow=\"beginning\">Second page footnote text.</ref>\n\nxqyalt\n<references />");
-add("selser", "<ref>s with the follow parameter [0,4,4,2,0,0,0]", "Page one.<ref name=\"beginning\">First page footnote text.</ref>\n\n29j6zc\n\n1x9odrq\n\nv7xh68\n\n== References ==\n<references />");
-add("selser", "<ref>s with the follow parameter [2,2,4,2,0,0,0]", "1dnzkqa\n\nPage one.<ref name=\"beginning\">First page footnote text.</ref>\n\nuon3pk\n\n1dbvwk9\n\n21rzyo\n\n== References ==\n<references />");
add("selser", "<ref>s with the follow parameter [1,3,0,0,4,3,0]", "Page one.<ref name=\"beginning\">First page footnote text.</ref>\n\nPage two.<ref follow=\"beginning\">Second page footnote text.</ref>\n\nhqrwbi<references />");
-add("selser", "<ref>s with the follow parameter [[3,0],0,0,2,[2],0,0]", "<ref name=\"beginning\">First page footnote text.</ref>\n\nPage two.<ref follow=\"beginning\">Second page footnote text.</ref>\n\nwfd1vh\n\n==new02fReferences==\n<references />");
-add("selser", "<ref>s with the follow parameter [4,0,3,2,2,2,0]", "1sz2kwi\n\n1u5by29\n\nchwdfu\n\n== References ==\nhr0bxe\n<references />");
-add("selser", "<ref>s with the follow parameter [3,2,4,4,2,0,0]", "1fr2f18\n\n1dsi9l4\n\n1tfqpin\n\njnye6h\n\n== References ==\n<references />");
+add("selser", "<ref>s with the follow parameter [[3,0],0,0,2,[2],0,0]", "<ref name=\"beginning\">First page footnote text.</ref>\n\nPage two.<ref follow=\"beginning\">Second page footnote text.</ref>\n\nwfd1vh\n\n==new02f References ==\n<references />");
add("selser", "<ref>s with the follow parameter [0,0,1,3,0,0,0]", "Page one.<ref name=\"beginning\">First page footnote text.</ref>\n\nPage two.<ref follow=\"beginning\">Second page footnote text.</ref>\n== References ==\n<references />");
-add("selser", "<ref>s with the follow parameter [[4,0],3,3,3,0,0,0]", "dd3s01<ref name=\"beginning\">First page footnote text.</ref>\n== References ==\n<references />");
-add("selser", "<ref>s with the follow parameter [0,4,0,4,[2],3,0]", "Page one.<ref name=\"beginning\">First page footnote text.</ref>\n\ndht9ly\n\nPage two.<ref follow=\"beginning\">Second page footnote text.</ref>\n\n1ijup9y\n\n==zd10unReferences==\n<references />");
+add("selser", "<ref>s with the follow parameter [0,4,0,4,[2],3,0]", "Page one.<ref name=\"beginning\">First page footnote text.</ref>\n\ndht9ly\n\nPage two.<ref follow=\"beginning\">Second page footnote text.</ref>\n\n1ijup9y\n\n==zd10un References ==\n<references />");
add("selser", "<ref>s with the follow parameter [3,0,2,0,[3],2,0]", "\n1bjaryq\n\nPage two.<ref follow=\"beginning\">Second page footnote text.</ref>\n\n==<nowiki/>==\n13mp93f\n<references />");
add("selser", "<ref>s with the follow parameter [0,4,[3,0],3,0,0,0]", "Page one.<ref name=\"beginning\">First page footnote text.</ref>\n\nb1xm6f\n\n<ref>Second page footnote text.</ref>\n\n== References ==\n<references />");
add("selser", "<ref>s with the follow parameter [4,4,0,3,[3],0,0]", "1e4je6d\n\n1ngk4kr\n\nPage two.<ref follow=\"beginning\">Second page footnote text.</ref>\n==<nowiki/>==\n<references />");
add("selser", "<ref>s with the follow parameter [2,3,0,0,2,0,0]", "1w76sli\n\nPage one.<ref name=\"beginning\">First page footnote text.</ref>\n\nPage two.<ref follow=\"beginning\">Second page footnote text.</ref>\n\nlzh28u\n\n== References ==\n<references />");
add("selser", "<ref>s with the follow parameter [0,0,0,4,3,0,0]", "Page one.<ref name=\"beginning\">First page footnote text.</ref>\n\nPage two.<ref follow=\"beginning\">Second page footnote text.</ref>\n\nnc6mwu\n<references />");
-add("selser", "<ref>s with the follow parameter [1,0,1,0,1,0,0]", "Page one.<ref name=\"beginning\">First page footnote text.</ref>\n\nPage two.<ref follow=\"beginning\">Second page footnote text.</ref>\n\n==References==\n<references />");
+add("selser", "<ref>s with the follow parameter [1,0,1,0,1,0,0]", "Page one.<ref name=\"beginning\">First page footnote text.</ref>\n\nPage two.<ref follow=\"beginning\">Second page footnote text.</ref>\n\n== References ==\n<references />");
add("selser", "<ref>s with the follow parameter [3,4,[4,0],0,[4],0,0]", "1pnw6s5\n\n18wphoo<ref follow=\"beginning\">Second page footnote text.</ref>\n\n==1egt7au==\n<references />");
add("selser", "<ref> with both name and follow parameters - invalid [[2,0],2,0]", "7g93afPage one.<ref name=\"the-name\" follow=\"the-name\">This ref is invalid.</ref>\n\nv9fx2h\n<references />");
add("selser", "<ref> with both name and follow parameters - invalid [[4,0],3,0]", "jf0w9c<ref name=\"the-name\" follow=\"the-name\">This ref is invalid.</ref><references />");
add("selser", "<ref> with both name and follow parameters - invalid [1,0,0]", "Page one.<ref name=\"the-name\" follow=\"the-name\">This ref is invalid.</ref>\n<references />");
add("selser", "<ref> with both name and follow parameters - invalid [[3,0],3,0]", "<ref name=\"the-name\" follow=\"the-name\">This ref is invalid.</ref><references />");
add("selser", "<ref> with both name and follow parameters - invalid [1,2,0]", "Page one.<ref name=\"the-name\" follow=\"the-name\">This ref is invalid.</ref>\n\n9uvtao\n<references />");
add("selser", "<ref> with both name and follow parameters - invalid [1,4,0]", "Page one.<ref name=\"the-name\" follow=\"the-name\">This ref is invalid.</ref>\n\n65h93m<references />");
add("selser", "<ref> with both name and follow parameters - invalid [2,4,0]", "1l0nj20\n\nPage one.<ref name=\"the-name\" follow=\"the-name\">This ref is invalid.</ref>\n\n1lv442m<references />");
add("selser", "<ref> with both name and follow parameters - invalid [0,4,0]", "Page one.<ref name=\"the-name\" follow=\"the-name\">This ref is invalid.</ref>\n\nqyc0hb<references />");
add("selser", "<ref> with both name and follow parameters - invalid [[4,0],0,0]", "wm8by6<ref name=\"the-name\" follow=\"the-name\">This ref is invalid.</ref>\n<references />");
add("selser", "<ref> with both name and follow parameters - invalid [[3,0],0,0]", "<ref name=\"the-name\" follow=\"the-name\">This ref is invalid.</ref>\n<references />");
add("selser", "<ref> with both name and follow parameters - invalid [2,0,0]", "13m01ms\n\nPage one.<ref name=\"the-name\" follow=\"the-name\">This ref is invalid.</ref>\n<references />");
add("selser", "<ref> with both name and follow parameters - invalid [[2,0],4,0]", "2c055zPage one.<ref name=\"the-name\" follow=\"the-name\">This ref is invalid.</ref>\n\ni4rk82<references />");
add("selser", "<ref> with both name and follow parameters - invalid [[2,0],0,0]", "1saazdPage one.<ref name=\"the-name\" follow=\"the-name\">This ref is invalid.</ref>\n<references />");
add("selser", "<ref> with both name and follow parameters - invalid [[2,0],3,0]", "acc3sgPage one.<ref name=\"the-name\" follow=\"the-name\">This ref is invalid.</ref><references />");
add("selser", "Multiple definition (outside <references/>) [[0,4,0],4,0]", "<ref name=a>abc</ref>1lmk3w<ref name=a>def</ref>\n\n1eye0ty<references />");
add("selser", "Multiple definition (outside <references/>) [2,0,0]", "1c7qb6n\n\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n<references />");
add("selser", "Multiple definition (outside <references/>) [[0,2,0],0,0]", "<ref name=a>abc</ref>c8fyp1\n<ref name=a>def</ref>\n<references />");
add("selser", "Multiple definition (outside <references/>) [1,3,0]", "<ref name=a>abc</ref>\n<ref name=a>def</ref><references />");
add("selser", "Multiple definition (outside <references/>) [[0,3,0],4,0]", "<ref name=a>abc</ref><ref name=a>def</ref>\n\na6uxj4<references />");
add("selser", "Multiple definition (outside <references/>) [2,2,0]", "18a7rv4\n\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n\njlrdr9\n<references />");
add("selser", "Multiple definition (outside <references/>) [[0,2,0],2,0]", "<ref name=a>abc</ref>ju4hvk\n<ref name=a>def</ref>\n\notv6i7\n<references />");
add("selser", "Multiple definition (outside <references/>) [[0,3,0],3,0]", "<ref name=a>abc</ref><ref name=a>def</ref><references />");
add("selser", "Multiple definition (outside <references/>) [0,2,0]", "<ref name=a>abc</ref>\n<ref name=a>def</ref>\n\n8tji3b\n<references />");
add("selser", "Multiple definition (outside <references/>) [0,3,0]", "<ref name=a>abc</ref>\n<ref name=a>def</ref><references />");
add("selser", "Multiple definition (outside <references/>) [[0,2,0],3,0]", "<ref name=a>abc</ref>ih0ams\n<ref name=a>def</ref><references />");
add("selser", "Multiple definition (outside <references/>) [1,0,0]", "<ref name=a>abc</ref>\n<ref name=a>def</ref>\n<references />");
add("selser", "Multiple definition (outside <references/>) [[0,4,0],3,0]", "<ref name=a>abc</ref>1cgp5ih<ref name=a>def</ref><references />");
add("selser", "Multiple definition (outside <references/>) [[0,3,0],0,0]", "<ref name=a>abc</ref><ref name=a>def</ref>\n<references />");
add("selser", "Multiple definition (inside <references/>) [2,0,0]", "1shzt7i\n\n<ref name=a />\n<references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside <references/>) [0,4,0]", "<ref name=a />\n\nj2d2v3<references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside <references/>) [3,3,0]", "<references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside <references/>) [4,0,0]", "1mq5xi9\n<references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside <references/>) [3,2,0]", "1voaewx\n<references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside <references/>) [3,0,0]", "\n<references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside <references/>) [1,3,0]", "<ref name=a /><references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside <references/>) [2,2,0]", "17efii4\n\n<ref name=a />\n\ntm836o\n<references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside <references/>) [0,2,0]", "<ref name=a />\n\n1wz7p7g\n<references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside <references/>) [0,3,0]", "<ref name=a /><references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside <references/>) [1,2,0]", "<ref name=a />\n\nm81v1p\n<references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside <references/>) [2,4,0]", "xf4te0\n\n<ref name=a />\n\n2z0p1t<references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside <references/>) [4,3,0]", "1s3isxl<references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside <references/>) [3,4,0]", "r0flg2<references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside <references/>) [4,2,0]", "lh5k9l\n\nng6fcw\n<references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside <references/>) [1,0,0]", "<ref name=a />\n<references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside <references/>) [1,4,0]", "<ref name=a />\n\nx94ao8<references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside <references/>) [2,3,0]", "c8cwx3\n\n<ref name=a /><references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside <references/>) [4,4,0]", "cmo8ee\n\ng752d7<references>\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [3,0,0]", "\n<references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [0,3,0]", "<ref name=a>abc</ref><references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [1,0,0]", "<ref name=a>abc</ref>\n<references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [0,2,0]", "<ref name=a>abc</ref>\n\nudes3p\n<references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [1,3,0]", "<ref name=a>abc</ref><references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [2,2,0]", "1crcki5\n\n<ref name=a>abc</ref>\n\npju9zv\n<references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [4,0,0]", "16j4odm\n<references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [1,2,0]", "<ref name=a>abc</ref>\n\n1c4red\n<references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [0,4,0]", "<ref name=a>abc</ref>\n\n2kee5s<references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [4,4,0]", "1lshcq8\n\n1harbih<references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [2,0,0]", "1ifluww\n\n<ref name=a>abc</ref>\n<references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [2,4,0]", "j3dwcn\n\n<ref name=a>abc</ref>\n\n129zho0<references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [4,2,0]", "1sz17ot\n\n1j56s11\n<references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [4,3,0]", "rqhfci<references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [2,3,0]", "1ab7bmd\n\n<ref name=a>abc</ref><references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [3,4,0]", "1ikkqqz<references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [1,4,0]", "<ref name=a>abc</ref>\n\ns1jxel<references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [3,3,0]", "<references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (mixed outside/inside) [3,2,0]", "gpcp3u\n<references>\n<ref name=a>def</ref>\n</references>");
add("selser", "Multiple definition (inside {{#tag:references}}) [2,4,0]", "1aft3zn\n\n<ref name=a />\n{{#tag:references|\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n}}\n\nyyf7ac");
add("selser", "Multiple definition (inside {{#tag:references}}) [1,3,0]", "<ref name=a />\n{{#tag:references|\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n}}");
add("selser", "Multiple definition (inside {{#tag:references}}) [1,2,0]", "<ref name=a />\n{{#tag:references|\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n}}\n\n6kbswz\n");
add("selser", "Multiple definition (inside {{#tag:references}}) [0,2,0]", "<ref name=a />\n{{#tag:references|\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n}}\n\n5bho14\n");
add("selser", "Multiple definition (inside {{#tag:references}}) [[0,3,0],2,0]", "<ref name=a />{{#tag:references|\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n}}\n\nlt0dsi\n");
add("selser", "Multiple definition (inside {{#tag:references}}) [4,2,0]", "1581laa\n\n1w4nfjk\n");
add("selser", "Multiple definition (inside {{#tag:references}}) [0,4,0]", "<ref name=a />\n{{#tag:references|\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n}}\n\n3s1r49");
add("selser", "Multiple definition (inside {{#tag:references}}) [2,2,0]", "170te2t\n\n<ref name=a />\n{{#tag:references|\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n}}\n\noa4pku\n");
add("selser", "Multiple definition (inside {{#tag:references}}) [3,4,0]", "1ict8e5");
add("selser", "Multiple definition (inside {{#tag:references}}) [[0,3,0],0,0]", "<ref name=a />{{#tag:references|\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n}}\n");
add("selser", "Multiple definition (inside {{#tag:references}}) [3,2,0]", "1r7p2dc\n");
add("selser", "Multiple definition (inside {{#tag:references}}) [[0,2,0],4,0]", "<ref name=a />v9lo28\n{{#tag:references|\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n}}\n\n1505q9s");
add("selser", "Multiple definition (inside {{#tag:references}}) [1,0,0]", "<ref name=a />\n{{#tag:references|\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n}}\n");
add("selser", "Multiple definition (inside {{#tag:references}}) [[0,4,0],0,0]", "<ref name=a />xg7njs{{#tag:references|\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n}}\n");
add("selser", "Multiple definition (inside {{#tag:references}}) [4,3,0]", "10oobdf");
add("selser", "Multiple definition (inside {{#tag:references}}) [[0,2,0],0,0]", "<ref name=a />wvocua\n{{#tag:references|\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n}}\n");
add("selser", "Multiple definition (inside {{#tag:references}}) [4,0,0]", "c6o25q\n");
add("selser", "Multiple definition (inside {{#tag:references}}) [2,3,0]", "r5lb7d\n\n<ref name=a />\n{{#tag:references|\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n}}");
add("selser", "Multiple definition (inside {{#tag:references}}) [1,4,0]", "<ref name=a />\n{{#tag:references|\n<ref name=a>abc</ref>\n<ref name=a>def</ref>\n}}\n\n1sdxf2c");
add("selser", "Ref: 3. spaces in ref-names should be ignored [[0,0,2,0,3,0],0,0]", "A <ref name=\"x\">foo</ref>8o50yh\nB <ref name=\" x \" /><ref name= x />\n<references />");
add("selser", "Ref: 3. spaces in ref-names should be ignored [[0,0,4,0,2,0],0,0]", "A <ref name=\"x\">foo</ref>7oni2y<ref name=\" x \" />wcnop\nC <ref name= x />\n<references />");
add("selser", "Ref: 3. spaces in ref-names should be ignored [[0,0,3,0,0,0],3,0]", "A <ref name=\"x\">foo</ref><ref name=\" x \" />\nC <ref name= x /><references />");
add("selser", "Ref: 3. spaces in ref-names should be ignored [[4,0,3,0,3,0],0,0]", "ie0a2h<ref name=\"x\">foo</ref><ref name=\" x \" /><ref name= x />\n<references />");
add("selser", "Ref: 3. spaces in ref-names should be ignored [2,0,0]", "1vzemgq\n\nA <ref name=\"x\">foo</ref>\nB <ref name=\" x \" />\nC <ref name= x />\n<references />");
add("selser", "Ref: 3. spaces in ref-names should be ignored [[3,0,4,0,0,0],4,0]", "<ref name=\"x\">foo</ref>56lkzv<ref name=\" x \" />\nC <ref name= x />\n\nn8go92<references />");
add("selser", "Ref: 3. spaces in ref-names should be ignored [1,2,0]", "A <ref name=\"x\">foo</ref>\nB <ref name=\" x \" />\nC <ref name= x />\n\ndpqatn\n<references />");
add("selser", "Ref: 3. spaces in ref-names should be ignored [0,4,0]", "A <ref name=\"x\">foo</ref>\nB <ref name=\" x \" />\nC <ref name= x />\n\nkb5zhd<references />");
add("selser", "Ref: 3. spaces in ref-names should be ignored [[4,0,2,0,0,0],0,0]", "na5zcf<ref name=\"x\">foo</ref>1w7hqb4\nB <ref name=\" x \" />\nC <ref name= x />\n<references />");
add("selser", "Ref: 3. spaces in ref-names should be ignored [[3,0,3,0,0,0],0,0]", "<ref name=\"x\">foo</ref><ref name=\" x \" />\nC <ref name= x />\n<references />");
add("selser", "Ref: 3. spaces in ref-names should be ignored [[0,0,4,0,3,0],4,0]", "A <ref name=\"x\">foo</ref>xzdr22<ref name=\" x \" /><ref name= x />\n\nfdyjh8<references />");
add("selser", "Ref: 3. spaces in ref-names should be ignored [[4,0,0,0,3,0],2,0]", "id09py<ref name=\"x\">foo</ref>\nB <ref name=\" x \" /><ref name= x />\n\n14epo21\n<references />");
add("selser", "Ref: 3. spaces in ref-names should be ignored [[3,0,3,0,0,0],2,0]", "<ref name=\"x\">foo</ref><ref name=\" x \" />\nC <ref name= x />\n\n2yz5rl\n<references />");
add("selser", "Ref: 3. spaces in ref-names should be ignored [1,0,0]", "A <ref name=\"x\">foo</ref>\nB <ref name=\" x \" />\nC <ref name= x />\n<references />");
add("selser", "Ref: 3. spaces in ref-names should be ignored [[3,0,0,0,0,0],3,0]", "<ref name=\"x\">foo</ref>\nB <ref name=\" x \" />\nC <ref name= x /><references />");
add("selser", "Ref: 3. spaces in ref-names should be ignored [[3,0,4,0,2,0],0,0]", "<ref name=\"x\">foo</ref>1rpjo1b<ref name=\" x \" />rjd0zn\nC <ref name= x />\n<references />");
add("selser", "Ref: 3. spaces in ref-names should be ignored [[0,0,0,0,4,0],0,0]", "A <ref name=\"x\">foo</ref>\nB <ref name=\" x \" />xidipo<ref name= x />\n<references />");
add("selser", "Ref: 5. body should accept generic wikitext [0,2,0]", "A <ref>\n This is a '''[[bolded link]]''' and this is a {{echo|transclusion}}\n</ref>\n\nrfr4d1\n\n<references />");
add("selser", "Ref: 5. body should accept generic wikitext [[2,0],0,0]", "c3i169A <ref>\n This is a '''[[bolded link]]''' and this is a {{echo|transclusion}}\n</ref>\n\n<references />");
add("selser", "Ref: 5. body should accept generic wikitext [[2,0],4,0]", "8zihkxA <ref>\n This is a '''[[bolded link]]''' and this is a {{echo|transclusion}}\n</ref>\n\ns392cx<references />");
add("selser", "Ref: 5. body should accept generic wikitext [2,3,0]", "1gmyrnh\n\nA <ref>\n This is a '''[[bolded link]]''' and this is a {{echo|transclusion}}\n</ref><references />");
add("selser", "Ref: 5. body should accept generic wikitext [1,0,0]", "A <ref>\n This is a '''[[bolded link]]''' and this is a {{echo|transclusion}}\n</ref>\n\n<references />");
add("selser", "Ref: 5. body should accept generic wikitext [1,2,0]", "A <ref>\n This is a '''[[bolded link]]''' and this is a {{echo|transclusion}}\n</ref>\n\ncqu2ea\n\n<references />");
add("selser", "Ref: 5. body should accept generic wikitext [0,3,0]", "A <ref>\n This is a '''[[bolded link]]''' and this is a {{echo|transclusion}}\n</ref><references />");
add("selser", "Ref: 5. body should accept generic wikitext [2,0,0]", "6ee4rt\n\nA <ref>\n This is a '''[[bolded link]]''' and this is a {{echo|transclusion}}\n</ref>\n\n<references />");
add("selser", "Ref: 5. body should accept generic wikitext [[4,0],0,0]", "e7jmj9<ref>\n This is a '''[[bolded link]]''' and this is a {{echo|transclusion}}\n</ref>\n\n<references />");
add("selser", "Ref: 5. body should accept generic wikitext [[3,0],0,0]", "<ref>\n This is a '''[[bolded link]]''' and this is a {{echo|transclusion}}\n</ref>\n\n<references />");
add("selser", "Ref: 5. body should accept generic wikitext [0,4,0]", "A <ref>\n This is a '''[[bolded link]]''' and this is a {{echo|transclusion}}\n</ref>\n\n1ru20lv<references />");
add("selser", "Ref: 5. body should accept generic wikitext [[3,0],3,0]", "<ref>\n This is a '''[[bolded link]]''' and this is a {{echo|transclusion}}\n</ref><references />");
add("selser", "Ref: 5. body should accept generic wikitext [1,4,0]", "A <ref>\n This is a '''[[bolded link]]''' and this is a {{echo|transclusion}}\n</ref>\n\n1cqoj1h<references />");
add("selser", "Ref: 6. indent-pres should not be output in ref-body [[3,0],2,0]", "<ref>\n foo\n bar\n baz\n</ref>\n\no81nla\n\n<references />");
add("selser", "Ref: 6. indent-pres should not be output in ref-body [[3,0],0,0]", "<ref>\n foo\n bar\n baz\n</ref>\n\n<references />");
add("selser", "Ref: 6. indent-pres should not be output in ref-body [[4,0],0,0]", "ptuvjm<ref>\n foo\n bar\n baz\n</ref>\n\n<references />");
add("selser", "Ref: 6. indent-pres should not be output in ref-body [[2,0],3,0]", "p8wx8eA <ref>\n foo\n bar\n baz\n</ref><references />");
add("selser", "Ref: 6. indent-pres should not be output in ref-body [1,0,0]", "A <ref>\n foo\n bar\n baz\n</ref>\n\n<references />");
add("selser", "Ref: 6. indent-pres should not be output in ref-body [1,4,0]", "A <ref>\n foo\n bar\n baz\n</ref>\n\n4n3og5<references />");
add("selser", "Ref: 6. indent-pres should not be output in ref-body [2,2,0]", "1mkq2nw\n\nA <ref>\n foo\n bar\n baz\n</ref>\n\nlkdmcw\n\n<references />");
add("selser", "Ref: 6. indent-pres should not be output in ref-body [0,4,0]", "A <ref>\n foo\n bar\n baz\n</ref>\n\ne6tbf7<references />");
add("selser", "Ref: 6. indent-pres should not be output in ref-body [[4,0],2,0]", "t1xo79<ref>\n foo\n bar\n baz\n</ref>\n\nohzvcd\n\n<references />");
add("selser", "Ref: 6. indent-pres should not be output in ref-body [0,3,0]", "A <ref>\n foo\n bar\n baz\n</ref><references />");
add("selser", "Ref: 6. indent-pres should not be output in ref-body [[2,0],2,0]", "65l2gkA <ref>\n foo\n bar\n baz\n</ref>\n\n9m5osh\n\n<references />");
add("selser", "Ref: 6. indent-pres should not be output in ref-body [2,3,0]", "1ps8i5m\n\nA <ref>\n foo\n bar\n baz\n</ref><references />");
add("selser", "Ref: 6. indent-pres should not be output in ref-body [1,2,0]", "A <ref>\n foo\n bar\n baz\n</ref>\n\n51p9mr\n\n<references />");
add("selser", "Ref: 6. indent-pres should not be output in ref-body [[2,0],0,0]", "lelu0jA <ref>\n foo\n bar\n baz\n</ref>\n\n<references />");
add("selser", "Ref: 7. No p-wrapping in ref-body [2,4,0]", "11gmkak\n\nA <ref>\nfoo\n\nbar\n\n\nbaz\n\n\n\nbooz\n</ref>\n\nsk6g75<references />");
add("selser", "Ref: 7. No p-wrapping in ref-body [1,0,0]", "A <ref>\nfoo\n\nbar\n\n\nbaz\n\n\n\nbooz\n</ref>\n\n<references />");
add("selser", "Ref: 7. No p-wrapping in ref-body [2,0,0]", "19hkhl7\n\nA <ref>\nfoo\n\nbar\n\n\nbaz\n\n\n\nbooz\n</ref>\n\n<references />");
add("selser", "Ref: 7. No p-wrapping in ref-body [[4,0],3,0]", "mhw4l<ref>\nfoo\n\nbar\n\n\nbaz\n\n\n\nbooz\n</ref><references />");
add("selser", "Ref: 7. No p-wrapping in ref-body [0,4,0]", "A <ref>\nfoo\n\nbar\n\n\nbaz\n\n\n\nbooz\n</ref>\n\n17wtnne<references />");
add("selser", "Ref: 7. No p-wrapping in ref-body [2,3,0]", "8w30ur\n\nA <ref>\nfoo\n\nbar\n\n\nbaz\n\n\n\nbooz\n</ref><references />");
add("selser", "Ref: 7. No p-wrapping in ref-body [1,4,0]", "A <ref>\nfoo\n\nbar\n\n\nbaz\n\n\n\nbooz\n</ref>\n\nvrpcfk<references />");
add("selser", "Ref: 7. No p-wrapping in ref-body [0,2,0]", "A <ref>\nfoo\n\nbar\n\n\nbaz\n\n\n\nbooz\n</ref>\n\ndbwcqg\n\n<references />");
add("selser", "Ref: 7. No p-wrapping in ref-body [[4,0],0,0]", "z8di7p<ref>\nfoo\n\nbar\n\n\nbaz\n\n\n\nbooz\n</ref>\n\n<references />");
add("selser", "Ref: 7. No p-wrapping in ref-body [[3,0],0,0]", "<ref>\nfoo\n\nbar\n\n\nbaz\n\n\n\nbooz\n</ref>\n\n<references />");
add("selser", "Ref: 7. No p-wrapping in ref-body [1,3,0]", "A <ref>\nfoo\n\nbar\n\n\nbaz\n\n\n\nbooz\n</ref><references />");
add("selser", "Ref: 7. No p-wrapping in ref-body [[2,0],4,0]", "66snq8A <ref>\nfoo\n\nbar\n\n\nbaz\n\n\n\nbooz\n</ref>\n\nwxakw7<references />");
add("selser", "Ref: 7. No p-wrapping in ref-body [[4,0],4,0]", "1m1b33i<ref>\nfoo\n\nbar\n\n\nbaz\n\n\n\nbooz\n</ref>\n\n4e9v8b<references />");
add("selser", "Ref: 7. No p-wrapping in ref-body [[3,0],3,0]", "<ref>\nfoo\n\nbar\n\n\nbaz\n\n\n\nbooz\n</ref><references />");
add("selser", "Ref: 8. transclusion wikitext has lower precedence [[3,0,0],0,0]", "<ref> foo {{echo|</ref> B C}}\n\n<references />");
add("selser", "Ref: 8. transclusion wikitext has lower precedence [0,2,0]", "A <ref> foo {{echo|</ref> B C}}\n\nndg5c4\n\n<references />");
add("selser", "Ref: 8. transclusion wikitext has lower precedence [[0,0,2],2,0]", "A <ref> foo {{echo|</ref><nowiki>b5njrh B C}}</nowiki>\n\na1gxhc\n\n<references />");
add("selser", "Ref: 8. transclusion wikitext has lower precedence [1,4,0]", "A <ref> foo {{echo|</ref> B C}}\n\nu9j3ix<references />");
add("selser", "Ref: 8. transclusion wikitext has lower precedence [0,3,0]", "A <ref> foo {{echo|</ref> B C}}<references />");
add("selser", "Ref: 8. transclusion wikitext has lower precedence [[2,0,0],0,0]", "1ulfrvA <ref> foo {{echo|</ref> B C}}\n\n<references />");
add("selser", "Ref: 8. transclusion wikitext has lower precedence [[2,0,4],0,0]", "hmwoofA <ref> foo {{echo|</ref>14n13je\n\n<references />");
add("selser", "Ref: 8. transclusion wikitext has lower precedence [0,4,0]", "A <ref> foo {{echo|</ref> B C}}\n\n1pwtjex<references />");
add("selser", "Ref: 8. transclusion wikitext has lower precedence [[4,0,3],4,0]", "f35roz<ref> foo {{echo|</ref>\n\nwy9pr3<references />");
add("selser", "Ref: 8. transclusion wikitext has lower precedence [1,0,0]", "A <ref> foo {{echo|</ref> B C}}\n\n<references />");
add("selser", "Ref: 8. transclusion wikitext has lower precedence [[3,0,0],2,0]", "<ref> foo {{echo|</ref> B C}}\n\nukwq6i\n\n<references />");
add("selser", "Ref: 8. transclusion wikitext has lower precedence [[4,0,2],3,0]", "fypf0r<ref> foo {{echo|</ref><nowiki>az008s B C}}</nowiki><references />");
add("selser", "Ref: 8. transclusion wikitext has lower precedence [2,0,0]", "1b905vn\n\nA <ref> foo {{echo|</ref> B C}}\n\n<references />");
add("selser", "Ref: 8. transclusion wikitext has lower precedence [[2,0,0],2,0]", "7uxsg5A <ref> foo {{echo|</ref> B C}}\n\n1v27tzn\n\n<references />");
add("selser", "Ref: 8. transclusion wikitext has lower precedence [[0,0,4],4,0]", "A <ref> foo {{echo|</ref>1wsbfe6\n\nmic5ln<references />");
add("selser", "Ref: 8. transclusion wikitext has lower precedence [[4,0,2],4,0]", "ad938x<ref> foo {{echo|</ref><nowiki>9qwptv B C}}</nowiki>\n\n1j9wtig<references />");
add("selser", "Ref: 9. unclosed comments should not leak out of ref-body [2,3,0]", "179nhm1\n\nA <ref> foo <!--</ref> B C<references />");
add("selser", "Ref: 9. unclosed comments should not leak out of ref-body [[4,0,0],4,0]", "sb6ksz<ref> foo <!--</ref> B C\n\ngzhiq3<references />");
add("selser", "Ref: 9. unclosed comments should not leak out of ref-body [[0,0,4],3,0]", "A <ref> foo <!--</ref>aoy805<references />");
add("selser", "Ref: 9. unclosed comments should not leak out of ref-body [[2,0,0],2,0]", "7hluh3A <ref> foo <!--</ref> B C\n\n11srvlw\n<references />");
add("selser", "Ref: 9. unclosed comments should not leak out of ref-body [1,0,0]", "A <ref> foo <!--</ref> B C\n<references />");
add("selser", "Ref: 9. unclosed comments should not leak out of ref-body [[2,0,0],0,0]", "vfks5wA <ref> foo <!--</ref> B C\n<references />");
add("selser", "Ref: 9. unclosed comments should not leak out of ref-body [[4,0,4],2,0]", "kix7sr<ref> foo <!--</ref>13rspfe\n\n1gyggbp\n<references />");
add("selser", "Ref: 9. unclosed comments should not leak out of ref-body [[3,0,4],0,0]", "<ref> foo <!--</ref>a6c568\n<references />");
add("selser", "Ref: 9. unclosed comments should not leak out of ref-body [1,2,0]", "A <ref> foo <!--</ref> B C\n\n1ih18bl\n<references />");
add("selser", "Ref: 9. unclosed comments should not leak out of ref-body [[2,0,0],4,0]", "1wmw3rhA <ref> foo <!--</ref> B C\n\n1nvcezs<references />");
add("selser", "Ref: 9. unclosed comments should not leak out of ref-body [[4,0,0],3,0]", "1sddkuq<ref> foo <!--</ref> B C<references />");
add("selser", "Ref: 9. unclosed comments should not leak out of ref-body [2,0,0]", "17eaulh\n\nA <ref> foo <!--</ref> B C\n<references />");
add("selser", "Ref: 9. unclosed comments should not leak out of ref-body [[0,0,2],0,0]", "A <ref> foo <!--</ref>a679pd B C\n<references />");
add("selser", "Ref: 9. unclosed comments should not leak out of ref-body [[3,0,3],4,0]", "<ref> foo <!--</ref>\n\n1tnuwn7<references />");
add("selser", "Ref: 9. unclosed comments should not leak out of ref-body [[0,0,4],2,0]", "A <ref> foo <!--</ref>1s5ppq0\n\n1hwfma7\n<references />");
add("selser", "Ref: 10. Unclosed HTML tags should not leak out of ref-body [1,3,0]", "A <ref> <b> foo </ref> B C<references />");
add("selser", "Ref: 10. Unclosed HTML tags should not leak out of ref-body [1,2,0]", "A <ref> <b> foo </ref> B C\n\nhegopy\n\n<references />");
add("selser", "Ref: 10. Unclosed HTML tags should not leak out of ref-body [2,0,0]", "15f069w\n\nA <ref> <b> foo </ref> B C\n\n<references />");
add("selser", "Ref: 10. Unclosed HTML tags should not leak out of ref-body [[3,0,2],0,0]", "<ref> <b> foo </ref>swmzx0 B C\n\n<references />");
add("selser", "Ref: 10. Unclosed HTML tags should not leak out of ref-body [2,3,0]", "17ymgx4\n\nA <ref> <b> foo </ref> B C<references />");
add("selser", "Ref: 10. Unclosed HTML tags should not leak out of ref-body [[2,0,0],0,0]", "lz8h9bA <ref> <b> foo </ref> B C\n\n<references />");
add("selser", "Ref: 10. Unclosed HTML tags should not leak out of ref-body [[4,0,2],0,0]", "a7uih1<ref> <b> foo </ref>ta8yz B C\n\n<references />");
add("selser", "Ref: 10. Unclosed HTML tags should not leak out of ref-body [[0,0,2],0,0]", "A <ref> <b> foo </ref>5ncz3l B C\n\n<references />");
add("selser", "Ref: 10. Unclosed HTML tags should not leak out of ref-body [[3,0,4],0,0]", "<ref> <b> foo </ref>f7l4yc\n\n<references />");
add("selser", "Ref: 10. Unclosed HTML tags should not leak out of ref-body [[4,0,0],0,0]", "v9dbkg<ref> <b> foo </ref> B C\n\n<references />");
add("selser", "Ref: 10. Unclosed HTML tags should not leak out of ref-body [0,3,0]", "A <ref> <b> foo </ref> B C<references />");
add("selser", "Ref: 10. Unclosed HTML tags should not leak out of ref-body [[2,0,0],2,0]", "6wri75A <ref> <b> foo </ref> B C\n\n9k6iq\n\n<references />");
add("selser", "Ref: 10. Unclosed HTML tags should not leak out of ref-body [0,4,0]", "A <ref> <b> foo </ref> B C\n\ntgolxy<references />");
add("selser", "Ref: 10. Unclosed HTML tags should not leak out of ref-body [[0,0,4],3,0]", "A <ref> <b> foo </ref>6oadkh<references />");
add("selser", "Ref: 12. ref-tags act as trailing newline migration barrier [4,[2],3,2,4,[4],3,0]", "17pa34f\n\n1g9n9uza\n\ntns9fo\n\nb<!--the newline at the end of this line stays inside the p tag--> <ref />\n<ref />\n\nztzbr0\n\n16udisr\n<references />");
add("selser", "References: 9. Generate missing references list at the end [0,4,0,3,0]", "A <ref>foo</ref>\nB <ref group=\"inexistent\">bar</ref>\n\nm523wx");
add("selser", "References: 9. Generate missing references list at the end [4,4,0,4,0]", "1764b27\n\n1ssyey51i8g4aj");
add("selser", "References: 9. Generate missing references list at the end [[2,0,2,0],0,0,3,0]", "fnars4A <ref>foo</ref>a75i8b\nB <ref group=\"inexistent\">bar</ref>\n");
add("selser", "References: 9. Generate missing references list at the end [3,0,0,2,0]", "\n1mbxn6j\n");
add("selser", "References: 9. Generate missing references list at the end [[0,0,2,0],2,0,0,0]", "A <ref>foo</ref>qqtrep\nB <ref group=\"inexistent\">bar</ref>\n\n1tyoqe5\n");
add("selser", "References: 9. Generate missing references list at the end [4,2,0,3,0]", "1fe5ffa\n\n1ruvjir\n");
add("selser", "References: 9. Generate missing references list at the end [0,3,0,0,0]", "A <ref>foo</ref>\nB <ref group=\"inexistent\">bar</ref>");
add("selser", "References: 9. Generate missing references list at the end [[0,0,4,0],0,0,4,0]", "A <ref>foo</ref>wz4guj<ref group=\"inexistent\">bar</ref>\npbcyz2");
add("selser", "References: 9. Generate missing references list at the end [[0,0,4,0],0,0,3,0]", "A <ref>foo</ref>nl5b0<ref group=\"inexistent\">bar</ref>\n");
add("selser", "References: 9. Generate missing references list at the end [[3,0,0,0],3,0,0,0]", "<ref>foo</ref>\nB <ref group=\"inexistent\">bar</ref>");
add("selser", "References: 9. Generate missing references list at the end [3,3,0,0,0]", "");
add("selser", "References: 9. Generate missing references list at the end [[4,0,4,0],2,0,4,0]", "z1d44k<ref>foo</ref>12zna7d<ref group=\"inexistent\">bar</ref>\n\n1rtnhuh\n1w1j39l");
add("selser", "References: 9. Generate missing references list at the end [4,3,0,2,0]", "1mbcfde1utf8bj\n");
add("selser", "References: 9. Generate missing references list at the end [2,3,0,0,0]", "1dmiax9\n\nA <ref>foo</ref>\nB <ref group=\"inexistent\">bar</ref>");
add("selser", "References: 9. Generate missing references list at the end [[4,0,0,0],3,0,0,0]", "r7gaia<ref>foo</ref>\nB <ref group=\"inexistent\">bar</ref>");
add("selser", "References: 9. Generate missing references list at the end [[4,0,0,0],0,0,2,0]", "1kbqga8<ref>foo</ref>\nB <ref group=\"inexistent\">bar</ref>\n1y952id\n");
add("selser", "References: 9. Generate missing references list at the end [1,3,0,0,0]", "A <ref>foo</ref>\nB <ref group=\"inexistent\">bar</ref>");
add("selser", "References: 9. Generate missing references list at the end [0,0,0,4,0]", "A <ref>foo</ref>\nB <ref group=\"inexistent\">bar</ref>xixkmh");
add("selser", "References: 9. Generate missing references list at the end [[4,0,0,0],3,0,3,0]", "jqf638<ref>foo</ref>\nB <ref group=\"inexistent\">bar</ref>");
add("selser", "References: 9. Generate missing references list at the end [3,0,0,0,0]", "\n");
// ### DO NOT REMOVE THIS LINE ### (end of automatically-generated section)
if (typeof module === 'object') {
module.exports.testBlackList = testBlackList;
}
diff --git a/tests/parserTests-blacklist.js b/tests/parserTests-blacklist.js
index f51d0004e..150d5344b 100644
--- a/tests/parserTests-blacklist.js
+++ b/tests/parserTests-blacklist.js
@@ -1,2028 +1,1931 @@
/* A map of tests which we know Parsoid currently fails.
*
* New patches which fix previously-broken tests should also patch this
* file to document which tests are now expected to succeed.
*
* This helps clean up 'npm test' output, documents known bugs, and helps
* Jenkins make sense of the parserTest output.
*
* NOTE that the selser blacklist depends on tests/selser.changes.json
* If the selser change list is modified, this blacklist should be refreshed.
*
* This blacklist can be automagically updated by running
* parserTests.js --rewrite-blacklist
* You might want to do this after you fix some bug that makes more tests
* pass. It is still your responsibility to carefully review the blacklist
* diff to ensure there are no unexpected new failures (lines added).
*/
/*
* This should map test titles to an array of test types (wt2html, wt2wt,
* html2html, html2wt, selser) which are known to fail.
* For easier maintenance, we group each test type together, and use a
* helper function to create the array if needed then append the test type.
*/
'use strict';
var testBlackList = {};
var add = function(mode, title, raw) { // eslint-disable-line
if (typeof (testBlackList[title]) !== 'object') {
testBlackList[title] = {};
}
testBlackList[title][mode] = raw;
};
// ### DO NOT REMOVE THIS LINE ### (start of automatically-generated section)
// Blacklist for wt2html
add("wt2html", "Non-word characters don't terminate tag names (T19663, T42670, T54022)", "&lt;blockquote|>a\n\n<p data-parsoid='{\"dsr\":[29,57,0,0]}'>&lt;b→> doesn't terminate &lt;/b→></p>\n\n<p data-parsoid='{\"dsr\":[59,87,0,0]}'>&lt;bä> doesn't terminate &lt;/bä></p>\n\n<p data-parsoid='{\"dsr\":[89,119,0,0]}'>&lt;boo> doesn't terminate &lt;/boo></p>\n\n<p data-parsoid='{\"dsr\":[121,155,0,0]}'>&lt;s.foo> doesn't terminate &lt;/s.foo></p>\n\n<p data-parsoid='{\"dsr\":[157,167,0,0]}'>&lt;sub-ID#1></p>");
add("wt2html", "Non-word characters don't terminate tag names", "&lt;blockquote|>a\n\n<p data-parsoid='{\"dsr\":[29,57,0,0]}'>&lt;b→> doesn't terminate &lt;/b→></p>\n\n<p data-parsoid='{\"dsr\":[59,87,0,0]}'>&lt;bä> doesn't terminate &lt;/bä></p>\n\n<p data-parsoid='{\"dsr\":[89,119,0,0]}'>&lt;boo> doesn't terminate &lt;/boo></p>\n\n<p data-parsoid='{\"dsr\":[121,155,0,0]}'>&lt;s.foo> doesn't terminate &lt;/s.foo></p>\n\n<p data-parsoid='{\"dsr\":[157,167,0,0]}'>&lt;sub-ID#1></p>");
add("wt2html", "Comment on its own line post-expand", "<p data-parsoid='{\"dsr\":[0,20,0,0]}'>a\n<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[2,11,null,null],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"blank\",\"href\":\"./Template:Blank\"},\"params\":{},\"i\":0}}]}'></span><!---->\nb</p>");
add("wt2html", "Comment on its own line post-expand with non-significant whitespace", "<p data-parsoid='{\"dsr\":[0,23,0,0]}'>a\n <span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[3,12,null,null],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"blank\",\"href\":\"./Template:Blank\"},\"params\":{},\"i\":0}}]}'></span> <!----> \nb</p>");
add("wt2html", "Block tag on one line (<blockquote>)", "<p data-parsoid='{\"dsr\":[0,2,0,0]}'>a </p><blockquote data-parsoid='{\"stx\":\"html\",\"dsr\":[2,30,12,13]}'>foo</blockquote>\n\n<p data-parsoid='{\"dsr\":[32,33,0,0]}'>b</p>");
add("wt2html", "Block tag on both lines (<blockquote>)", "<p data-parsoid='{\"dsr\":[0,2,0,0]}'>a </p><blockquote data-parsoid='{\"stx\":\"html\",\"dsr\":[2,30,12,13]}'>foo</blockquote>\n\n<p data-parsoid='{\"dsr\":[32,34,0,0]}'>b </p><blockquote data-parsoid='{\"stx\":\"html\",\"dsr\":[34,62,12,13]}'>foo</blockquote>");
add("wt2html", "T54763: Preformatted in <blockquote>", "<blockquote data-parsoid='{\"stx\":\"html\",\"dsr\":[0,74,12,13]}'>\n<p data-parsoid='{\"dsr\":[13,18,0,0]}'> Blah</p>\n<table data-parsoid='{\"dsr\":[19,60,2,2]}'>\n<tbody data-parsoid='{\"dsr\":[22,58,0,0]}'><tr data-parsoid='{\"autoInsertedStart\":true,\"dsr\":[22,57,0,0]}'><td data-parsoid='{\"dsr\":[22,57,1,0]}'>\n<pre data-parsoid='{\"dsr\":[24,57,1,0]}'>indented cell (no pre-wrapping!)</pre></td></tr>\n</tbody></table>\n</blockquote>");
add("wt2html", "T17491: <ins>/<del> in blockquote (2)", "<blockquote data-parsoid='{\"stx\":\"html\",\"dsr\":[0,64,12,13]}'>Foo <del data-parsoid='{\"stx\":\"html\",\"dsr\":[16,30,5,6]}'>bar</del> <ins data-parsoid='{\"stx\":\"html\",\"dsr\":[31,45,5,6]}'>baz</ins> quux\n</blockquote>");
add("wt2html", "Templates: Indent-Pre: 1f: Wrapping should be based on expanded content", "<pre about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,11,1,0],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\" \"}},\"i\":0}},\"a\"]}'>a</pre>\n\n<span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[13,25,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"\\n \"}},\"i\":0}},\"a\"]}'>\n</span><pre about=\"#mwt2\">a</pre>\n\n<span about=\"#mwt3\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[27,39,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"\\n b\"}},\"i\":0}}]}'>\n</span><pre about=\"#mwt3\">b</pre>\n\n<p about=\"#mwt4\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[41,54,0,0],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"a\\n \"}},\"i\":0}},\"b\"]}'>a</p><span about=\"#mwt4\">\n</span><pre about=\"#mwt4\">b</pre>\n\n<p about=\"#mwt5\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[56,67,0,0],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"a\\n\"}},\"i\":0}}]}'>a</p><span about=\"#mwt5\">\n</span><pre data-parsoid='{\"dsr\":[67,69,1,0]}'>b</pre>");
add("wt2html", "Templates: Don't strip whitespace from positional-param values", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,11,0,0],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"a \"}},\"i\":0}}]}'>a </p>\n\n<p about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[13,33,0,0],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"{{echo|b}} \"}},\"i\":0}}]}'>b </p>\n\n<pre about=\"#mwt4\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[35,48,null,null],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\" c \\n\"}},\"i\":0}}]}'>c </pre><span about=\"#mwt4\">\n</span>\n\n<pre about=\"#mwt5\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[50,71,null,null],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\" {{echo|d}}\\n\"}},\"i\":0}}]}'>d</pre><span about=\"#mwt5\">\n</span>\n\n<span about=\"#mwt7\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[73,85,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"\\n e\"}},\"i\":0}}]}'>\n</span><pre about=\"#mwt7\">e</pre>\n\n<span about=\"#mwt8\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[87,99,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"\\n*f\"}},\"i\":0}}]}'>\n</span><ul about=\"#mwt8\"><li>f</li></ul>\n\n<span about=\"#mwt9\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[101,113,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"\\n \"}},\"i\":0}},\"g\"]}'>\n</span><pre about=\"#mwt9\">g</pre>");
add("wt2html", "Templates: Other wikitext in parameter names (T69657)", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,18,0,0],\"pi\":[[{\"k\":\"&apos;&apos;1&apos;&apos;\",\"named\":true}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"&apos;&apos;1&apos;&apos;\":{\"wt\":\"foo\"}},\"i\":0}}]}'>foo</p>");
add("wt2html", "6. Pre-blocks should extend across lines with leading WS even when there is no wrappable content", "<pre data-parsoid='{\"dsr\":[0,26,1,0]}'>a\n\n <!-- continue -->\nb</pre>\n\n<pre data-parsoid='{\"dsr\":[28,30,1,0]}'>c</pre>\n \n<p data-parsoid='{\"dsr\":[33,34,0,0]}'>d</p>");
add("wt2html", "Definition lists: ignore colons inside tags", "<dl data-parsoid='{\"dsr\":[0,38,0,0]}'><dt data-parsoid='{\"dsr\":[0,38,1,0]}'>one <b data-parsoid='{\"stx\":\"html\",\"dsr\":[5,34,3,4]}'>two<span typeof=\"mw:DisplaySpace mw:Placeholder\" data-parsoid='{\"src\":\" \",\"isDisplayHack\":true,\"dsr\":[11,12,null,0]}'> </span>: tag <i data-parsoid='{\"stx\":\"html\",\"dsr\":[18,29,3,4]}'>fun:</i>:</b>:def</dt></dl>");
add("wt2html", "Definition Lists: Hacky use to indent tables (with content following table)", "<dl data-parsoid='{\"dsr\":[0,61,0,0]}'><dd data-parsoid='{\"dsr\":[0,61,1,0]}'><table data-parsoid='{\"dsr\":[1,16,2,2]}'>\n<tbody data-parsoid='{\"dsr\":[4,14,0,0]}'><tr data-parsoid='{\"autoInsertedStart\":true,\"dsr\":[4,13,0,0]}'><td data-parsoid='{\"dsr\":[4,8,1,0]}'>foo</td>\n<td data-parsoid='{\"dsr\":[9,13,1,0]}'>bar</td></tr>\n</tbody></table> <!--c1--><p data-parsoid='{\"dsr\":[26,61,0,0]}'> this text should be part of the dl</p></dd></dl>");
add("wt2html", "T4702: Mismatched <i>, <b> and <a> tags are invalid", "<p data-parsoid='{\"dsr\":[0,204,0,0]}'><i data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[0,29,2,0]}'><a rel=\"mw:ExtLink\" class=\"external text\" href=\"http://example.com\" data-parsoid='{\"targetOff\":22,\"contentOffsets\":[22,28],\"dsr\":[2,29,20,1]}'>text<i data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[26,28,2,0]}'></i></a></i>\n<a rel=\"mw:ExtLink\" class=\"external text\" href=\"http://example.com\" data-parsoid='{\"targetOff\":50,\"contentOffsets\":[50,57],\"dsr\":[30,58,20,1]}'><b data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[50,57,3,0]}'>text</b></a><b data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[58,61,3,0]}'></b>\n<i data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[62,106,2,0]}'>Something <a rel=\"mw:ExtLink\" class=\"external text\" href=\"http://example.com\" data-parsoid='{\"targetOff\":94,\"contentOffsets\":[94,105],\"dsr\":[74,106,20,1]}'>in italic<i data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[103,105,2,0]}'></i></a></i>\n<i data-parsoid='{\"dsr\":[107,164,2,2]}'>Something <a rel=\"mw:ExtLink\" class=\"external text\" href=\"http://example.com\" data-parsoid='{\"targetOff\":139,\"contentOffsets\":[139,160],\"dsr\":[119,161,20,1]}'>mixed<b data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[144,160,3,0]}'><i data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[147,160,2,0]}'>, even bold</i></b></a>'</i>\n<b data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[165,204,3,0]}'><i data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[168,204,2,0]}'>Now <a rel=\"mw:ExtLink\" class=\"external text\" href=\"http://example.com\" data-parsoid='{\"targetOff\":194,\"contentOffsets\":[194,203],\"dsr\":[174,204,20,1]}'>both<b data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[198,203,3,0]}'><i data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[201,203,2,0]}'></i></b></a></i></b></p>");
add("wt2html", "External link containing double-single-quotes in text embedded in italics (T6598 sanity check)", "<p data-parsoid='{\"dsr\":[0,60,0,0]}'><i data-parsoid='{\"dsr\":[0,60,2,2]}'>Some <a rel=\"mw:ExtLink\" class=\"external text\" href=\"http://example.com/\" data-parsoid='{\"targetOff\":28,\"contentOffsets\":[28,56],\"dsr\":[7,57,21,1]}'>pretty <i data-parsoid='{\"dsr\":[35,46,2,2]}'>italics</i> and stuff</a>!</i></p>");
add("wt2html", "Self-link to numeric title", "<p data-parsoid='{\"dsr\":[0,5,0,0]}'><a rel=\"mw:WikiLink\" href=\"./0\" title=\"0\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./0\"},\"sa\":{\"href\":\"0\"},\"dsr\":[0,5,2,2]}'>0</a></p>");
add("wt2html", "Interlanguage link with spacing", "<p data-parsoid='{\"dsr\":[0,14,0,0]}'>Blah blah blah</p>\n<link rel=\"mw:PageProp/Language\" href=\"http://zh.wikipedia.org/wiki/%20%20%20%20Chinese%20%20%20%20%20\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://zh.wikipedia.org/wiki/%20%20%20%20Chinese%20%20%20%20%20\"},\"sa\":{\"href\":\" zh : Chinese \"},\"dsr\":[15,43,null,null]}'/>");