Page MenuHomePhabricator

No OneTemporary

File Metadata

Created
Mon, Sep 23, 11:06 AM
This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/lib/wt2html/pegTokenizer.pegjs b/lib/wt2html/pegTokenizer.pegjs
index e83d60cda..604c0ec00 100644
--- a/lib/wt2html/pegTokenizer.pegjs
+++ b/lib/wt2html/pegTokenizer.pegjs
@@ -1,2317 +1,2324 @@
/**
* Combined Wiki (MediaWiki) and HTML tokenizer based on pegjs. Emits several
* chunks of tokens (one chunk per top-level block matched) and eventually an
* end event. Tokens map to HTML tags as far as possible, with custom tokens
* used where further processing on the token stream is needed.
*/
{
var pegIncludes = options.pegIncludes;
var pegTokenizer = options.pegTokenizer;
var env = pegTokenizer.env;
var pipelineOpts = pegTokenizer.options;
var DU = pegIncludes.DOMUtils;
var Util = pegIncludes.Util;
var JSUtils = pegIncludes.JSUtils;
var PegTokenizer = pegIncludes.PegTokenizer;
var defines = pegIncludes.defines;
var constants = pegIncludes.constants;
var tu = pegIncludes.tu;
// define some constructor shortcuts
var KV = defines.KV;
var TagTk = defines.TagTk;
var SelfclosingTagTk = defines.SelfclosingTagTk;
var EndTagTk = defines.EndTagTk;
var NlTk = defines.NlTk;
var CommentTk = defines.CommentTk;
var EOFTk = defines.EOFTk;
var lastItem = JSUtils.lastItem;
var inlineBreaks = tu.inlineBreaks;
var stops = new tu.SyntaxStops();
var prevOffset = 0;
// Some shorthands for legibility
var startOffset = function() {
return location().start.offset;
};
var endOffset = function() {
return location().end.offset;
};
var tsrOffsets = function(flag) {
return tu.tsrOffsets(location(), flag);
};
/*
* Emit a chunk of tokens to our consumers. Once this has been done, the
* current expression can return an empty list (true).
*/
var emitChunk = function(tokens) {
if (env.immutable) {
// Tokens placed in the tokenizer's cache have been frozen to
// to catch any mutations while testing, which may have led to
// subtle, spooky action at a distance.
tokens = Util.unFreeze(tokens, true);
}
// Shift tsr of all tokens by the pipeline offset
Util.shiftTokenTSR(tokens, options.pipelineOffset);
env.log("trace/peg", pegTokenizer.pipelineId, "----> ", tokens);
var i;
var n = tokens.length;
// Enforce parsing resource limits
for (i = 0; i < n; i++) {
tu.enforceParserResourceLimits(env, tokens[i]);
}
// limit the size of individual chunks
var chunkLimit = 100000;
if (n > chunkLimit) {
i = 0;
while (i < n) {
options.cb(tokens.slice(i, i + chunkLimit));
i += chunkLimit;
}
} else {
options.cb(tokens);
}
};
/* ------------------------------------------------------------------------
* Extension tags should be parsed with higher priority than anything else.
*
* The trick we use is to strip out the content inside a matching tag-pair
* and not tokenize it. The content, if it needs to parsed (for example,
* for <ref>, <*include*> tags), is parsed in a fresh tokenizer context
* which means any error correction that needs to happen is restricted to
* the scope of the extension content and doesn't spill over to the higher
* level. Ex: <math><!--foo</math>.
*
* IGNORE: {{ this just balances the blocks in this comment for pegjs
*
* This trick also lets us prevent extension content (that don't accept WT)
* from being parsed as wikitext (Ex: <math>\frac{foo\frac{bar}}</math>)
* We don't want the "}}" being treated as a template closing tag and
* closing outer templates.
* --------------------------------------------------------------------- */
var isXMLTag = function(name, block) {
var lName = name.toLowerCase();
var uName = name.toUpperCase();
var isInstalledExt = env.conf.wiki.extensionTags.has(lName);
var isIncludeTag = lName === 'includeonly' ||
lName === 'noinclude' || lName === 'onlyinclude';
var isHtmlTag = block ?
Util.isBlockTag(uName) :
constants.HTML.HTML5Tags.has(uName) || constants.HTML.OlderHTMLTags.has(uName);
// WARNING: Be careful to pop this when `isXMLTag` is used.
stops.push('extTag', isInstalledExt);
return isHtmlTag || isInstalledExt || isIncludeTag;
};
var maybeExtensionTag = function(t) {
var tagName = t.name.toLowerCase();
var isInstalledExt = env.conf.wiki.extensionTags.has(tagName);
var isIncludeTag = tagName === 'includeonly' ||
tagName === 'noinclude' || tagName === 'onlyinclude';
// Extensions have higher precedence when they shadow html tags.
if (!(isInstalledExt || isIncludeTag)) {
return t;
}
var dp = t.dataAttribs;
var skipLen = 0;
switch (t.constructor) {
case EndTagTk:
if (isIncludeTag) {
return t;
}
// Similar to TagTk, we rely on the sanitizer to convert to text
// where necessary and emit tokens to ease the wikitext escaping
// code. However, extension tags that shadow html tags will see
// their unmatched end tags dropped while tree building, since
// the sanitizer will let them through.
return t; // not text()
case SelfclosingTagTk:
dp.src = input.substring(dp.tsr[0], dp.tsr[1]);
dp.tagWidths = [dp.tsr[1] - dp.tsr[0], 0];
if (isIncludeTag) {
return t;
}
break;
case TagTk:
var tsr0 = dp.tsr[0];
var endTagRE = new RegExp("^[\\s\\S]*?(</\\s*" + tagName + "\\s*>)", "mi");
var restOfInput = input.substring(tsr0);
var tagContent = restOfInput.match(endTagRE);
if (!tagContent) {
dp.src = input.substring(dp.tsr[0], dp.tsr[1]);
dp.tagWidths = [dp.tsr[1] - dp.tsr[0], 0];
if (isIncludeTag) {
return t;
} else {
// This is undefined behaviour. The php parser currently
- // returns a tag here as well, which results in unclosed
+ // returns text here (see core commit 674e8388cba),
+ // whereas this results in unclosed
// extension tags that shadow html tags falling back to
// their html equivalent. The sanitizer will take care
// of converting to text where necessary. We do this to
// simplify `hasWikitextTokens` when escaping wikitext,
// which wants these as tokens because it's otherwise
// lacking in context.
return t; // not text()
}
}
var extSrc = tagContent[0];
var endTagWidth = tagContent[1].length;
if (pipelineOpts.inTemplate) {
// Support 1-level of nesting in extensions tags while
// tokenizing in templates to support the #tag parser function.
//
// It's necessary to permit this broadly in templates because
// there's no way to distinguish whether the nesting happened
// while expanding the #tag parser function, or just a general
// syntax errors. In other words,
//
// hi<ref>ho<ref>hi</ref>ho</ref>
//
// and
//
// hi{{#tag:ref|ho<ref>hi</ref>ho}}
//
// found in template are returned indistinguishably after a
// preprocessing request, though the php parser renders them
// differently. #tag in template is probably a common enough
// use case that we want to accept these false positives,
// though another approach could be to drop this code here, and
// invoke a native #tag handler and forgo those in templates.
//
// Expand `extSrc` as long as there is a <tagName> found in the
// extension source body.
var s = extSrc.substring(endOffset() - tsr0);
while (s && s.match(new RegExp("<" + tagName + "[^/<>]*>"))) {
tagContent = restOfInput.substring(extSrc.length).match(endTagRE);
if (tagContent) {
s = tagContent[0];
endTagWidth = tagContent[1].length;
extSrc += s;
} else {
s = null;
}
}
}
// Extension content source
dp.src = extSrc;
dp.tagWidths = [endOffset() - tsr0, endTagWidth];
skipLen = extSrc.length - dp.tagWidths[0] - dp.tagWidths[1];
// If the xml-tag is a known installed (not native) extension,
// skip the end-tag as well.
if (isInstalledExt) {
skipLen += endTagWidth;
}
break;
default:
console.assert(false, 'Should not be reachable.');
}
peg$currPos += skipLen;
if (isInstalledExt) {
// update tsr[1] to span the start and end tags.
dp.tsr[1] = endOffset(); // was just modified above
return new SelfclosingTagTk('extension', [
new KV('typeof', 'mw:Extension'),
new KV('name', tagName),
new KV('about', env.newAboutId()),
new KV('source', dp.src),
new KV('options', t.attribs),
], dp);
} else if (isIncludeTag) {
// Parse ext-content, strip eof, and shift tsr
var extContent = dp.src.substring(dp.tagWidths[0], dp.src.length - dp.tagWidths[1]);
var extContentToks = (new PegTokenizer(env)).tokenizeSync(extContent);
if (dp.tagWidths[1] > 0) {
extContentToks = Util.stripEOFTkfromTokens(extContentToks);
}
Util.shiftTokenTSR(extContentToks, dp.tsr[0] + dp.tagWidths[0]);
return [t].concat(extContentToks);
} else {
console.assert(false, 'Should not be reachable.');
}
};
}
/*********************************************************
* The top-level rule
*********************************************************/
start "start"
= tlb* newlineToken* {
// end is passed inline as a token, as well as a separate event for now.
emitChunk([ new EOFTk() ]);
return true;
}
/*
* Redirects can only occur as the first thing in a document. See
* WikitextContent::getRedirectTarget()
*/
redirect
= rw:redirect_word
sp:$space_or_newline*
c:$(":" space_or_newline*)?
wl:wikilink & {
return wl.length === 1 && wl[0] && wl[0].constructor !== String;
} {
var link = wl[0];
if (sp) { rw += sp; }
if (c) { rw += c; }
// Build a redirect token
var redirect = new SelfclosingTagTk('mw:redirect',
// Put 'href' into attributes so it gets template-expanded
[Util.lookupKV(link.attribs, 'href')],
{
src: rw,
tsr: tsrOffsets(),
linkTk: link,
});
return redirect;
}
// These rules are exposed as start rules.
generic_newline_attributes "generic_newline_attributes" = generic_newline_attribute*
table_attributes "table_attributes"
= (table_attribute / optionalSpaceToken b:broken_table_attribute_name_char { return b; })*
/* The 'redirect' magic word.
* The leading whitespace allowed is due to the PHP trim() function.
*/
redirect_word
= $([ \t\n\r\0\x0b]*
rw:$(!space_or_newline ![:\[] .)+
& { return env.conf.wiki.getMagicWordMatcher('redirect').test(rw); })
/*
* This rule exists to support tokenizing the document in chunks.
* The parser's streaming interface will stop tokenization after each iteration
* of the starred subexpression, and yield to the node.js event-loop to
* schedule other pending event handlers.
*/
start_async
= (tlb
/ newlineToken* &{
if (endOffset() === input.length) {
emitChunk([ new EOFTk() ]);
}
// terminate the loop
return false;
}
)*
/*
* A document (start rule) is a sequence of toplevelblocks. Tokens are
* emitted in chunks per toplevelblock to avoid buffering the full document.
*/
tlb "tlb"
= !eof b:block {
// Clear the tokenizer's backtracking cache after matching each
// toplevelblock. There won't be any backtracking as a document is just a
// sequence of toplevelblocks, so the cache for previous toplevelblocks
// will never be needed.
var end = startOffset();
for (; prevOffset < end; prevOffset++) {
peg$cache[prevOffset] = undefined;
}
var tokens;
if (Array.isArray(b) && b.length) {
tokens = tu.flattenIfArray(b);
} else if (b && b.constructor === String) {
tokens = [b];
}
// Emit tokens for this toplevelblock. This feeds a chunk to the parser pipeline.
if (tokens) {
emitChunk(tokens);
}
// We don't return any tokens to the start rule to save memory. We
// just emitted them already to our consumers.
return true;
}
/*
* The actual contents of each block.
*/
block
// has to be first alternative; otherwise gets parsed as a <ol>
= &sof r:redirect cil:comment_or_includes bl:block_line? { return [r].concat(cil, bl || []); }
/ block_lines
/ & '<' rs:( c:comment &eolf { return c; }
// avoid a paragraph if we know that the line starts with a block tag
/ bt:block_tag
) { return rs; }
/ paragraph
// Inlineline includes generic tags; wrapped into paragraphs in token
// transform and DOM postprocessor
/ inlineline
/ s:sol !inline_breaks { return s; }
/*
* A block nested in other constructs. Avoid eating end delimiters for other
* constructs by checking against inline_breaks first.
*/
nested_block = !inline_breaks b:block { return b; }
/*
* The same, but suitable for use inside a table construct.
* Doesn't match table_heading_tag, table_row_tag, table_data_tag,
* table_caption tag, or table_end_tag, although it does allow
* table_start_tag (for nested tables).
*/
nested_block_in_table
=
// avoid recursion via nested_block_in_table, as that can lead to stack
// overflow in large tables
// See https://phabricator.wikimedia.org/T59670
& { return stops.push('tableDataBlock', true); }
// XXX: don't rely on a lame look-ahead like this; use syntax stops
// instead, so that multi-line th content followed by a line prefixed with
// a comment is also handled. Alternatively, implement a sol look-behind
// assertion accepting spaces and comments.
!(sol (space* sol)? space* (pipe / "!")) b:nested_block {
stops.pop('tableDataBlock');
return b;
}
/ & { return stops.pop('tableDataBlock'); }
/*
* Line-based block constructs.
*/
block_lines
= s:sol
// eat an empty line before the block
s2:(os:optionalSpaceToken so:sol { return os.concat(so); })?
bl:block_line {
return s.concat(s2 || [], bl);
}
// Horizontal rules
hr =
"----" d:"-"*
// Check if a newline or content follows
lineContent:( &sol "" { return undefined; } / "" { return true; } ) {
var dataAttribs = {
tsr: tsrOffsets(),
lineContent: lineContent,
};
if (d.length > 0) {
dataAttribs.extra_dashes = d.length;
}
return new SelfclosingTagTk('hr', [], dataAttribs);
}
/*
* Block structures with start-of-line wiki syntax
*/
block_line
= heading
/ list_item
/ hr
/ st:space_or_newline*
r:( & [ <{}|!] tl:table_line { return tl; }
// tag-only lines should not trigger pre either
/ bts:(bt:block_tag stl:optionalSpaceToken { return bt.concat(stl); })+
&eolf { return bts; }
) {
return st.concat(r);
}
/*
* A paragraph. We don't emit 'p' tokens to avoid issues with template
* transclusions, <p> tags in the source and the like. Instead, we perform
* some paragraph wrapping on the token stream and the DOM.
*/
paragraph
= s1:sol s2:sol c:inlineline {
return s1.concat(s2, c);
}
br = s:optionalSpaceToken &newline {
return s.concat([
new SelfclosingTagTk('br', [], { tsr: tsrOffsets() }),
]);
}
inline_breaks
= & { return inlineBreaks(input, endOffset(), stops); }
inlineline
= c:(urltext
/ !inline_breaks
r:(inline_element / [^\r\n]) { return r; })+ {
return tu.flattenStringlist(c);
}
inline_element
= & '<' r:( xmlish_tag
/ comment
) { return r; }
/ & '{' r:tplarg_or_template { return r; }
/ & "-{" r:lang_variant_or_tpl { return r; }
// FIXME: The php parser's replaceInternalLinks2 splits on [[, resulting
// in sequences with odd number of brackets parsing as text, and sequences
// with even number of brackets having its innermost pair parse as a
// wikilink. For now, we faithfully reproduce what's found there but
// wikitext, the language, shouldn't be defined by odd tokenizing behaviour
// in the php parser. Flagging this for a future cleanup.
/ $('[[' &'[')+
/ & '[' r:( wikilink / extlink ) { return r; }
/ & "'" r:quote { return r; }
/* Headings */
heading = & "=" // guard, to make sure '='+ will match.
// XXX: Also check to end to avoid inline parsing?
r:(
& { return stops.inc('h'); }
s:$'='+ // moved in here to make s accessible to inner action
ce:(
(ill:inlineline? { return ill || []; })
$'='+
)?
& { return ce || s.length > 2; }
endTPos:("" { return endOffset(); })
spc:(spaces / comment)*
&eolf
{
var c;
var e;
var level;
stops.dec('h');
if (ce) {
c = ce[0];
e = ce[1];
level = Math.min(s.length, e.length);
} else {
// split up equal signs into two equal parts, with at least
// one character in the middle.
level = Math.floor((s.length - 1) / 2);
c = ['='.repeat(s.length - 2 * level)];
s = e = '='.repeat(level);
}
level = Math.min(6, level);
// convert surplus equals into text
if (s.length > level) {
var extras1 = s.substr(0, s.length - level);
if (c[0].constructor === String) {
c[0] = extras1 + c[0];
} else {
c.unshift(extras1);
}
}
if (e.length > level) {
var extras2 = e.substr(0, e.length - level);
var lastElem = lastItem(c);
if (lastElem.constructor === String) {
c[c.length - 1] += extras2;
} else {
c.push(extras2);
}
}
var tsr = tsrOffsets('start');
tsr[1] += level;
return [
new TagTk('h' + level, [], { tsr: tsr }),
].concat(c, [
new EndTagTk('h' + level, [], { tsr: [endTPos - level, endTPos] }),
spc,
]);
}
/ & { stops.dec('h'); return false; }
) { return r; }
/* Comments */
// The php parser does a straight str.replace(/<!--((?!-->).)*-->/g, "")
// but, as always, things around here are a little more complicated.
//
// We accept the same comments, but because we emit them as HTML comments
// instead of deleting them, we have to encode the data to ensure that
// we always emit a valid HTML5 comment. See the encodeComment helper
// for further details.
comment
= '<!--' c:$(!"-->" .)* ('-->' / eof) {
var data = DU.encodeComment(c);
return [new CommentTk(data, { tsr: tsrOffsets() })];
}
// Behavior switches. See:
// https://www.mediawiki.org/wiki/Help:Magic_words#Behavior_switches
behavior_switch
= bs:$('__' behavior_text '__') {
if (env.conf.wiki.isMagicWord(bs)) {
return [
new SelfclosingTagTk('behavior-switch', [ new KV('word', bs) ],
{ tsr: tsrOffsets(), src: bs, magicSrc: bs }
),
];
} else {
return [ bs ];
}
}
// Instead of defining a charset, php's doDoubleUnderscore concats a regexp of
// all the language specific aliases of the behavior switches and then does a
// match and replace. Just be as permissive as possible and let the
// BehaviorSwitchPreprocessor back out of any overreach.
behavior_text = $( !'__' [^'"<~[{\n\r:;\]}|!=] )+
/**************************************************************
* External (bracketed and autolinked) links
**************************************************************/
autolink
= ! { return stops.onStack('extlink'); }
// this must be a word boundary, so previous character must be non-word
! { return /\w/.test(input[endOffset() - 1] || ''); }
r:(
// urllink, inlined
target:autourl {
var res = [new SelfclosingTagTk('urllink', [new KV('href', target)], { tsr: tsrOffsets() })];
return res;
}
/ autoref
/ isbn) { return r; }
extlink "extlink"
= ! { return stops.onStack('extlink'); } // extlink cannot be nested
r:(
"["
& { return stops.push('extlink', true); }
addr:(url_protocol urladdr / "")
target:(extlink_preprocessor_text / "")
& {
// Protocol must be valid and there ought to be at least one
// post-protocol character. So strip last char off target
// before testing protocol.
var flat = tu.flattenString([addr, target]);
if (Array.isArray(flat)) {
// There are templates present, alas.
return flat.length > 0;
}
return Util.isProtocolValid(flat.slice(0, -1), env);
}
sp:$( space / unispace )*
targetOff:( "" { return endOffset(); })
content:inlineline?
"]" {
stops.pop('extlink');
return [
new SelfclosingTagTk('extlink', [
new KV('href', tu.flattenString([addr, target])),
new KV('mw:content', content || ''),
new KV('spaces', sp),
], {
targetOff: targetOff,
tsr: tsrOffsets(),
contentOffsets: [targetOff, endOffset() - 1],
}),
];
}
/ "[" & { return stops.pop('extlink'); }
) { return r; }
autoref
= ref:('RFC' / 'PMID') sp:space_or_nbsp+ identifier:$[0-9]+ end_of_word
{
var base_urls = {
'RFC': 'https://tools.ietf.org/html/rfc%s',
'PMID': '//www.ncbi.nlm.nih.gov/pubmed/%s?dopt=Abstract',
};
return [
new SelfclosingTagTk('extlink', [
new KV('href', tu.sprintf(base_urls[ref], identifier)),
new KV('mw:content', tu.flattenString([ref, sp, identifier])),
new KV('typeof', 'mw:ExtLink/' + ref),
],
{ stx: "magiclink", tsr: tsrOffsets() }),
];
}
isbn
= 'ISBN' sp:space_or_nbsp+ isbn:(
[0-9]
(s:space_or_nbsp_or_dash &[0-9] { return s; } / [0-9])+
((space_or_nbsp_or_dash / "") [xX] / "")
) isbncode:(
end_of_word
{
// Convert isbn token-and-entity array to stripped string.
return tu.flattenStringlist(isbn).filter(function(e) {
return e.constructor === String;
}).join('').replace(/[^\dX]/ig, '').toUpperCase();
}
) &{
// ISBNs can only be 10 or 13 digits long (with a specific format)
return isbncode.length === 10 ||
(isbncode.length === 13 && /^97[89]/.test(isbncode));
} {
return [
new SelfclosingTagTk('extlink', [
new KV('href', 'Special:BookSources/' + isbncode),
new KV('mw:content', tu.flattenString(['ISBN', sp, isbn])),
new KV('typeof', 'mw:WikiLink/ISBN'),
],
{ stx: "magiclink", tsr: tsrOffsets() }),
];
}
/* Default URL protocols in MediaWiki (see DefaultSettings). Normally
* these can be configured dynamically. */
url_protocol =
& { return Util.isProtocolValid(input.substr(endOffset()), env); }
p:$( '//' / [A-Za-z] [-A-Za-z0-9+.]* ':' '//'? ) { return p; }
// no punctuation, and '{<' to trigger directives
no_punctuation_char = [^ :\]\[\r\n"'<>\x00-\x20\x7f,.&%\u00A0\u1680\u180E\u2000-\u200A\u202F\u205F\u3000{]
// this is the general url rule
// on the PHP side, the path part matches EXT_LINK_URL_CLASS
// which is '[^][<>"\\x00-\\x20\\x7F\p{Zs}]'
// the 's' and 'r' pieces below match the characters in
// EXT_LINK_URL_CLASS which aren't included in no_punctuation_char
url "url"
= proto:url_protocol
addr:(urladdr / "")
path:( ( !inline_breaks
c:no_punctuation_char
{ return c; }
)
/ s:[.:,'] { return s; }
/ comment
/ tplarg_or_template
/ ! ( "&" ( [lL][tT] / [gG][tT] ) ";" )
r:(
& "&" he:htmlentity { return he; }
/ [&%{]
) { return r; }
)*
// Must be at least one character after the protocol
& { return addr.length > 0 || path.length > 0; }
{
return tu.flattenString([proto, addr].concat(path));
}
// this is the somewhat-restricted rule used in autolinks
// See Parser::doMagicLinks and Parser.php::makeFreeExternalLink.
// The `path` portion matches EXT_LINK_URL_CLASS, as in the general
// url rule. As in PHP, we do some fancy fixup to yank out
// trailing punctuation, perhaps including parentheses.
// The 's' and 'r' pieces match the characters in EXT_LINK_URL_CLASS
// which aren't included in no_punctuation_char
autourl
= &{ return stops.push('autourl', { sawLParen: false }); }
! '//' // protocol-relative autolinks not allowed (T32269)
r:(
proto:url_protocol
addr:(urladdr / "")
path:( ( !inline_breaks
! "("
c:no_punctuation_char
{ return c; }
)
/ "(" { stops.onStack('autourl').sawLParen = true; return "("; }
/ [.:,]
/ $(['] ![']) // single quotes are ok, double quotes are bad
/ comment
/ tplarg_or_template
/ ! ( rhe:raw_htmlentity &{ return /^[<>\u00A0]$/.test(rhe); } )
r:(
& "&" he:htmlentity { return he; }
/ [&%{]
) { return r; }
)*
{
// as in Parser.php::makeFreeExternalLink, we're going to
// yank trailing punctuation out of this match.
var url = tu.flattenStringlist([proto, addr].concat(path));
// only need to look at last element; HTML entities are strip-proof.
var last = lastItem(url);
var trim = 0;
if (last && last.constructor === String) {
var strip = ',;\\.:!?';
if (!stops.onStack('autourl').sawLParen) {
strip += ')';
}
strip = new RegExp('[' + JSUtils.escapeRegExp(strip) + ']*$');
trim = strip.exec(last)[0].length;
url[url.length - 1] = last.slice(0, last.length - trim);
}
url = tu.flattenStringlist(url);
if (url.length === 1 && url[0].constructor === String && url[0].length <= proto.length) {
return null; // ensure we haven't stripped everything: T106945
}
peg$currPos -= trim;
stops.pop('autourl');
return url;
} ) &{ return r !== null; } {return r; }
/ &{ return stops.pop('autourl'); }
// This is extracted from EXT_LINK_ADDR in Parser.php: a simplified
// expression to match an IPv6 address. The IPv4 address and "at least
// one character of a host name" portions are punted to the `path`
// component of the `autourl` and `url` productions
urladdr
= $( "[" [0-9A-Fa-f:.]+ "]" )
/**************************************************************
* Templates, -arguments and wikilinks
**************************************************************/
/*
* Precedence: template arguments win over templates. See
* http://www.mediawiki.org/wiki/Preprocessor_ABNF#Ideal_precedence
* 4: {{{{·}}}} → {·{{{·}}}·}
* 5: {{{{{·}}}}} → {{·{{{·}}}·}}
* 6: {{{{{{·}}}}}} → {{{·{{{·}}}·}}}
* 7: {{{{{{{·}}}}}}} → {·{{{·{{{·}}}·}}}·}
* This is only if close has > 3 braces; otherwise we just match open
* and close as we find them.
*/
tplarg_or_template
= &'{{' &{
// Refuse to recurse beyond `maxDepth` levels. Default in the PHP parser
// is $wgMaxTemplateDepth = 40; This is to prevent crashing from
// buggy wikitext with lots of unclosed template calls, as in
// eswiki/Usuario:C%C3%A1rdenas/PRUEBAS?oldid=651094
if (stops.onCount('templatedepth') === undefined ||
stops.onCount('templatedepth') < env.conf.parsoid.maxDepth) {
return true;
} else {
return false;
}
} t:tplarg_or_template_guarded { return t; }
tplarg_or_template_guarded
= &{ return stops.inc('templatedepth'); }
r:( &('{{' &('{{{'+ !'{') tplarg) a:(template/broken_template) { return a; }
/ a:$('{' &('{{{'+ !'{'))? b:tplarg { return [a].concat(b); }
/ a:$('{' &('{{' !'{'))? b:template { return [a].concat(b); }
/ a:broken_template { return a; }
) {
stops.dec('templatedepth');
return r;
}
/ & { return stops.dec('templatedepth'); }
tplarg_or_template_or_bust "tplarg_or_template_or_bust"
= r:(tplarg_or_template / .)+ { return tu.flattenIfArray(r); }
template
= stopLen:("" { return stops.push('preproc', /* {{ */'}}'); })
t:( template_preproc / &{ return stops.popTo('preproc', stopLen); } )
{ stops.popTo('preproc', stopLen); return t; }
// The PHP preprocessor maintains a single stack of "closing token we
// are currently looking for", with no backtracking. This means that
// once you see `[[ {{` you are looking only for `}}` -- if that template
// turns out to be broken you will never pop the `}}` and there is no way
// to close the `[[`. Since the PEG tokenizer in Parsoid uses backtracking
// and parses in a single pass (instead of PHP's split preprocessor/parser)
// we have to be a little more careful when we emulate this behavior.
// If we use a rule like:
// template = "{{" tplname tplargs* "}}"?
// Then we end up having to reinterpret `tplname tplargs*` as a tlb if it
// turns out we never find the `}}`, which involves a lot of tedious gluing
// tokens back together with fingers crossed we haven't discarded any
// significant newlines/whitespace/etc. An alternative would be a rule like:
// broken_template = "{{" tlb
// but again, `template` is used in many different contexts; `tlb` isn't
// necessarily the right one to recursively invoke. Instead we get the
// broken template off of the PEGjs production stack by returning immediately
// after `{{`, but we leave a "broken token" on top of the preprocessor
// stops stack to indicate we're "still in" the {{ context and shouldn't
// ever inlineBreak for any closing tokens above this one. For example:
// [[Foo{{Bar]]
// This will match as:
// wikilink->text,template->text --> FAILS looking for }}
// backtracks, popping "]]" and "}}" off preproc stack
// wikilink->text,broken_template,text --> FAILS looking for ]]
// backtracks, popping "]]" and "broken" off preproc stack
// broken_wikilink,text,broken_template,text --> OK
// with ["broken", "broken"] left on the preproc stops stack
// Note that we use stops.popTo() to make sure the preproc stack is
// cleaned up properly during backtracking, even if there were broken-FOO
// productions taken which (deliberately) left elements on the preproc stack.
broken_template
= &"{{" &{ return stops.push('preproc', 'broken'); }
// for broken-template, deliberately fail to pop the preproc stops stack
t:"{{" { return t; }
template_preproc
= "{{" nl_comment_space*
target:template_param_value
params:(nl_comment_space* "|"
r:( p0:("" { return endOffset(); })
v:nl_comment_space*
p:("" { return endOffset(); })
&("|" / "}}")
{ return new KV('', tu.flattenIfArray(v), [p0, p0, p0, p]); } // empty argument
/ template_param
) { return r; }
)*
nl_comment_space*
inline_breaks "}}" {
// Insert target as first positional attribute, so that it can be
// generically expanded. The TemplateHandler then needs to shift it out
// again.
params.unshift(new KV(tu.flattenIfArray(target.tokens), '', target.srcOffsets));
var obj = new SelfclosingTagTk('template', params, { tsr: tsrOffsets(), src: text() });
return obj;
} / $('{{' space_or_newline* '}}')
tplarg
= stopLen:("" { return stops.push('preproc', /* {{ */'}}'); })
t:(tplarg_preproc / &{ return stops.popTo('preproc', stopLen); } )
{ stops.popTo('preproc', stopLen); return t; }
tplarg_preproc
= "{{{"
p:("" { return endOffset(); })
target:template_param_value?
params:(nl_comment_space* "|"
r:( p0:("" { return endOffset(); })
v:nl_comment_space*
p1:("" { return endOffset(); })
&("|" / "}}}")
{ return { tokens: v, srcOffsets: [p0, p1] }; } // empty argument
/ template_param_value
) { return r; }
)*
nl_comment_space*
inline_breaks "}}}" {
params = params.map(function(o) {
var s = o.srcOffsets;
return new KV('', tu.flattenIfArray(o.tokens), [s[0], s[0], s[0], s[1]]);
});
if (target === null) { target = { tokens: '', srcOffsets: [p, p, p, p] }; }
// Insert target as first positional attribute, so that it can be
// generically expanded. The TemplateHandler then needs to shift it out
// again.
params.unshift(new KV(tu.flattenIfArray(target.tokens), '', target.srcOffsets));
var obj = new SelfclosingTagTk('templatearg', params, { tsr: tsrOffsets(), src: text() });
return obj;
}
template_param
= name:template_param_name
val:(
kEndPos:("" { return endOffset(); })
optionalSpaceToken
"="
vStartPos:("" { return endOffset(); })
optionalSpaceToken
tpv:template_param_value? {
return { kEndPos: kEndPos, vStartPos: vStartPos, value: (tpv && tpv.tokens) || [] };
}
)? {
if (val !== null) {
if (val.value !== null) {
return new KV(name, tu.flattenIfArray(val.value), [startOffset(), val.kEndPos, val.vStartPos, endOffset()]);
} else {
return new KV(tu.flattenIfArray(name), '', [startOffset(), val.kEndPos, val.vStartPos, endOffset()]);
}
} else {
return new KV('', tu.flattenIfArray(name), [startOffset(), startOffset(), startOffset(), endOffset()]);
}
}
// empty parameter
/ & [|}] {
return new KV('', '', [startOffset(), startOffset(), startOffset(), endOffset()]);
}
template_param_name
= & { return stops.push('equal', true); }
tpt:(template_param_text / &'=' { return ''; })
{
stops.pop('equal');
return tpt;
}
/ & { return stops.pop('equal'); }
template_param_value
= & { return stops.push('equal', false); }
tpt:template_param_text
{
stops.pop('equal');
return { tokens: tpt, srcOffsets: tsrOffsets() };
}
/ & { return stops.pop('equal'); }
template_param_text
= & { // re-enable tables within template parameters
stops.push('table', false);
stops.push('extlink', false);
stops.push('templateArg', true);
stops.push('tableCellArg', false);
return stops.inc('template');
}
il:(nested_block / newlineToken)+ {
stops.pop('table');
stops.pop('extlink');
stops.pop('templateArg');
stops.pop('tableCellArg');
stops.dec('template');
// il is guaranteed to be an array -- so, tu.flattenIfArray will
// always return an array
var r = tu.flattenIfArray(il);
if (r.length === 1 && r[0].constructor === String) {
r = r[0];
}
return r;
}
/ & { stops.pop('table');
stops.pop('extlink');
stops.pop('templateArg');
stops.pop('tableCellArg');
return stops.dec('template');
}
//// Language converter block markup of language variants: -{ ... }-
// Note that "rightmost opening" precedence rule (see
// https://www.mediawiki.org/wiki/Preprocessor_ABNF ) means
// that neither -{{ nor -{{{ are parsed as a -{ token, although
// -{{{{ is (since {{{ has precedence over {{).
lang_variant_or_tpl
= &('-{' &('{{{'+ !'{') tplarg) a:lang_variant { return a; }
/ a:$('-' &('{{{'+ !'{')) b:tplarg { return [a].concat(b); }
/ a:$('-' &('{{' '{{{'* !'{')) b:template { return [a].concat(b); }
/ &'-{' a:lang_variant { return a; }
broken_lang_variant
= &{ return stops.push('preproc', 'broken'); }
// for broken-lang-variant, deliberately fail to pop the stops stack
r:"-{" { return r; }
lang_variant
= stopLen:("" { return stops.push('preproc', /* -{ */ '}-'); })
lv:(lang_variant_preproc / &{ return stops.popTo('preproc', stopLen); })
{ stops.popTo('preproc', stopLen); return lv; }
/ broken_lang_variant
lang_variant_preproc
= lv0:("-{" { return startOffset(); })
f:(
&{ return env.langConverterEnabled(); }
ff:opt_lang_variant_flags {
// Avoid mutating cached expression results
ff = Util.clone(ff, true);
// if flags contains 'R', then don't treat ; or : specially inside.
if (ff.flags) {
ff.raw = ff.flags.has('R') || ff.flags.has('N');
} else if (ff.variants) {
ff.raw = true;
}
return ff;
} /
&{ return !env.langConverterEnabled(); }
"" {
// if language converter not enabled, don't try to parse inside.
return { raw: true };
}
)
ts:(
&{ return f.raw; } lv:lang_variant_text { return [{ text: lv }]; }
/
&{ return !f.raw; } lv:lang_variant_option_list { return lv; }
)
inline_breaks
lv1:("}-" { return endOffset(); }) {
if (!env.langConverterEnabled()) {
return [ "-{", ts[0].text.tokens, "}-" ];
}
var lvsrc = input.substring(lv0, lv1);
var attribs = [];
// Do a deep clone since we may be destructively modifying
// (the `t[fld] = name;` below) the result of a cached expression
ts = Util.clone(ts, true);
ts.forEach(function(t) {
// move token strings into KV attributes so that they are
// properly expanded by early stages of the token pipeline
['text','from','to'].forEach(function(fld) {
if (t[fld] === undefined) { return; }
var name = 'mw:lv' + attribs.length;
attribs.push(new KV(name, t[fld].tokens, t[fld].srcOffsets));
t[fld] = name;
});
});
return [
new SelfclosingTagTk(
'language-variant',
attribs,
{
tsr: [lv0, lv1],
src: lvsrc,
flags: f.flags && Array.from(f.flags).sort(),
variants: f.variants && Array.from(f.variants).sort(),
original: f.original,
flagSp: f.sp,
texts: ts,
}),
];
}
opt_lang_variant_flags
= f:( ff:lang_variant_flags "|" { return ff; } )? {
// Collect & separate flags and variants into a set and ordered list
var flags = new Set();
var variants = new Set();
var flagList = [];
var flagSpace = [];
var variantList = [];
var variantSpace = [];
var useVariants = false;
var internalSp = []; // internal whitespace, for round-tripping
if (f !== null) {
// lang_variant_flags returns arrays in reverse order.
f.flags.reverse();
f.sp.reverse();
var spPtr = 0;
f.flags.forEach(function(item) {
if (item.flag) {
flagSpace.push(f.sp[spPtr++]);
flags.add(item.flag);
flagList.push(item.flag);
flagSpace.push(f.sp[spPtr++]);
}
if (item.variant) {
variantSpace.push(f.sp[spPtr++]);
variants.add(item.variant);
variantList.push(item.variant);
variantSpace.push(f.sp[spPtr++]);
}
});
if (spPtr < f.sp.length) {
// handle space after a trailing semicolon
flagSpace.push(f.sp[spPtr]);
variantSpace.push(f.sp[spPtr]);
}
}
// Parse flags (this logic is from core/languages/ConverterRule.php
// in the parseFlags() function)
if (flags.size === 0 && variants.size === 0) {
flags.add('$S');
} else if (flags.has('R')) {
flags = new Set(['R']); // remove other flags
} else if (flags.has('N')) {
flags = new Set(['N']); // remove other flags
} else if (flags.has('-')) {
flags = new Set(['-']); // remove other flags
} else if (flags.has('T') && flags.size === 1) {
flags.add('H');
} else if (flags.has('H')) {
// Replace A flag, and remove other flags except T and D
var nf = new Set(['$+', 'H']);
if (flags.has('T')) { nf.add('T'); }
if (flags.has('D')) { nf.add('D'); }
flags = nf;
} else if (variants.size > 0) {
useVariants = true;
} else {
if (flags.has('A')) {
flags.add('$+');
flags.add('$S');
}
if (flags.has('D')) {
flags.delete('$S');
}
}
if (useVariants) {
return { variants: variants, original: variantList, sp: variantSpace };
} else {
return { flags: flags, original: flagList, sp: flagSpace };
}
}
lang_variant_flags
= sp1:(space_or_newline*) f:lang_variant_flag sp2:(space_or_newline*)
more:( ";" lang_variant_flags? )? {
var r = more && more[1] ? more[1] : { sp: [], flags: [] };
// Note that sp and flags are in reverse order, since we're using
// right recursion and want to push instead of unshift.
r.sp.push(sp2.join(''));
r.sp.push(sp1.join(''));
r.flags.push(f);
return r;
}
/ sp:(space_or_newline*) {
return { sp: [ sp.join('') ], flags: [] };
}
lang_variant_flag
= f:[-+A-Z] { return { flag: f }; }
/ v:lang_variant_name { return { variant: v }; }
/ b:(!space_or_newline !nowiki [^{}|;])+ { return { bogus: b.join('') }; /* bad flag */}
lang_variant_name // language variant name, like zh, zh-cn, etc.
= h:[a-z] t:[-a-z]+ { return h + t.join(''); }
// Escaped otherwise-unrepresentable language names
// Primarily for supporting html2html round trips; PHP doesn't support
// using nowikis here (yet!)
/ nowiki_text
lang_variant_option_list
= o:lang_variant_option rest:( ";" oo:lang_variant_option { return oo; })*
tr:( ";" space_or_newline* )? // optional trailing semicolon
{
var r = [ o ].concat(rest);
if (tr) { r.push({ semi: true, sp: tr[1].join('') }); }
return r;
}
/ lvtext:lang_variant_text { return [{ text: lvtext }]; }
lang_variant_option
= sp1:(space_or_newline*) lang:lang_variant_name
sp2:(space_or_newline*) ":"
sp3:(space_or_newline*)
lvtext:(lang_variant_nowiki / lang_variant_text_no_semi)
{
return {
twoway: true,
lang: lang,
text: lvtext,
sp: [sp1.join(''), sp2.join(''), sp3.join('')]
};
}
/ sp1:(space_or_newline*)
from:(lang_variant_nowiki / lang_variant_text_no_semi_or_arrow)
"=>"
sp2:(space_or_newline*) lang:lang_variant_name
sp3:(space_or_newline*) ":"
sp4:(space_or_newline*)
to:(lang_variant_nowiki / lang_variant_text_no_semi)
{
return {
oneway: true,
from: from,
lang: lang,
to: to,
sp: [sp1.join(''), sp2.join(''), sp3.join(''), sp4.join('')]
};
}
// html2wt support: If a language name or conversion string can't be
// represented w/o breaking wikitext, just wrap it in a <nowiki>.
// PHP doesn't support this (yet), but Parsoid does.
lang_variant_nowiki
= start:("" {return startOffset();})
n:nowiki_text
end:("" { return endOffset();})
space_or_newline* {
return { tokens: [ n ], srcOffsets: [start, end] };
}
lang_variant_text
= start:("" {return startOffset();})
tokens:(inlineline / "|" )*
end:("" {return endOffset();})
{ return { tokens: tokens || [], srcOffsets: [start, end] }; }
lang_variant_text_no_semi
= & { return stops.push('semicolon', true); }
lvtext:lang_variant_text
{ stops.pop('semicolon'); return lvtext; }
/ & { return stops.pop('semicolon'); }
lang_variant_text_no_semi_or_arrow
= & { return stops.push('arrow', true); }
lvtext:lang_variant_text_no_semi { stops.pop('arrow'); return lvtext; }
/ & { return stops.pop('arrow'); }
wikilink_content
= ( pipe startPos:("" { return endOffset(); }) lt:link_text? {
var maybeContent = new KV('mw:maybeContent', lt, [startPos, endOffset()]);
maybeContent.vsrc = input.substring(startPos, endOffset());
return maybeContent;
} )*
wikilink
= stopLen:("" { return stops.push('preproc', ']]'); })
w:(wikilink_preproc / &{ return stops.popTo('preproc', stopLen); })
{ stops.popTo('preproc', stopLen); return w; }
/ broken_wikilink
// `broken-link` (see [[:mw:Preprocessor_ABNF]]), but careful because the
// second bracket could start an extlink. Deliberately leave entry
// on preproc stack since we haven't seen a double-close bracket.
// (See full explanation above broken_template production.)
broken_wikilink
= &"[[" &{ return stops.push('preproc', 'broken'); }
a:("[" (extlink / "[")) { return a; }
wikilink_preproc
= "[["
target:wikilink_preprocessor_text?
tpos:("" { return endOffset(); })
lcs:wikilink_content
inline_breaks "]]"
{
var pipeTrick = (lcs.length === 1 && lcs[0].v === null);
var textTokens = [];
if (target === null || pipeTrick) {
textTokens.push("[[");
if (target) {
textTokens.push(target);
}
lcs.forEach(function(a) {
// a is a mw:maybeContent attribute
textTokens.push("|");
if (a.v !== null) { textTokens.push(a.v); }
});
textTokens.push("]]");
return textTokens;
}
var obj = new SelfclosingTagTk('wikilink');
var hrefKV = new KV('href', target);
hrefKV.vsrc = input.substring(startOffset() + 2, tpos);
// XXX: Point to object with path, revision and input information
// obj.source = input;
obj.attribs.push(hrefKV);
obj.attribs = obj.attribs.concat(lcs);
obj.dataAttribs = {
tsr: tsrOffsets(),
src: text(),
};
return [obj];
}
// Tables are allowed inside image captions.
link_text
= & {
// Suppress the flag temporarily in this rule to consume the '=' here.
stops.push('equal', false);
return stops.push('linkdesc', true);
}
c:( // This group is similar to "block_line" but "list_item"
// is omitted since `doBlockLevels` happens after
// `replaceInternalLinks2`, where newlines are stripped.
(sol (heading / hr / full_table_in_link_caption))
/ urltext
/ (!inline_breaks
r:( inline_element / '[' text_char+ ']' $(&(!']' / ']]')) / . ) { return r; }
)
)+ {
stops.pop('equal');
stops.pop('linkdesc');
return tu.flattenStringlist(c);
}
/ & { stops.pop('equal'); return stops.pop('linkdesc'); }
/* Generic quote rule for italic and bold, further processed in a token
* stream transformation in doQuotes. Relies on NlTk tokens being emitted
* for each line of text to balance quotes per line.
*
* We are not using a simple pair rule here as we need to support mis-nested
* bolds/italics and MediaWiki's special heuristics for apostrophes, which are
* all not context free. */
quote = quotes:$("''" "'"*) {
// sequences of four or more than five quotes are assumed to start
// with some number of plain-text apostrophes.
var plainticks = 0;
var result = [];
if (quotes.length === 4) {
plainticks = 1;
} else if (quotes.length > 5) {
plainticks = quotes.length - 5;
}
if (plainticks > 0) {
result.push(quotes.substring(0, plainticks));
}
// mw-quote token Will be consumed in token transforms
var tsr = tsrOffsets();
tsr[0] += plainticks;
var mwq = new SelfclosingTagTk('mw-quote', [], { tsr: tsr });
mwq.value = quotes.substring(plainticks);
result.push(mwq);
return result;
}
/***********************************************************
* Pre and xmlish tags
***********************************************************/
extension_tag =
&{ return !stops.onStack('extTag'); }
extToken:xmlish_tag
// Account for `maybeExtensionTag` returning unmatched start / end tags
&{ return extToken.name === 'extension'; }
{ return extToken; }
nowiki
= extToken:extension_tag
&{ return extToken.getAttribute('name') === 'nowiki'; }
{ return extToken; }
// Used by nowiki extension to tokenize html entities.
nowiki_content "nowiki_content"
= c:(htmlentity / .)* { return tu.flattenIfArray(c); }
// Used by lang_variant productions to protect special language names or
// conversion strings.
nowiki_text
= extToken:nowiki
{
var txt = Util.getExtArgInfo(extToken).dict.body.extsrc;
return Util.decodeEntities(txt);
}
/* Generic XML-like tags
*
* These also cover extensions (including Cite), which will hook into the
* token stream for further processing. The content of extension tags is
* parsed as regular inline, but the source positions of the tag are added
* to allow reconstructing the unparsed text from the input. */
// See http://www.w3.org/TR/html5/syntax.html#tag-open-state and
// following paragraphs.
tag_name_chars = [^\t\n\v />\0]
tag_name = $([A-Za-z] tag_name_chars*)
+// This rule is used in carefully crafted places of xmlish tag tokenizing with
+// the inclusion of solidus to match where the spec would ignore those
+// characters. In particular, it does not belong in between attribute name
+// and value.
+space_or_newline_or_solidus = space_or_newline / (s:"/" !">" { return s; })
+
xmlish_tag
= & {
// By the time we get to `doTableStuff` in the php parser, we've already
// safely encoded element attributes. See 55313f4e in core.
stops.push('table', false);
stops.push('tableCellArg', false);
return true;
}
"<" end:"/"?
name:$(tn:tag_name & {
return isXMLTag(tn, false); // NOTE: 'extTag' stop was pushed.
})
attribs:generic_newline_attributes
- space_or_newline* // No need to preserve this -- canonicalize on RT via dirty diff
+ space_or_newline_or_solidus* // No need to preserve this -- canonicalize on RT via dirty diff
selfclose:"/"?
space* // not preserved - canonicalized on RT via dirty diff
">" {
stops.pop('table');
stops.pop('tableCellArg');
stops.pop('extTag');
var lcName = name.toLowerCase();
// Extension tags don't necessarily have the same semantics as html tags,
// so don't treat them as void elements.
var isVoidElt = Util.isVoidElement(lcName) && !env.conf.wiki.extensionTags.has(lcName);
// Support </br>
if (lcName === 'br' && end) {
end = null;
}
var res = tu.buildXMLTag(name, lcName, attribs, end, !!selfclose || isVoidElt, tsrOffsets());
// change up data-attribs in one scenario
// void-elts that aren't self-closed ==> useful for accurate RT-ing
if (!selfclose && isVoidElt) {
res.dataAttribs.selfClose = undefined;
res.dataAttribs.noClose = true;
}
return maybeExtensionTag(res);
}
/ "<" "/"? tag_name & { return stops.pop('extTag'); }
/ & { stops.pop('table'); return stops.pop('tableCellArg'); }
/*
* A variant of xmlish_tag, but also checks if the tag name is a block-level
* tag as defined in
* http://www.w3.org/TR/html5/syntax.html#tag-open-state and
* following paragraphs.
*/
block_tag
= & {
// By the time we get to `doTableStuff` in the php parser, we've already
// safely encoded element attributes. See 55313f4e in core.
stops.push('table', false);
stops.push('tableCellArg', false);
return true;
}
"<" end:"/"?
name:$(tn:tag_name & {
return isXMLTag(tn, true); // NOTE: 'extTag' stop was pushed.
})
attribs:generic_newline_attributes
- space_or_newline*
+ space_or_newline_or_solidus*
selfclose:"/"?
">" {
stops.pop('table');
stops.pop('tableCellArg');
stops.pop('extTag');
var t = tu.buildXMLTag(name, name.toLowerCase(), attribs, end, !!selfclose, tsrOffsets());
return [maybeExtensionTag(t)];
}
/ "<" "/"? tag_name & { return stops.pop('extTag'); }
/ & { stops.pop('table'); return stops.pop('tableCellArg'); }
// A generic attribute that can span multiple lines.
generic_newline_attribute
- = s:space_or_newline*
+ = space_or_newline_or_solidus*
namePos0:("" { return endOffset(); })
name:generic_attribute_name
namePos:("" { return endOffset(); })
vd:(space_or_newline* "=" v:generic_att_value? { return v; })?
{
// NB: Keep in sync w/ table_attibute
var res;
// Encapsulate protected attributes.
if (typeof name === 'string') {
name = tu.protectAttrs(name);
}
if (vd !== null) {
res = new KV(name, vd.value, [namePos0, namePos, vd.srcOffsets[0], vd.srcOffsets[1]]);
res.vsrc = input.substring(vd.srcOffsets[0], vd.srcOffsets[1]);
} else {
res = new KV(name, '', [namePos0, namePos, namePos, namePos]);
}
if (Array.isArray(name)) {
res.ksrc = input.substring(namePos0, namePos);
}
return res;
}
// A single-line attribute.
table_attribute
= s:optionalSpaceToken
namePos0:("" { return endOffset(); })
name:table_attribute_name
namePos:("" { return endOffset(); })
vd:(optionalSpaceToken "=" v:table_att_value? { return v; })?
{
// NB: Keep in sync w/ generic_newline_attribute
var res;
// Encapsulate protected attributes.
if (typeof name === 'string') {
name = tu.protectAttrs(name);
}
if (vd !== null) {
res = new KV(name, vd.value, [namePos0, namePos, vd.srcOffsets[0], vd.srcOffsets[1]]);
res.vsrc = input.substring(vd.srcOffsets[0], vd.srcOffsets[1]);
} else {
res = new KV(name, '', [namePos0, namePos, namePos, namePos]);
}
if (Array.isArray(name)) {
res.ksrc = input.substring(namePos0, namePos);
}
return res;
}
// The php parser's Sanitizer::removeHTMLtags explodes on < so that it can't
// be found anywhere in xmlish tags. This is a divergence from html5 tokenizing
// which happily permits it in attribute positions. Extension tags being the
// exception, since they're stripped beforehand.
less_than = $(&{ return stops.onStack('extTag'); } "<")
// The arrangement of chars is to emphasize the split between what's disallowed
// by html5 and what's necessary to give directive a chance.
// See: http://www.w3.org/TR/html5/syntax.html#attributes-0
generic_attribute_name
= q:$(["'=]?) // From #before-attribute-name-state, < is omitted for directive
r:( $[^ \t\r\n\0/=><&{}\-!|]+
/ !inline_breaks
// \0/=> is the html5 attribute name set we do not want.
t:( directive / less_than / !( space_or_newline / [\0/=><] ) c:. { return c; }
) { return t; }
)*
& { return r.length > 0 || q.length > 0; }
{ return tu.flattenString([q].concat(r)); }
// Also accept these chars in a wikitext table or tr attribute name position.
// They are normally not matched by the table_attribute_name.
broken_table_attribute_name_char = c:[\0/=>] { return new KV(c, ''); }
// Same as generic_attribute_name, except for accepting tags and wikilinks.
// (That doesn't make sense (ie. match php) in the generic case.)
// We also give a chance to break on \[ (see T2553).
table_attribute_name
= q:$(["'=]?) // From #before-attribute-name-state, < is omitted for directive
r:( $[^ \t\r\n\0/=><&{}\-!|\[]+
/ !inline_breaks
// \0/=> is the html5 attribute name set we do not want.
t:( $wikilink
/ directive
// Accept insane tags-inside-attributes as attribute names.
// The sanitizer will strip and shadow them for roundtripping.
// Example: <hiddentext>generated with.. </hiddentext>
/ &xmlish_tag ill:inlineline { return ill; }
/ !( space_or_newline / [\0/=>] ) c:. { return c; }
) { return t; }
)*
& { return r.length > 0 || q.length > 0; }
{ return tu.flattenString([q].concat(r)); }
// Attribute value, quoted variants can span multiple lines.
// Missing end quote: accept /> look-ahead as heuristic.
// These need to be kept in sync with the attribute_preprocessor_text_*
generic_att_value
= s:$(space_or_newline* "'") t:attribute_preprocessor_text_single? q:$("'" / &('/'? '>')) {
return tu.getAttrVal(t, startOffset() + s.length, endOffset() - q.length);
}
/ s:$(space_or_newline* '"') t:attribute_preprocessor_text_double? q:$('"' / &('/'? '>')) {
return tu.getAttrVal(t, startOffset() + s.length, endOffset() - q.length);
}
/ s:$space_or_newline* t:attribute_preprocessor_text &(space_or_newline / eof / '/'? '>') {
return tu.getAttrVal(t, startOffset() + s.length, endOffset());
}
// Attribute value, restricted to a single line.
// Missing end quote: accept |, !!, \r, and \n look-ahead as heuristic.
// These need to be kept in sync with the table_attribute_preprocessor_text_*
table_att_value
= s:$(space* "'") t:table_attribute_preprocessor_text_single? q:$("'" / &('!!' / [|\r\n])) {
return tu.getAttrVal(t, startOffset() + s.length, endOffset() - q.length);
}
/ s:$(space* '"') t:table_attribute_preprocessor_text_double? q:$('"' / &('!!' / [|\r\n])) {
return tu.getAttrVal(t, startOffset() + s.length, endOffset() - q.length);
}
/ s:$space* t:table_attribute_preprocessor_text &(space_or_newline/ eof / '!!' / '|') {
return tu.getAttrVal(t, startOffset() + s.length, endOffset());
}
/*********************************************************
* Lists
*********************************************************/
list_item = dtdd / hacky_dl_uses / li
li = bullets:list_char+
c:inlineline?
// The inline_break is to check if we've hit a template end delimiter.
&(eolf / inline_breaks)
{
// Leave bullets as an array -- list handler expects this
var tsr = tsrOffsets('start');
tsr[1] += bullets.length;
var li = new TagTk('listItem', [], { tsr: tsr });
li.bullets = bullets;
return [ li ].concat(c || []);
}
/*
* This rule is required to support wikitext of this form
* ::{|border="1"|foo|bar|baz|}
* where the leading colons are used to indent the entire table.
* This hack was added back in 2006 in commit
* a0746946312b0f1eda30a2c793f5f7052e8e5f3a based on a patch by Carl
* Fürstenberg.
*/
hacky_dl_uses = bullets:":"+
tbl:(table_line (sol table_line)*)
line:inlineline?
&comment_space_eolf
{
// Leave bullets as an array -- list handler expects this
var tsr = tsrOffsets('start');
tsr[1] += bullets.length;
var li = new TagTk('listItem', [], { tsr: tsr });
li.bullets = bullets;
return tu.flattenIfArray([li, tbl || [], line || []]);
}
dtdd
= bullets:(!(";" !list_char) lc:list_char { return lc; })*
";"
& {return stops.inc('colon');}
c:inlineline?
cpos:(":" { return endOffset(); })
// Fortunately dtdds cannot be nested, so we can simply set the flag
// back to 0 to disable it.
& { stops.counters.colon = 0; return true;}
d:inlineline?
&eolf {
// Leave bullets as an array -- list handler expects this
// TSR: +1 for the leading ";"
var numBullets = bullets.length + 1;
var tsr = tsrOffsets('start');
tsr[1] += numBullets;
var li1 = new TagTk('listItem', [], { tsr: tsr });
li1.bullets = bullets.slice();
li1.bullets.push(";");
// TSR: -1 for the intermediate ":"
var li2 = new TagTk('listItem', [], { tsr: [cpos - 1, cpos], stx: 'row' });
li2.bullets = bullets.slice();
li2.bullets.push(":");
return [ li1 ].concat(c || [], [ li2 ], d || []);
}
// Fall-back case to clear the colon flag
/ & { stops.counters.colon = 0; return false; }
list_char = [*#:;]
/******************************************************************************
* Tables
* ------
* Table rules are geared to support independent parsing of fragments in
* templates (the common table start / row / table end use case). The tokens
* produced by these fragments then match up to a table while building the
* DOM tree. For similar reasons, table rows do not emit explicit end tag
* tokens.
*
* The separate table_line rule is faster than moving those rules
* directly to block_lines.
*
* Notes about the full_table_in_link_caption rule
* -----------------------------------------------------
* However, for link-tables, we have introduced a stricter parse wherein
* we require table-start and table-end tags to not come from a template.
* In addition, this new rule doesn't accept fosterable-content in
* the table unlike the more lax (sol table_line)+ rule.
*
* This is the best we can do at this time since we cannot distinguish
* between table rows and image options entirely in the tokenizer.
*
* Consider the following examples:
*
* Example 1:
*
* [[Image:Foo.jpg|left|30px|Example 1
* {{This-template-returns-a-table-start-tag}}
* |foo
* {{This-template-returns-a-table-end-tag}}
* ]]
*
* Example 2:
*
* [[Image:Foo.jpg|left|30px|Example 1
* {{echo|a}}
* |foo
* {{echo|b}}
* ]]
*
* So, we cannot know a priori (without preprocessing or fully expanding
* all templates) if "|foo" in the two examples is a table cell or an image
* option. This is a limitation of our tokenizer-based approach compared to
* the preprocessing-based approach of the PHP parser.
*
* Given this limitation, we are okay forcing a full-table context in
* link captions (if necessary, we can relax the fosterable-content requirement
* but that is broken wikitext anyway, so we can force that edge-case wikitext
* to get fixed by rejecting it).
******************************************************************************/
full_table_in_link_caption
= (! inline_breaks / & '{{!}}' )
r:(
// Note that "linkdesc" is suppressed here to provide a nested parsing
// context in which to parse the table. Otherwise, we may break on
// on pipes in the `table_start_tag` and `table_row_tag` attributes.
// However, as a result, this can be more permissive than the current
// php implementation, but likelier to match the users intent.
& { stops.push('linkdesc', false); return stops.push('table', true); }
tbl:(
table_start_tag optionalNewlines
// Accept multiple end tags since a nested table may have been
// opened in the table content line.
((sol (table_content_line / tplarg_or_template) optionalNewlines)*
sol table_end_tag)+
){
stops.pop('linkdesc');
stops.pop('table');
return tbl;
}
/ & { stops.pop('linkdesc'); return stops.pop('table'); }
) { return r; }
// This rule assumes start-of-line position!
table_line
= (! inline_breaks / & '{{!}}' )
r:(
& { return stops.push('table', true); }
tl:(
table_start_tag optionalNewlines
/ table_content_line optionalNewlines
/ table_end_tag
) {
stops.pop('table');
return tl;
}
/ & { return stops.pop('table'); }
) { return r; }
table_content_line = (space / comment)* (
table_heading_tags
/ table_row_tag
/ table_data_tags
/ table_caption_tag
)
table_start_tag "table_start_tag"
= sc:(space / comment)* startPos:("" { return endOffset(); }) b:"{" p:pipe
// ok to normalize away stray |} on rt (see T59360)
& { return stops.push('table', false); }
ta:table_attributes
tsEndPos:("" { stops.pop('table'); return endOffset(); })
{
var coms = tu.popComments(ta);
if (coms) {
tsEndPos = coms.commentStartPos;
}
var da = { tsr: [startPos, tsEndPos] };
if (p !== "|") {
// Variation from default
da.startTagSrc = b + p;
}
sc.push(new TagTk('table', ta, da));
if (coms) {
sc = sc.concat(coms.buf);
}
return sc;
}
// FIXME: Not sure if we want to support it, but this should allow columns.
table_caption_tag
// avoid recursion via nested_block_in_table
= ! { return stops.onStack('tableDataBlock'); }
p:pipe "+"
args:row_syntax_table_args?
tagEndPos:("" { return endOffset(); })
c:nested_block_in_table* {
return tu.buildTableTokens("caption", "|+", args, [startOffset(), tagEndPos], endOffset(), c, true);
}
table_row_tag
= // avoid recursion via nested_block_in_table
! { return stops.onStack('tableDataBlock'); }
p:pipe dashes:$"-"+
& { return stops.push('table', false); }
a:table_attributes
tagEndPos:("" { stops.pop('table'); return endOffset(); })
{
var coms = tu.popComments(a);
if (coms) {
tagEndPos = coms.commentStartPos;
}
var da = {
tsr: [ startOffset(), tagEndPos ],
startTagSrc: p + dashes,
};
// We rely on our tree builder to close the row as needed. This is
// needed to support building tables from fragment templates with
// individual cells or rows.
var trToken = new TagTk('tr', a, da);
var res = [ trToken ];
if (coms) {
res = res.concat(coms.buf);
}
return res;
}
tds
= ( pp:( pipe_pipe / p:pipe & row_syntax_table_args { return p; } )
tdt:table_data_tag {
var da = tdt[0].dataAttribs;
da.stx = "row";
da.tsr[0] -= pp.length; // include "||"
if (pp !== "||" || (da.startTagSrc && da.startTagSrc !== pp)) {
// Variation from default
da.startTagSrc = pp + (da.startTagSrc ? da.startTagSrc.substring(1) : '');
}
return tdt;
}
)*
table_data_tags
// avoid recursion via nested_block_in_table
= ! { return stops.onStack('tableDataBlock'); }
p:pipe
![+-] td:table_data_tag
tagEndPos:("" { return endOffset(); })
tds:tds {
var da = td[0].dataAttribs;
da.tsr[0] -= p.length; // include "|"
if (p !== "|") {
// Variation from default
da.startTagSrc = p;
}
return td.concat(tds);
}
table_data_tag
= ! "}"
arg:row_syntax_table_args?
// use inline_breaks to break on tr etc
tagEndPos:("" { return endOffset(); })
td:nested_block_in_table*
{
return tu.buildTableTokens("td", "|", arg, [startOffset(), tagEndPos], endOffset(), td);
}
table_heading_tags
= "!"
& { return stops.push('th', endOffset()); }
th:table_heading_tag
ths:( pp:("!!" / pipe_pipe) tht:table_heading_tag {
var da = tht[0].dataAttribs;
da.stx = 'row';
da.tsr[0] -= pp.length; // include "!!" or "||"
if (pp !== "!!" || (da.startTagSrc && da.startTagSrc !== pp)) {
// Variation from default
da.startTagSrc = pp + (da.startTagSrc ? da.startTagSrc.substring(1) : '');
}
return tht;
}
)* {
stops.pop('th');
th[0].dataAttribs.tsr[0]--; // include "!"
return th.concat(ths);
}
/ & { return stops.onStack('th') !== false ? stops.pop('th') : false; }
table_heading_tag
= arg:row_syntax_table_args?
tagEndPos:("" { return endOffset(); })
c:( & {
// This SyntaxStop is only true until we hit the end of the line.
if (stops.onStack('th') !== false &&
/\n/.test(input.substring(stops.onStack('th'), endOffset()))) {
// There's been a newline. Remove the break and continue
// tokenizing nested_block_in_tables.
stops.pop('th');
}
return true;
} d:nested_block_in_table { return d; } )* {
return tu.buildTableTokens("th", "!", arg, [startOffset(), tagEndPos], endOffset(), c);
}
table_end_tag
= sc:(space / comment)* startPos:("" { return endOffset(); }) p:pipe b:"}" {
var tblEnd = new EndTagTk('table', [], { tsr: [startPos, endOffset()] });
if (p !== "|") {
// p+"<brace-char>" is triggering some bug in pegJS
// I cannot even use that expression in the comment!
tblEnd.dataAttribs.endTagSrc = p + b;
}
return sc.concat([tblEnd]);
}
/**
* Table parameters separated from the content by a single pipe. Does *not*
* match if followed by double pipe (row-based syntax).
*/
row_syntax_table_args
= & { return stops.push('tableCellArg', true); }
as:table_attributes s:space* p:pipe !pipe {
stops.pop('tableCellArg');
return [as, s, p];
}
/ & { return stops.pop('tableCellArg'); }
/*******************************************************************
* Text variants and other general rules
*******************************************************************/
/* All chars that cannot start syntactic structures in the middle of a line
* XXX: ] and other end delimiters should probably only be activated inside
* structures to avoid unnecessarily leaving the text rule on plain
* content.
*
* TODO: Much of this is should really be context-dependent (syntactic
* flags). The wikilink_preprocessor_text rule is an example where
* text_char is not quite right and had to be augmented. Try to minimize /
* clarify this carefully!
*/
text_char = [^-'<~[{\n\r:;\]}|!=]
/* Legend
* ' quotes (italic/bold)
* < start of xmlish_tag
* ~ signatures/dates
* [ start of links
* { start of parser functions, transclusion and template args
* \n all sort of block-level markup at start of line
* \r ditto
* A-Za-z autolinks (http(s), nttp(s), mailto, ISBN, PMID, RFC)
*
* _ behavior switches (e.g., '__NOTOC__') (XXX: not URL related)
* ! and | table cell delimiters, might be better to specialize those
* = headings - also specialize those!
*
* The following chars are also included for now, but only apply in some
* contexts and should probably be enabled only in those:
* : separate definition in ; term : definition
* ] end of link
* } end of parser func/transclusion/template arg
* - start of lang_variant -{ ... }-
* ; separator in lang_variant
*/
urltext = ( $[^-'<~[{\n/A-Za-z_|!:;\]} &=]+
/ & [/A-Za-z] al:autolink { return al; }
/ & "&" he:htmlentity { return he; }
// Convert trailing space into &nbsp;
// XXX: This should be moved to a serializer
// This is a hack to force a whitespace display before the colon
/ ' ' & ':' {
var toks = Util.placeholder('\u00a0', {
src: ' ',
tsr: tsrOffsets('start'),
isDisplayHack: true,
}, { tsr: tsrOffsets('end'), isDisplayHack: true });
var typeOf = toks[0].getAttribute('typeof');
toks[0].setAttribute('typeof', 'mw:DisplaySpace ' + typeOf);
return toks;
}
/ & ('__') bs:behavior_switch { return bs; }
// About 96% of text_char calls originate here.
// pegjs 0.8 inlines this simple rule automatically.
/ text_char )+
raw_htmlentity = m:$("&" [#0-9a-zA-Z]+ ";") {
return Util.decodeEntities(m);
}
htmlentity = cc:raw_htmlentity {
// if this is an invalid entity, don't tag it with 'mw:Entity'
if (cc.length > 2 /* decoded entity would be 1 or 2 UTF-16 characters */) {
return cc;
}
return [
new TagTk('span', [new KV('typeof', 'mw:Entity')], { src: text(), srcContent: cc, tsr: tsrOffsets('start') }),
cc,
new EndTagTk('span', [], { tsr: tsrOffsets('end') }),
];
}
spaces
= $[ \t]+
space = [ \t]
optionalSpaceToken
= s:$space* {
if (s.length) {
return [s];
} else {
return [];
}
}
/* This rule corresponds to \s in the PHP preg_* functions,
* which is used frequently in the PHP parser. The inclusion of
* form feed (but not other whitespace, like vertical tab) is a quirk
* of Perl, which PHP inherited via the PCRE (Perl-Compatible Regular
* Expressions) library.
*/
space_or_newline
= [ \t\n\r\x0c]
/* This rule corresponds to \b in the PHP preg_* functions,
* after a word character. That is, it's a zero-width lookahead that
* the next character is not a word character.
*/
end_of_word
= eof / ![A-Za-z0-9_]
// Unicode "separator, space" category. It covers the \u0020 space as well
// as \u3000 IDEOGRAPHIC SPACE (see bug 19052). In PHP this is \p{Zs}.
// Keep this up-to-date with the characters tagged ;Zs; in
// http://www.unicode.org/Public/UNIDATA/UnicodeData.txt
unispace = [ \u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]
// Non-newline whitespace, including non-breaking spaces. Used for magic links.
space_or_nbsp
= space // includes \t
/ unispace
/ he:htmlentity &{ return Array.isArray(he) && /^\u00A0$/.test(he[1]); }
{ return he; }
// Used within ISBN magic links
space_or_nbsp_or_dash
= space_or_nbsp / "-"
// Extra newlines followed by at least another newline. Usually used to
// compress surplus newlines into a meta tag, so that they don't trigger
// paragraphs.
optionalNewlines
= spc:$([\n\r\t ] &[\n\r])* {
if (spc.length) {
return [spc];
} else {
return [];
}
}
comment_or_includes = (comment / (
( & { return stops.push("sol_il", true); }
i:include_limits
& { stops.pop("sol_il"); return true; }
) { return i; }
/ & { return stops.pop("sol_il"); }
))*
sol = (empty_line_with_comments / sol_prefix) comment_or_includes
sol_prefix
= newlineToken
/ & {
// Use the sol flag only at the start of the input
// NOTE: Explicitly check for 'false' and not a falsy value
return endOffset() === 0 && options.sol !== false;
} { return []; }
empty_line_with_comments
= sp:sol_prefix p:("" { return endOffset(); }) c:(space* comment (space / comment)* newline)+ {
return [
sp,
new SelfclosingTagTk("meta", [new KV('typeof', 'mw:EmptyLine')], {
tokens: tu.flattenIfArray(c),
tsr: [p, endOffset()],
}),
];
}
comment_space = comment / space
nl_comment_space = newlineToken / comment_space
/**
* noinclude / includeonly / onlyinclude rules. These are normally
* handled by the xmlish_tag rule, except where generic tags are not
* allowed- for example in directives, which are allowed in various attribute
* names and -values.
*
* Example test case:
* {|
* |-<includeonly>
* foo
* </includeonly>
* |Hello
* |}
*/
include_limits =
il:("<" c:"/"? name:$(n:$[oyinclude]i+ & {
var incl = n.toLowerCase();
return incl === "noinclude" || incl === "onlyinclude" ||
incl === "includeonly";
}) space_or_newline* ">" {
var incl = name.toLowerCase();
var dp = { tsr: tsrOffsets() };
// Record variant since tag is not in normalized lower case
if (name !== incl) {
dp.srcTagName = name;
}
// End tag only
if (c) {
return new EndTagTk(name, [], dp);
}
var restOfInput = input.substring(endOffset());
var tagContent = restOfInput.match(new RegExp("^([\\s\\S]*?)(?:</\\s*" + incl + "\\s*>)", "m"));
// Start tag only
if (!tagContent || !tagContent[1]) {
return new TagTk(name, [], dp);
}
// Get the content
var inclContent = tagContent[1];
// Preserve SOL where necessary (for onlyinclude and noinclude)
// Note that this only works because we encounter <*include*> tags in
// the toplevel content and we rely on the php preprocessor to expand
// templates, so we shouldn't ever be tokenizing inInclude.
// Last line should be empty (except for comments)
if (incl !== "includeonly" && stops.onStack("sol_il")) {
var last = lastItem(inclContent.split('\n'));
if (!/^(<!--([^-]|-(?!->))*-->)*$/.test(last)) {
return false;
}
}
// Tokenize include content in a new tokenizer
var inclContentToks = (new PegTokenizer(env)).tokenizeSync(inclContent);
inclContentToks = Util.stripEOFTkfromTokens(inclContentToks);
// Shift tsr
Util.shiftTokenTSR(inclContentToks, endOffset());
// Skip past content
peg$currPos += inclContent.length;
return [new TagTk(name, [], dp)].concat(inclContentToks);
}) & { return !!il; } { return il; }
// Start of file
sof = & { return endOffset() === 0 && !options.pipelineOffset; }
// End of file
eof = & { return endOffset() === input.length; }
newline = '\n' / '\r\n'
newlineToken = newline { return [new NlTk(tsrOffsets())]; }
eolf = newline / eof
comment_space_eolf = (space+ / comment)* eolf
// 'Preprocessor' directive- higher-level things that can occur in otherwise
// plain-text content.
directive
= comment
/ extension_tag
/ tplarg_or_template
/ & "-{" v:lang_variant_or_tpl { return v; }
/ & "&" e:htmlentity { return e; }
/ include_limits
wikilink_preprocessor_text
= r:( t:$[^<[{\n\r\t|!\]}{ &\-]+
// XXX gwicke: any more chars we need to allow here?
/ !inline_breaks wr:( directive / $( !"]]" ( text_char / [!<\-\}\]\n\r] ) ) )
{ return wr; }
)+ {
return tu.flattenStringlist(r);
}
extlink_preprocessor_text
// added special separator character class inline: separates url from
// description / text
= & {
// Prevent breaking on pipes when we're in a link description.
// See the test, 'Images with the "|" character in the comment'.
return stops.push('linkdesc', false);
}
r:( $[^'<~[{\n\r|!\]}\-\t&="' \u00A0\u1680\u180E\u2000-\u200A\u202F\u205F\u3000]+
/ !inline_breaks s:( directive / no_punctuation_char / [&|{\-] ) { return s; }
/// urlencoded_char
// !inline_breaks no_punctuation_char
/ $([.:,] !(space / eolf))
/ $(['] ![']) // single quotes are ok, double quotes are bad
)+ {
stops.pop('linkdesc');
return tu.flattenString(r);
}
/ & { return stops.pop('linkdesc'); }
// Attribute values with preprocessor support
// n.b. / is a permissible char in the three rules below.
// We only break on />, enforced by the negated expression.
// Hence, it isn't included in the stop set.
// The stop set is space_or_newline and > which matches generic_att_value.
attribute_preprocessor_text
= r:( $[^{}&<\-|/ \t\n\r\x0c>]+
/ !inline_breaks
!'/>'
s:( directive / less_than / [{}&\-|/] ) { return s; }
)+ {
return tu.flattenString(r);
}
// The stop set is '> which matches generic_att_value.
attribute_preprocessor_text_single
= r:( $[^{}&<\-|/'>]+
/ !inline_breaks
!'/>'
s:( directive / less_than / [{}&\-|/] ) { return s; }
)* {
return tu.flattenString(r);
}
// The stop set is "> which matches generic_att_value.
attribute_preprocessor_text_double
= r:( $[^{}&<\-|/">]+
/ !inline_breaks
!'/>'
s:( directive / less_than / [{}&\-|/] ) { return s; }
)* {
return tu.flattenString(r);
}
// Variants with the entire attribute on a single line
// n.b. ! is a permissible char in the three rules below.
// We only break on !! in th, enforced by the inline break.
// Hence, it isn't included in the stop set.
// [ is also permissible but we give a chance to break
// for the [[ special case in php's doTableStuff (See T2553).
// The stop set is space_or_newline and | which matches table_att_value.
table_attribute_preprocessor_text
= r:( $[^{}&<\-!\[ \t\n\r\x0c|]+
/ !inline_breaks s:( directive / [{}&<\-!\[] ) { return s; }
)+ {
return tu.flattenString(r);
}
// The stop set is '\r\n| which matches table_att_value.
table_attribute_preprocessor_text_single
= r:( $[^{}&<\-!\['\r\n|]+
/ !inline_breaks s:( directive / [{}&<\-!\[] ) { return s; }
)* {
return tu.flattenString(r);
}
// The stop set is "\r\n| which matches table_att_value.
table_attribute_preprocessor_text_double
= r:( $[^{}&<\-!\["\r\n|]+
/ !inline_breaks s:( directive / [{}&<\-!\[] ) { return s; }
)* {
return tu.flattenString(r);
}
// Special-case support for those pipe templates
pipe = "|" / "{{!}}"
// SSS FIXME: what about |{{!}} and {{!}}|
pipe_pipe = "||" / "{{!}}{{!}}"
diff --git a/tests/parserTests-blacklist.js b/tests/parserTests-blacklist.js
index 4a5bf9701..f6c81b626 100644
--- a/tests/parserTests-blacklist.js
+++ b/tests/parserTests-blacklist.js
@@ -1,2056 +1,2056 @@
/* 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", "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", "post-expand include size being exceeded", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,20,0,0],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo3\",\"href\":\"./Template:Echo3\"},\"params\":{\"1\":{\"wt\":\"1234567890\"}},\"i\":0}}]}'>1234567890\n1234567890\n1234567890</p>");
add("wt2html", "max template depth being reached", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,29,0,0],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo with depth\",\"href\":\"./Template:Echo_with_depth\"},\"params\":{\"1\":{\"wt\":\"too deep!\"}},\"i\":0}}]}'>too deep!</p>");
add("wt2html", "multiple templates that are redirects", "<link rel=\"mw:PageProp/redirect\" href=\"./Template:Foo\" about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"a\":{\"href\":\"./Template:Foo\"},\"sa\":{\"href\":\"Template:Foo\"},\"dsr\":[0,19,null,null],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"redirect to foo\",\"href\":\"./Template:Redirect_to_foo\"},\"params\":{},\"i\":0}}]}'/>\n<link rel=\"mw:PageProp/redirect\" href=\"./Template:Foo\" about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"a\":{\"href\":\"./Template:Foo\"},\"sa\":{\"href\":\"Template:Foo\"},\"dsr\":[20,39,null,null],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"redirect to foo\",\"href\":\"./Template:Redirect_to_foo\"},\"params\":{},\"i\":0}}]}'/>");
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", "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: Mixed Lists: Test 13", "<ul data-parsoid='{\"dsr\":[0,32,0,0]}'><li data-parsoid='{\"dsr\":[0,32,1,0]}'><ol data-parsoid='{\"dsr\":[1,32,0,0]}'><li data-parsoid='{\"dsr\":[1,32,1,0]}'><ul data-parsoid='{\"dsr\":[2,32,0,0]}'><li data-parsoid='{\"dsr\":[2,32,1,0]}'><ol data-parsoid='{\"dsr\":[3,32,0,0]}'><li data-parsoid='{\"dsr\":[3,32,1,0]}'><dl data-parsoid='{\"dsr\":[4,32,0,0]}'><dt data-parsoid='{\"dsr\":[4,18,1,0]}'><ul data-parsoid='{\"dsr\":[5,17,0,0]}'><li data-parsoid='{\"dsr\":[5,17,1,0]}'><dl data-parsoid='{\"dsr\":[6,17,0,0]}'><dt data-parsoid='{\"dsr\":[6,17,1,0]}'><dl data-parsoid='{\"dsr\":[7,17,0,0]}'><dt data-parsoid='{\"dsr\":[7,12,1,0]}'>foo<span typeof=\"mw:DisplaySpace mw:Placeholder\" data-parsoid='{\"src\":\" \",\"isDisplayHack\":true,\"dsr\":[11,12,null,0]}'> </span></dt><dd data-parsoid='{\"stx\":\"row\",\"dsr\":[12,17,1,0]}'>bar</dd></dl></dt></dl></li></ul>\n</dt><dt data-parsoid='{\"dsr\":[18,27,5,0]}'>boo<span typeof=\"mw:DisplaySpace mw:Placeholder\" data-parsoid='{\"src\":\" \",\"isDisplayHack\":true,\"dsr\":[26,27,null,0]}'> </span></dt><dd data-parsoid='{\"stx\":\"row\",\"dsr\":[27,32,1,0]}'>baz</dd></dl></li></ol></li></ul></li></ol></li></ul>");
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]}'/>");
add("wt2html", "Escaping of interlanguage links (T129218, T156308)", "<p data-parsoid='{\"dsr\":[0,51,0,0]}'>Blah blah blah\n<a rel=\"mw:WikiLink/Interwiki\" href=\"http://es.wikipedia.org/wiki/Spanish\" title=\"es:Spanish\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://es.wikipedia.org/wiki/Spanish\"},\"sa\":{\"href\":\":es:Spanish\"},\"isIW\":true,\"dsr\":[15,30,2,2]}'>es:Spanish</a>\n<a rel=\"mw:WikiLink\" href=\"./Zh_:_Chinese\" title=\"Zh : Chinese\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Zh_:_Chinese\"},\"sa\":{\"href\":\" : zh : Chinese \"},\"dsr\":[31,51,2,2]}'> : zh : Chinese </a></p>");
add("wt2html", "Space and question mark encoding in interlanguage links (T95473)", "<p data-parsoid='{\"dsr\":[0,14,0,0]}'>Blah blah blah</p>\n<link rel=\"mw:PageProp/Language\" href=\"http://es.wikipedia.org/wiki/Foo%20bar?\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://es.wikipedia.org/wiki/Foo%20bar?\"},\"sa\":{\"href\":\"es:Foo bar?\"},\"dsr\":[15,30,null,null]}'/>");
add("wt2html", "2. Lists with start-of-line-transparent tokens before bullets: Template close", "<ul about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,18,0,0],\"firstWikitextNode\":\"UL\",\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[\"*foo \",{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"bar\\n\"}},\"i\":0}}]}'><li>foo bar</li></ul><span about=\"#mwt1\">\n</span><p data-parsoid='{\"dsr\":[18,22,0,0]}'>*baz</p>");
add("wt2html", "Magic Word: {{CURRENTMONTH1}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,17,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"CURRENTMONTH1\",\"function\":\"currentmonth1\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_currentmonth1 missing in Parsoid.</p>");
add("wt2html", "Magic Words LOCAL (UTC)", "<ul data-parsoid='{\"dsr\":[0,238,0,0]}'><li data-parsoid='{\"dsr\":[0,15,1,0]}'><span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[1,15,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"LOCALMONTH\",\"function\":\"localmonth\"},\"params\":{},\"i\":0}}]}'>01</span></li>\n<li data-parsoid='{\"dsr\":[16,32,1,0]}'><span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[17,32,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"LOCALMONTH1\",\"function\":\"localmonth1\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_localmonth1 missing in Parsoid.</span></li>\n<li data-parsoid='{\"dsr\":[33,52,1,0]}'><span about=\"#mwt3\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[34,52,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"LOCALMONTHNAME\",\"function\":\"localmonthname\"},\"params\":{},\"i\":0}}]}'>January</span></li>\n<li data-parsoid='{\"dsr\":[53,75,1,0]}'><span about=\"#mwt4\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[54,75,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"LOCALMONTHNAMEGEN\",\"function\":\"localmonthnamegen\"},\"params\":{},\"i\":0}}]}'>January</span></li>\n<li data-parsoid='{\"dsr\":[76,97,1,0]}'><span about=\"#mwt5\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[77,97,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"LOCALMONTHABBREV\",\"function\":\"localmonthabbrev\"},\"params\":{},\"i\":0}}]}'>Jan</span></li>\n<li data-parsoid='{\"dsr\":[98,111,1,0]}'><span about=\"#mwt6\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[99,111,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"LOCALDAY\",\"function\":\"localday\"},\"params\":{},\"i\":0}}]}'>1</span></li>\n<li data-parsoid='{\"dsr\":[112,126,1,0]}'><span about=\"#mwt7\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[113,126,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"LOCALDAY2\",\"function\":\"localday2\"},\"params\":{},\"i\":0}}]}'>01</span></li>\n<li data-parsoid='{\"dsr\":[127,144,1,0]}'><span about=\"#mwt8\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[128,144,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"LOCALDAYNAME\",\"function\":\"localdayname\"},\"params\":{},\"i\":0}}]}'>Thursday</span></li>\n<li data-parsoid='{\"dsr\":[145,159,1,0]}'><span about=\"#mwt9\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[146,159,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"LOCALYEAR\",\"function\":\"localyear\"},\"params\":{},\"i\":0}}]}'>1970</span></li>\n<li data-parsoid='{\"dsr\":[160,174,1,0]}'><span about=\"#mwt10\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[161,174,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"LOCALTIME\",\"function\":\"localtime\"},\"params\":{},\"i\":0}}]}'>00:02</span></li>\n<li data-parsoid='{\"dsr\":[175,189,1,0]}'><span about=\"#mwt11\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[176,189,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"LOCALHOUR\",\"function\":\"localhour\"},\"params\":{},\"i\":0}}]}'>00</span></li>\n<li data-parsoid='{\"dsr\":[190,204,1,0]}'><span about=\"#mwt12\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[191,204,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"LOCALWEEK\",\"function\":\"localweek\"},\"params\":{},\"i\":0}}]}'>1</span></li>\n<li data-parsoid='{\"dsr\":[205,218,1,0]}'><span about=\"#mwt13\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[206,218,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"LOCALDOW\",\"function\":\"localdow\"},\"params\":{},\"i\":0}}]}'>4</span></li>\n<li data-parsoid='{\"dsr\":[219,238,1,0]}'><span about=\"#mwt14\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[220,238,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"LOCALTIMESTAMP\",\"function\":\"localtimestamp\"},\"params\":{},\"i\":0}}]}'>19700101000203</span></li></ul>");
add("wt2html", "Magic Word: {{FULLPAGENAMEE}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,17,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"FULLPAGENAMEE\",\"function\":\"fullpagenamee\"},\"params\":{},\"i\":0}}]}'>User:Ævar Arnfjörð Bjarmason</p>");
add("wt2html", "Magic Word: {{TALKSPACE}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,13,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"TALKSPACE\",\"function\":\"talkspace\"},\"params\":{},\"i\":0}}]}'>Talk</p>");
add("wt2html", "Magic Word: {{TALKSPACE}}, same namespace", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,13,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"TALKSPACE\",\"function\":\"talkspace\"},\"params\":{},\"i\":0}}]}'>Talk</p>");
add("wt2html", "Magic Word: {{TALKSPACEE}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,14,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"TALKSPACEE\",\"function\":\"talkspacee\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_talkspacee missing in Parsoid.</p>");
add("wt2html", "Magic Word: {{SUBJECTSPACE}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,16,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"SUBJECTSPACE\",\"function\":\"subjectspace\"},\"params\":{},\"i\":0}}]}'>Main</p>");
add("wt2html", "Magic Word: {{SUBJECTSPACE}}, same namespace", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,16,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"SUBJECTSPACE\",\"function\":\"subjectspace\"},\"params\":{},\"i\":0}}]}'>Main</p>");
add("wt2html", "Magic Word: {{SUBJECTSPACE}}, main namespace", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,16,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"SUBJECTSPACE\",\"function\":\"subjectspace\"},\"params\":{},\"i\":0}}]}'>Main</p>");
add("wt2html", "Magic Word: {{SUBJECTSPACEE}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,17,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"SUBJECTSPACEE\",\"function\":\"subjectspacee\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_subjectspacee missing in Parsoid.</p>");
add("wt2html", "Magic Word: {{NAMESPACE}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,13,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"NAMESPACE\",\"function\":\"namespace\"},\"params\":{},\"i\":0}}]}'>Main</p>");
add("wt2html", "Magic Word: {{NAMESPACEE}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,14,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"NAMESPACEE\",\"function\":\"namespacee\"},\"params\":{},\"i\":0}}]}'>Main</p>");
add("wt2html", "Magic Word: {{NAMESPACENUMBER}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,19,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"NAMESPACENUMBER\",\"function\":\"namespacenumber\"},\"params\":{},\"i\":0}}]}'>0</p>");
add("wt2html", "Magic Word: {{SUBPAGENAME}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,15,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"SUBPAGENAME\",\"function\":\"subpagename\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_subpagename missing in Parsoid.</p>");
add("wt2html", "Magic Word: {{SUBPAGENAMEE}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,16,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"SUBPAGENAMEE\",\"function\":\"subpagenamee\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_subpagenamee missing in Parsoid.</p>");
add("wt2html", "Magic Word: {{ROOTPAGENAME}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,16,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"ROOTPAGENAME\",\"function\":\"rootpagename\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_rootpagename missing in Parsoid.</p>");
add("wt2html", "Magic Word: {{ROOTPAGENAMEE}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,17,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"ROOTPAGENAMEE\",\"function\":\"rootpagenamee\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_rootpagenamee missing in Parsoid.</p>");
add("wt2html", "Magic Word: {{BASEPAGENAME}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,16,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"BASEPAGENAME\",\"function\":\"basepagename\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_basepagename missing in Parsoid.</p>");
add("wt2html", "Magic Word: {{BASEPAGENAMEE}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,17,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"BASEPAGENAMEE\",\"function\":\"basepagenamee\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_basepagenamee missing in Parsoid.</p>");
add("wt2html", "Magic Word: {{TALKPAGENAME}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,16,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"TALKPAGENAME\",\"function\":\"talkpagename\"},\"params\":{},\"i\":0}}]}'>User:Ævar Arnfjörð Bjarmason</p>");
add("wt2html", "Magic Word: {{TALKPAGENAMEE}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,17,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"TALKPAGENAMEE\",\"function\":\"talkpagenamee\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_talkpagenamee missing in Parsoid.</p>");
add("wt2html", "Magic Word: {{SUBJECTPAGENAME}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,19,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"SUBJECTPAGENAME\",\"function\":\"subjectpagename\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_subjectpagename missing in Parsoid.</p>");
add("wt2html", "Magic Word: {{SUBJECTPAGENAMEE}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,20,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"SUBJECTPAGENAMEE\",\"function\":\"subjectpagenamee\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_subjectpagenamee missing in Parsoid.</p>");
add("wt2html", "Magic Word: {{NUMBEROFFILES}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,17,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"NUMBEROFFILES\",\"function\":\"numberoffiles\"},\"params\":{},\"i\":0}}]}'>2</p>");
add("wt2html", "Magic Word: {{PAGENAME}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,12,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"PAGENAME\",\"function\":\"pagename\"},\"params\":{},\"i\":0}}]}'>User:Ævar Arnfjörð Bjarmason</p>");
add("wt2html", "Magic Word: {{PAGENAMEE}}", "<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,13,null,null],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"PAGENAMEE\",\"function\":\"pagenamee\"},\"params\":{},\"i\":0}}]}'></span>");
add("wt2html", "Magic Word: {{PAGENAMEE}} with metacharacters (T28781)", "<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,13,null,null],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"PAGENAMEE\",\"function\":\"pagenamee\"},\"params\":{},\"i\":0}}]}'></span>");
add("wt2html", "Magic Word: {{REVISIONID}}", "<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", "Magic Word: {{SCRIPTPATH}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,14,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"SCRIPTPATH\",\"function\":\"scriptpath\"},\"params\":{},\"i\":0}}]}'>/</p>");
add("wt2html", "Magic Word: {{STYLEPATH}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,13,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"STYLEPATH\",\"function\":\"stylepath\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_stylepath missing in Parsoid.</p>");
add("wt2html", "Case-sensitive magic words, when cased differently, should just be template transclusions", "<p data-parsoid='{\"dsr\":[0,63,0,0]}'><span about=\"#mwt2\" typeof=\"mw:Error mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[0,16,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"CurrentMonth\",\"href\":\"./Template:CurrentMonth\"},\"params\":{},\"errors\":[{\"key\":\"mw-api-tplfetch-error\",\"message\":\"Page / template fetching disabled, and no cache for Template:CurrentMonth\"}],\"i\":0}}]}'>{{CurrentMonth}}</span>\n<span about=\"#mwt4\" typeof=\"mw:Error mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[17,31,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"currentday\",\"href\":\"./Template:Currentday\"},\"params\":{},\"errors\":[{\"key\":\"mw-api-tplfetch-error\",\"message\":\"Page / template fetching disabled, and no cache for Template:Currentday\"}],\"i\":0}}]}'>{{currentday}}</span>\n<span about=\"#mwt6\" typeof=\"mw:Error mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[32,47,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"cURreNTweEK\",\"href\":\"./Template:CURreNTweEK\"},\"params\":{},\"errors\":[{\"key\":\"mw-api-tplfetch-error\",\"message\":\"Page / template fetching disabled, and no cache for Template:CURreNTweEK\"}],\"i\":0}}]}'>{{cURreNTweEK}}</span>\n<span about=\"#mwt8\" typeof=\"mw:Error mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[48,63,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"currentHour\",\"href\":\"./Template:CurrentHour\"},\"params\":{},\"errors\":[{\"key\":\"mw-api-tplfetch-error\",\"message\":\"Page / template fetching disabled, and no cache for Template:CurrentHour\"}],\"i\":0}}]}'>{{currentHour}}</span></p>");
add("wt2html", "Namespace 1 {{ns:1}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,8,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"ns:1\",\"function\":\"ns\"},\"params\":{},\"i\":0}}]}'>1</p>");
add("wt2html", "Namespace 1 {{ns:01}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,9,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"ns:01\",\"function\":\"ns\"},\"params\":{},\"i\":0}}]}'>01</p>");
add("wt2html", "Namespace 0 {{ns:0}} (T6783)", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,8,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"ns:0\",\"function\":\"ns\"},\"params\":{},\"i\":0}}]}'>0</p>");
add("wt2html", "Namespace 0 {{ns:00}} (T6783)", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,9,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"ns:00\",\"function\":\"ns\"},\"params\":{},\"i\":0}}]}'>00</p>");
add("wt2html", "Namespace -1 {{ns:-1}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,9,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"ns:-1\",\"function\":\"ns\"},\"params\":{},\"i\":0}}]}'>-1</p>");
add("wt2html", "Namespace (lang=de) Benutzer Diskussion {{ns:3}}", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,8,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"ns:3\",\"function\":\"ns\"},\"params\":{},\"i\":0}}]}'>3</p>");
add("wt2html", "Nonexistent template", "<p data-parsoid='{\"dsr\":[0,28,0,0]}'><span about=\"#mwt2\" typeof=\"mw:Error mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[0,28,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"thistemplatedoesnotexist\",\"href\":\"./Template:Thistemplatedoesnotexist\"},\"params\":{},\"errors\":[{\"key\":\"mw-api-tplfetch-error\",\"message\":\"Page / template fetching disabled, and no cache for Template:Thistemplatedoesnotexist\"}],\"i\":0}}]}'>{{thistemplatedoesnotexist}}</span></p>");
add("wt2html", "Template with invalid target containing tags", "<p data-parsoid='{\"dsr\":[0,54,0,0]}'>{{a<b data-parsoid='{\"stx\":\"html\",\"dsr\":[3,11,3,4]}'>b</b>|<span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[12,24,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo\"}},\"i\":0}}]}'>foo</span>|<span about=\"#mwt3\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[25,35,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"a\"}},\"i\":0}}]}'>a</span>=<span about=\"#mwt4\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[36,46,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"b\"}},\"i\":0}}]}'>b</span>|a =b}}</p>");
add("wt2html", "Template with invalid target containing unclosed tag", "<p data-parsoid='{\"dsr\":[0,49,0,0]}'>{{a<b data-parsoid='{\"stx\":\"html\",\"autoInsertedEnd\":true,\"dsr\":[3,49,3,0]}'>|<span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[7,19,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo\"}},\"i\":0}}]}'>foo</span>|<span about=\"#mwt3\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[20,30,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"a\"}},\"i\":0}}]}'>a</span>=<span about=\"#mwt4\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[31,41,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"b\"}},\"i\":0}}]}'>b</span>|a =b}}</b></p>");
add("wt2html", "Template with invalid target containing wikilink", "<p data-parsoid='{\"dsr\":[0,17,0,0]}'>{{<a rel=\"mw:WikiLink\" href=\"./Main_Page\" title=\"Main Page\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Main_Page\"},\"sa\":{\"href\":\"Main Page\"},\"dsr\":[2,15,2,2]}'>Main Page</a>}}</p>");
add("wt2html", "Template with complex arguments", "<p data-parsoid='{\"dsr\":[0,106,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Template:Complextemplate\" title=\"Template:Complextemplate\" about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Template:Complextemplate\"},\"sa\":{\"href\":\"Template:complextemplate\"},\"dsr\":[0,106,null,null],\"pi\":[[{\"k\":\"param\",\"named\":true,\"spc\":[\"\\n \",\" \",\"\",\"\"]},{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"complextemplate\",\"href\":\"./Template:Complextemplate\"},\"params\":{\"1\":{\"wt\":\"[[Template:complextemplate|link]]\"},\"param\":{\"wt\":\"{{ templateasargtest |\\n templ = simple }}\"}},\"i\":0}}]}'>link</a><span about=\"#mwt1\"> This is a test template with parameter (test)</span></p>");
add("wt2html", "Template infinite loop", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,9,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"loop1\",\"href\":\"./Template:Loop1\"},\"params\":{},\"i\":0}}]}'>Error: Expansion loop detected at <a>Template:Loop1</a></p>");
add("wt2html", "Template from non-includable namespace", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,15,0,0],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"uh oh!\"}},\"i\":0}}]}'>uh oh!</p>");
add("wt2html", "int keyword", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,45,0,0],\"pi\":[[{\"k\":\"1\"},{\"k\":\"2\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"int:youhavenewmessages\",\"function\":\"int\"},\"params\":{\"1\":{\"wt\":\"lots of money\"},\"2\":{\"wt\":\"not!\"}},\"i\":0}}]}'>Parser function implementation for pf_int missing in Parsoid.</p>");
add("wt2html", "int keyword - non-existing message", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,11,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"int:var\",\"function\":\"int\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_int missing in Parsoid.</p>");
add("wt2html", "Self-closed noinclude, includeonly, onlyinclude tags", "<meta typeof=\"mw:Includes/NoInclude\" data-parsoid='{\"src\":\"&lt;noinclude />\",\"dsr\":[0,13,null,null]}'/>\n<meta typeof=\"mw:Includes/IncludeOnly\" data-parsoid='{\"src\":\"&lt;includeonly />\",\"dsr\":[14,29,null,null]}'/>\n<meta typeof=\"mw:Includes/OnlyInclude\" data-parsoid='{\"src\":\"&lt;onlyinclude />\",\"dsr\":[30,45,null,null]}'/>");
add("wt2html", "T8563: Section extraction for section shown by <includeonly>", "<meta typeof=\"mw:Includes/IncludeOnly\" data-parsoid='{\"src\":\"&lt;includeonly>\\n==Includeonly section==\\n&lt;/includeonly>\",\"dsr\":[0,52,null,null]}'/><meta typeof=\"mw:Includes/IncludeOnly/End\" data-parsoid='{\"src\":\"\",\"dsr\":[52,52,null,null]}'/>\n<h2 id=\"Section_T-2\" data-parsoid='{\"dsr\":[53,68,2,2]}'>Section T-2</h2>");
add("wt2html", "T8563: Section extraction for section suppressed by <includeonly>", "<meta typeof=\"mw:Includes/IncludeOnly\" data-parsoid='{\"src\":\"&lt;includeonly>\\n==Includeonly section==\\n&lt;/includeonly>\",\"dsr\":[0,52,null,null]}'/><meta typeof=\"mw:Includes/IncludeOnly/End\" data-parsoid='{\"src\":\"\",\"dsr\":[52,52,null,null]}'/>\n<h2 id=\"Section_1\" data-parsoid='{\"dsr\":[53,66,2,2]}'>Section 1</h2>");
add("wt2html", "2. includeonly in html attr value", "<p data-parsoid='{\"dsr\":[0,155,0,0]}'><span id=\"v1\" about=\"#mwt1\" typeof=\"mw:ExpandedAttrs\" data-parsoid='{\"stx\":\"html\",\"a\":{\"id\":\"v1\"},\"sa\":{\"id\":\"&lt;noinclude>v1&lt;/noinclude>&lt;includeonly>v2&lt;/includeonly>\"},\"dsr\":[0,76,66,7]}' data-mw='{\"attribs\":[[{\"txt\":\"id\"},{\"html\":\"&lt;meta typeof=\\\"mw:Includes/NoInclude\\\" data-parsoid=&apos;{\\\"src\\\":\\\"&amp;lt;noinclude>\\\",\\\"dsr\\\":[10,21,null,null]}&apos;/>v1&lt;meta typeof=\\\"mw:Includes/NoInclude/End\\\" data-parsoid=&apos;{\\\"src\\\":\\\"&amp;lt;/noinclude>\\\",\\\"dsr\\\":[23,35,null,null]}&apos;/>&lt;meta typeof=\\\"mw:Includes/IncludeOnly\\\" data-parsoid=&apos;{\\\"src\\\":\\\"&amp;lt;includeonly>v2&amp;lt;/includeonly>\\\",\\\"dsr\\\":[35,64,null,null]}&apos;/>&lt;meta typeof=\\\"mw:Includes/IncludeOnly/End\\\" data-parsoid=&apos;{\\\"src\\\":\\\"\\\",\\\"dsr\\\":[64,64,null,null]}&apos;/>\"}]]}'>bar</span>\n<span id='\"v1\"' about=\"#mwt2\" typeof=\"mw:ExpandedAttrs\" data-parsoid='{\"stx\":\"html\",\"a\":{\"id\":\"\\\"v1\\\"\"},\"sa\":{\"id\":\"&lt;noinclude>\\\"v1\\\"&lt;/noinclude>&lt;includeonly>\\\"v2\\\"&lt;/includeonly>\"},\"dsr\":[77,155,68,7]}' data-mw='{\"attribs\":[[{\"txt\":\"id\"},{\"html\":\"&lt;meta typeof=\\\"mw:Includes/NoInclude\\\" data-parsoid=&apos;{\\\"src\\\":\\\"&amp;lt;noinclude>\\\",\\\"dsr\\\":[86,97,null,null]}&apos;/>\\\"v1\\\"&lt;meta typeof=\\\"mw:Includes/NoInclude/End\\\" data-parsoid=&apos;{\\\"src\\\":\\\"&amp;lt;/noinclude>\\\",\\\"dsr\\\":[101,113,null,null]}&apos;/>&lt;meta typeof=\\\"mw:Includes/IncludeOnly\\\" data-parsoid=&apos;{\\\"src\\\":\\\"&amp;lt;includeonly>\\\\\\\"v2\\\\\\\"&amp;lt;/includeonly>\\\",\\\"dsr\\\":[113,144,null,null]}&apos;/>&lt;meta typeof=\\\"mw:Includes/IncludeOnly/End\\\" data-parsoid=&apos;{\\\"src\\\":\\\"\\\",\\\"dsr\\\":[144,144,null,null]}&apos;/>\"}]]}'>bar</span></p>");
add("wt2html", "4. includeonly in table attributes", "<table data-parsoid='{\"dsr\":[0,77,2,2]}'>\n<tbody data-parsoid='{\"dsr\":[3,75,0,0]}'><tr about=\"#mwt1\" typeof=\"mw:ExpandedAttrs\" data-parsoid='{\"startTagSrc\":\"|-\",\"a\":{\"&lt;noinclude>\\n|-\\n|a\\n&lt;/noinclude>\":null},\"sa\":{\"&lt;noinclude>\\n|-\\n|a\\n&lt;/noinclude>\":\"\"},\"dsr\":[3,36,33,0]}' data-mw='{\"attribs\":[[{\"txt\":\"a\",\"html\":\"&lt;meta typeof=\\\"mw:Includes/NoInclude\\\" data-parsoid=&apos;{\\\"src\\\":\\\"&amp;lt;noinclude>\\\",\\\"dsr\\\":[6,17,null,null]}&apos;/>\\n|-\\n|a\\n&lt;meta typeof=\\\"mw:Includes/NoInclude/End\\\" data-parsoid=&apos;{\\\"src\\\":\\\"&amp;lt;/noinclude>\\\",\\\"dsr\\\":[24,36,null,null]}&apos;/>\"},{\"html\":\"\"}]]}'></tr>\n<tr about=\"#mwt2\" typeof=\"mw:ExpandedAttrs\" data-parsoid='{\"startTagSrc\":\"|-\",\"a\":{\"&lt;includeonly>\\n|-\\n|b\\n&lt;/includeonly>\":null},\"sa\":{\"&lt;includeonly>\\n|-\\n|b\\n&lt;/includeonly>\":\"\"},\"dsr\":[37,74,37,0]}' data-mw='{\"attribs\":[[{\"txt\":\"\",\"html\":\"&lt;meta typeof=\\\"mw:Includes/IncludeOnly\\\" data-parsoid=&apos;{\\\"src\\\":\\\"&amp;lt;includeonly>\\\\n|-\\\\n|b\\\\n&amp;lt;/includeonly>\\\",\\\"dsr\\\":[40,74,null,null]}&apos;/>&lt;meta typeof=\\\"mw:Includes/IncludeOnly/End\\\" data-parsoid=&apos;{\\\"src\\\":\\\"\\\",\\\"dsr\\\":[74,74,null,null]}&apos;/>\"},{\"html\":\"\"}]]}'></tr>\n</tbody></table>");
add("wt2html", "Templates: HTML Tag: 2. Generation of HTML attr. value", "<div style=\"'color:red;'\" about=\"#mwt2\" typeof=\"mw:ExpandedAttrs\" data-parsoid='{\"stx\":\"html\",\"a\":{\"style\":\"&apos;color:red;&apos;\"},\"sa\":{\"style\":\"{{echo|&apos;color:red;&apos;}}\"},\"dsr\":[0,42,33,6]}' data-mw='{\"attribs\":[[{\"txt\":\"style\"},{\"html\":\"&lt;span about=\\\"#mwt1\\\" typeof=\\\"mw:Transclusion\\\" data-parsoid=&apos;{\\\"pi\\\":[[{\\\"k\\\":\\\"1\\\"}]],\\\"dsr\\\":[11,32,null,null]}&apos; data-mw=&apos;{\\\"parts\\\":[{\\\"template\\\":{\\\"target\\\":{\\\"wt\\\":\\\"echo\\\",\\\"href\\\":\\\"./Template:Echo\\\"},\\\"params\\\":{\\\"1\\\":{\\\"wt\\\":\\\"&amp;apos;color:red;&amp;apos;\\\"}},\\\"i\\\":0}}]}&apos;>&apos;color:red;&apos;&lt;/span>\"}]]}'>foo</div>");
add("wt2html", "Templates: HTML Tag: 3. Generation of HTML attr key and value", "<div style=\"'color:red;'\" about=\"#mwt3\" typeof=\"mw:ExpandedAttrs\" data-parsoid='{\"stx\":\"html\",\"a\":{\"style\":\"&apos;color:red;&apos;\"},\"sa\":{\"style\":\"{{echo|&apos;color:red;&apos;}}\"},\"dsr\":[0,51,42,6]}' data-mw='{\"attribs\":[[{\"txt\":\"style\",\"html\":\"&lt;span about=\\\"#mwt2\\\" typeof=\\\"mw:Transclusion\\\" data-parsoid=&apos;{\\\"pi\\\":[[{\\\"k\\\":\\\"1\\\"}]],\\\"dsr\\\":[5,19,null,null]}&apos; data-mw=&apos;{\\\"parts\\\":[{\\\"template\\\":{\\\"target\\\":{\\\"wt\\\":\\\"echo\\\",\\\"href\\\":\\\"./Template:Echo\\\"},\\\"params\\\":{\\\"1\\\":{\\\"wt\\\":\\\"style\\\"}},\\\"i\\\":0}}]}&apos;>style&lt;/span>\"},{\"html\":\"&lt;span about=\\\"#mwt1\\\" typeof=\\\"mw:Transclusion\\\" data-parsoid=&apos;{\\\"pi\\\":[[{\\\"k\\\":\\\"1\\\"}]],\\\"dsr\\\":[20,41,null,null]}&apos; data-mw=&apos;{\\\"parts\\\":[{\\\"template\\\":{\\\"target\\\":{\\\"wt\\\":\\\"echo\\\",\\\"href\\\":\\\"./Template:Echo\\\"},\\\"params\\\":{\\\"1\\\":{\\\"wt\\\":\\\"&amp;apos;color:red;&amp;apos;\\\"}},\\\"i\\\":0}}]}&apos;>&apos;color:red;&apos;&lt;/span>\"}]]}'>foo</div>");
add("wt2html", "Templates: Wiki Tables: 4. Templated tags, no content", "<table about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,25,null,null],\"pi\":[[],[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"tbl-start\",\"href\":\"./Template:Tbl-start\"},\"params\":{},\"i\":0}},\"\\n\",{\"template\":{\"target\":{\"wt\":\"tbl-end\",\"href\":\"./Template:Tbl-end\"},\"params\":{},\"i\":1}}]}'>\n</table>");
add("wt2html", "Templates: Lists: Multi-line list-items via templates", "<ul data-parsoid='{\"dsr\":[0,71,0,0]}'><li data-parsoid='{\"dsr\":[0,35,1,0]}'><span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[1,35,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"a {{nonexistent|\\nunused}}\"}},\"i\":0}}]}'>a {{nonexistent|\nunused}}</span></li>\n<li data-parsoid='{\"dsr\":[36,71,1,0]}'><span about=\"#mwt3\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[37,71,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"b {{nonexistent|\\nunused}}\"}},\"i\":0}}]}'>b {{nonexistent|\nunused}}</span></li></ul>");
add("wt2html", "Templates: Ugly nesting: 1. Quotes opened/closed across templates (echo)", "<p data-parsoid='{\"dsr\":[0,40,0,0]}'><i about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,40,null,null],\"pi\":[[{\"k\":\"1\"}],[{\"k\":\"1\"}],[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"&apos;&apos;a\"}},\"i\":0}},{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"b&apos;&apos;c&apos;&apos;d\"}},\"i\":1}},{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"&apos;&apos;e\"}},\"i\":2}}]}'>ab</i><span about=\"#mwt1\">c</span><i about=\"#mwt1\">d</i><span about=\"#mwt1\">e</span></p>");
add("wt2html", "Templates: Ugly templates: 4. newline-only template parameter inconsistency", "<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[0,10,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"\\n\"}},\"i\":0}}]}'>\n</span>");
add("wt2html", "subst: does not work during normal parse", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,13,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"SubstTest\",\"href\":\"./Template:SubstTest\"},\"params\":{},\"i\":0}}]}'>{{&lt;includeonly>subst:&lt;/includeonly>Includes}}</p>");
add("wt2html", "message transform: magic variables", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,12,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"SITENAME\",\"function\":\"sitename\"},\"params\":{},\"i\":0}}]}'>MediaWiki</p>");
add("wt2html", "message transform: should not transform wiki markup", "<p data-parsoid='{\"dsr\":[0,8,0,0]}'><i data-parsoid='{\"dsr\":[0,8,2,2]}'>test</i></p>");
add("wt2html", "message transform: <noinclude> in transcluded template (T6926)", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,12,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"Includes\",\"href\":\"./Template:Includes\"},\"params\":{},\"i\":0}}]}'>Foobar</p>");
add("wt2html", "message transform: <onlyinclude> in transcluded template (T6926)", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,13,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"Includes2\",\"href\":\"./Template:Includes2\"},\"params\":{},\"i\":0}}]}'>Foo<meta typeof=\"mw:Includes/OnlyInclude/End\"/></p>");
add("wt2html", "{{#special:}} page name, known", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,26,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#special:Recentchanges\",\"function\":\"special\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_special missing in Parsoid.</p>");
add("wt2html", "{{#special:}} page name with subpage, known", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,32,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#special:Recentchanges/param\",\"function\":\"special\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_special missing in Parsoid.</p>");
add("wt2html", "{{#special:}} page name, unknown", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,31,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#special:foobar nonexistent\",\"function\":\"special\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_special missing in Parsoid.</p>");
add("wt2html", "{{#speciale:}} page name, known", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,27,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#speciale:Recentchanges\",\"function\":\"speciale\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_speciale missing in Parsoid.</p>");
add("wt2html", "{{#speciale:}} page name with subpage, known", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,33,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#speciale:Recentchanges/param\",\"function\":\"speciale\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_speciale missing in Parsoid.</p>");
add("wt2html", "{{#speciale:}} page name, unknown", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,32,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#speciale:foobar nonexistent\",\"function\":\"speciale\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_speciale missing in Parsoid.</p>");
add("wt2html", "SVG thumbnails with invalid language code", "<figure class=\"mw-default-size\" typeof=\"mw:Image/Thumb\" data-parsoid='{\"optList\":[{\"ck\":\"thumbnail\",\"ak\":\"thumb\"},{\"ck\":\"caption\",\"ak\":\"caption\"},{\"ck\":\"lang\",\"ak\":\"lang=invalid:language:code\"}],\"dsr\":[0,60,2,2]}'><a href=\"./File:Foobar.svg\" data-parsoid='{\"a\":{\"href\":\"./File:Foobar.svg\"},\"sa\":{\"href\":\"File:Foobar.svg\"},\"dsr\":[2,null,null,null]}'><img resource=\"./File:Foobar.svg\" src=\"//example.com/images/thumb/f/ff/Foobar.svg/220px-Foobar.svg.png\" lang=\"invalid:language:code\" data-file-width=\"240\" data-file-height=\"180\" data-file-type=\"drawing\" height=\"165\" width=\"220\" data-parsoid='{\"a\":{\"resource\":\"./File:Foobar.svg\",\"lang\":\"invalid:language:code\",\"height\":\"165\",\"width\":\"220\"},\"sa\":{\"resource\":\"File:Foobar.svg\",\"lang\":\"lang=invalid:language:code\"}}'/></a><figcaption data-parsoid='{\"dsr\":[null,58,null,null]}'>caption</figcaption></figure>");
add("wt2html", "T2561: {{/Subpage}}", "<p data-parsoid='{\"dsr\":[0,12,0,0]}'><span about=\"#mwt2\" typeof=\"mw:Error mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[0,12,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"/Subpage\",\"href\":\"./Page/Subpage\"},\"params\":{},\"errors\":[{\"key\":\"mw-api-tplfetch-error\",\"message\":\"Page / template fetching disabled, and no cache for Page/Subpage\"}],\"i\":0}}]}'>{{/Subpage}}</span></p>");
add("wt2html", "PAGESINCATEGORY invalid title fatal (r33546 fix)", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,27,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"PAGESINCATEGORY:&lt;bogus>\",\"function\":\"pagesincategory\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_pagesincategory missing in Parsoid.</p>");
add("wt2html", "Section headings with TOC", "<h2 id=\"Headline_1\" data-parsoid='{\"dsr\":[0,14,2,2]}'>Headline 1</h2>\n<h3 id=\"Subheadline_1\" data-parsoid='{\"dsr\":[15,34,3,3]}'>Subheadline 1</h3>\n<h5 id=\"Skipping_a_level\" data-parsoid='{\"dsr\":[35,61,5,5]}'>Skipping a level</h5>\n<h6 id=\"Skipping_a_level_2\" data-parsoid='{\"dsr\":[62,90,6,6]}'>Skipping a level</h6>\n\n<h2 id=\"Headline_2\" data-parsoid='{\"dsr\":[92,106,2,2]}'>Headline 2</h2>\n<p data-parsoid='{\"dsr\":[107,116,0,0]}'>Some text</p>\n<h3 id=\"Another_headline\" data-parsoid='{\"dsr\":[117,139,3,3]}'>Another headline</h3>");
add("wt2html", "TOC regression (T11764)", "<h2 id=\"title_1\" data-parsoid='{\"dsr\":[0,11,2,2]}'>title 1</h2>\n<h3 id=\"title_1.1\" data-parsoid='{\"dsr\":[12,27,3,3]}'>title 1.1</h3>\n<h4 id=\"title_1.1.1\" data-parsoid='{\"dsr\":[28,47,4,4]}'>title 1.1.1</h4>\n<h3 id=\"title_1.2\" data-parsoid='{\"dsr\":[48,63,3,3]}'>title 1.2</h3>\n<h2 id=\"title_2\" data-parsoid='{\"dsr\":[64,75,2,2]}'>title 2</h2>\n<h3 id=\"title_2.1\" data-parsoid='{\"dsr\":[76,91,3,3]}'>title 2.1</h3>");
add("wt2html", "TOC with wgMaxTocLevel=3 (T8204)", "<h2 id=\"title_1\" data-parsoid='{\"dsr\":[0,11,2,2]}'>title 1</h2>\n<h3 id=\"title_1.1\" data-parsoid='{\"dsr\":[12,27,3,3]}'>title 1.1</h3>\n<h4 id=\"title_1.1.1\" data-parsoid='{\"dsr\":[28,47,4,4]}'>title 1.1.1</h4>\n<h3 id=\"title_1.2\" data-parsoid='{\"dsr\":[48,63,3,3]}'>title 1.2</h3>\n<h2 id=\"title_2\" data-parsoid='{\"dsr\":[64,75,2,2]}'>title 2</h2>\n<h3 id=\"title_2.1\" data-parsoid='{\"dsr\":[76,91,3,3]}'>title 2.1</h3>");
add("wt2html", "TOC with wgMaxTocLevel=3 and two level four headings (T8204)", "<h2 id=\"Section_1\" data-parsoid='{\"dsr\":[0,13,2,2]}'>Section 1</h2>\n<h3 id=\"Section_1.1\" data-parsoid='{\"dsr\":[14,31,3,3]}'>Section 1.1</h3>\n<h4 id=\"Section_1.1.1\" data-parsoid='{\"dsr\":[32,53,4,4]}'>Section 1.1.1</h4>\n<h4 id=\"Section_1.1.1.1\" data-parsoid='{\"dsr\":[54,77,4,4]}'>Section 1.1.1.1</h4>\n<h2 id=\"Section_2\" data-parsoid='{\"dsr\":[78,91,2,2]}'>Section 2</h2>");
add("wt2html", "TOC regression (T14077)", "<meta property=\"mw:PageProp/toc\" data-parsoid='{\"src\":\"__TOC__\",\"magicSrc\":\"__TOC__\",\"dsr\":[0,7,null,null]}'/>\n<h2 id=\"title_1\" data-parsoid='{\"dsr\":[8,19,2,2]}'>title 1</h2>\n<h3 id=\"title_1.1\" data-parsoid='{\"dsr\":[20,35,3,3]}'>title 1.1</h3>\n<h2 id=\"title_2\" data-parsoid='{\"dsr\":[36,47,2,2]}'>title 2</h2>");
add("wt2html", "(T21451) Links should refer to the normalized form.", "<p data-parsoid='{\"dsr\":[0,64,0,0]}'><a rel=\"mw:WikiLink\" href=\"./אַ\" title=\"אַ\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./אַ\"},\"sa\":{\"href\":\"&amp;#xFB2E;\"},\"dsr\":[0,12,2,2]}'>אַ</a>\n<a rel=\"mw:WikiLink\" href=\"./אַ\" title=\"אַ\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./אַ\"},\"sa\":{\"href\":\"&amp;#x5d0;&amp;#x5b7;\"},\"dsr\":[13,31,2,2]}'>אַ</a>\n<a rel=\"mw:WikiLink\" href=\"./אַ\" title=\"אַ\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./אַ\"},\"sa\":{\"href\":\"&amp;#x5d0;ַ\"},\"dsr\":[32,44,2,2]}'>אַ</a>\n<a rel=\"mw:WikiLink\" href=\"./אַ\" title=\"אַ\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./אַ\"},\"sa\":{\"href\":\"א&amp;#x5b7;\"},\"dsr\":[45,57,2,2]}'>אַ</a>\n<a rel=\"mw:WikiLink\" href=\"./אַ\" title=\"אַ\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./אַ\"},\"sa\":{\"href\":\"אַ\"},\"dsr\":[58,64,2,2]}'>אַ</a></p>");
add("wt2html", "T4304: HTML attribute safety (unsafe breakout parameter; 2309)", "<div style=\"float: right; >alert(document.cookie)\" about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"stx\":\"html\",\"a\":{\"style\":\"float: right; >alert(document.cookie)\"},\"sa\":{\"style\":\"float: right; {{{1}}}\"},\"dsr\":[0,55,null,null],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"div style\",\"href\":\"./Template:Div_style\"},\"params\":{\"1\":{\"wt\":\"\\\">&lt;script>alert(document.cookie)&lt;/script>\"}},\"i\":0}}]}'>Magic div</div>");
add("wt2html", "T4304: HTML attribute safety (unsafe breakout parameter 2; 2309)", "<div style=\"float: right; >alert(document.cookie)\" about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"stx\":\"html\",\"a\":{\"style\":\"float: right; >alert(document.cookie)\"},\"sa\":{\"style\":\"float: right; {{{1}}}\"},\"dsr\":[0,56,null,null],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"div style\",\"href\":\"./Template:Div_style\"},\"params\":{\"1\":{\"wt\":\"\\\" >&lt;script>alert(document.cookie)&lt;/script>\"}},\"i\":0}}]}'>Magic div</div>");
add("wt2html", "CSS line continuation 2", "<div style=\"/* insecure input */\" data-parsoid='{\"stx\":\"html\",\"a\":{\"style\":\"/* insecure input */\"},\"sa\":{\"style\":\"background-image: u\\\\&amp;#13;rl(test.jpg); \"},\"dsr\":[0,59,53,6]}'></div>");
add("wt2html", "Sanitizer: Validating that <meta> and <link> work, but only for Microdata", "<div itemscope=\"\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,308,15,6]}'>\n\t<p data-parsoid='{\"dsr\":[17,301,0,0]}'>&lt;meta itemprop=\"hello\" content=\"world\">\n\t&lt;meta http-equiv=\"refresh\" content=\"5\">\n\t&lt;meta itemprop=\"hello\" http-equiv=\"refresh\" content=\"5\">\n\t&lt;link itemprop=\"hello\" href=\"{{SERVER}}\">\n\t&lt;link rel=\"stylesheet\" href=\"{{SERVER}}\">\n\t&lt;link rel=\"stylesheet\" itemprop=\"hello\" href=\"{{SERVER}}\"></p>\n</div>");
add("wt2html", "Inline HTML vs wiki block nesting", "<p data-parsoid='{\"dsr\":[0,17,0,0]}'><b data-parsoid='{\"stx\":\"html\",\"autoInsertedEnd\":true,\"dsr\":[0,17,3,0]}'>Bold paragraph</b></p><b data-parsoid='{\"stx\":\"html\",\"autoInsertedEnd\":true,\"autoInsertedStart\":true,\"dsr\":[17,37,0,0]}'>\n\n<p data-parsoid='{\"dsr\":[19,37,0,0]}'>New wiki paragraph</p></b>");
add("wt2html", "Special page transclusion", "<p data-parsoid='{\"dsr\":[0,30,0,0]}'><span about=\"#mwt2\" typeof=\"mw:Error mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[0,30,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"Special:Prefixindex/Xyzzyx\",\"href\":\"./Special:PrefixIndex/Xyzzyx\"},\"params\":{},\"errors\":[{\"key\":\"mw-api-tplfetch-error\",\"message\":\"Page / template fetching disabled, and no cache for Special:PrefixIndex/Xyzzyx\"}],\"i\":0}}]}'>{{Special:Prefixindex/Xyzzyx}}</span></p>");
add("wt2html", "Special page transclusion twice (T7021)", "<p data-parsoid='{\"dsr\":[0,61,0,0]}'><span about=\"#mwt2\" typeof=\"mw:Error mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[0,30,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"Special:Prefixindex/Xyzzyx\",\"href\":\"./Special:PrefixIndex/Xyzzyx\"},\"params\":{},\"errors\":[{\"key\":\"mw-api-tplfetch-error\",\"message\":\"Page / template fetching disabled, and no cache for Special:PrefixIndex/Xyzzyx\"}],\"i\":0}}]}'>{{Special:Prefixindex/Xyzzyx}}</span>\n<span about=\"#mwt4\" typeof=\"mw:Error mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[31,61,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"Special:Prefixindex/Xyzzyx\",\"href\":\"./Special:PrefixIndex/Xyzzyx\"},\"params\":{},\"errors\":[{\"key\":\"mw-api-tplfetch-error\",\"message\":\"Page / template fetching disabled, and no cache for Special:PrefixIndex/Xyzzyx\"}],\"i\":0}}]}'>{{Special:Prefixindex/Xyzzyx}}</span></p>");
add("wt2html", "Transclusion of default MediaWiki message", "<p data-parsoid='{\"dsr\":[0,22,0,0]}'><span about=\"#mwt2\" typeof=\"mw:Error mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[0,22,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"MediaWiki:Mainpage\",\"href\":\"./MediaWiki:Mainpage\"},\"params\":{},\"errors\":[{\"key\":\"mw-api-tplfetch-error\",\"message\":\"Page / template fetching disabled, and no cache for MediaWiki:Mainpage\"}],\"i\":0}}]}'>{{MediaWiki:Mainpage}}</span></p>");
add("wt2html", "Transclusion of nonexistent MediaWiki message", "<p data-parsoid='{\"dsr\":[0,25,0,0]}'><span about=\"#mwt2\" typeof=\"mw:Error mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[0,25,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"MediaWiki:Mainpagexxx\",\"href\":\"./MediaWiki:Mainpagexxx\"},\"params\":{},\"errors\":[{\"key\":\"mw-api-tplfetch-error\",\"message\":\"Page / template fetching disabled, and no cache for MediaWiki:Mainpagexxx\"}],\"i\":0}}]}'>{{MediaWiki:Mainpagexxx}}</span></p>");
add("wt2html", "Transclusion of MediaWiki message with underscore", "<p data-parsoid='{\"dsr\":[0,27,0,0]}'><span about=\"#mwt2\" typeof=\"mw:Error mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[0,27,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"MediaWiki:history_short\",\"href\":\"./MediaWiki:History_short\"},\"params\":{},\"errors\":[{\"key\":\"mw-api-tplfetch-error\",\"message\":\"Page / template fetching disabled, and no cache for MediaWiki:History_short\"}],\"i\":0}}]}'>{{MediaWiki:history_short}}</span></p>");
add("wt2html", "Transclusion of MediaWiki message with space", "<p data-parsoid='{\"dsr\":[0,27,0,0]}'><span about=\"#mwt2\" typeof=\"mw:Error mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[0,27,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"MediaWiki:history short\",\"href\":\"./MediaWiki:History_short\"},\"params\":{},\"errors\":[{\"key\":\"mw-api-tplfetch-error\",\"message\":\"Page / template fetching disabled, and no cache for MediaWiki:History_short\"}],\"i\":0}}]}'>{{MediaWiki:history short}}</span></p>");
add("wt2html", "Special:Search page linking.", "<p data-parsoid='{\"dsr\":[0,18,0,0]}'><span about=\"#mwt2\" typeof=\"mw:Error mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[0,18,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"Special:search\",\"href\":\"./Special:Search\"},\"params\":{},\"errors\":[{\"key\":\"mw-api-tplfetch-error\",\"message\":\"Page / template fetching disabled, and no cache for Special:Search\"}],\"i\":0}}]}'>{{Special:search}}</span></p>");
add("wt2html", "Say the magic word", "<ul data-parsoid='{\"dsr\":[0,522,0,0]}'><li data-parsoid='{\"dsr\":[0,13,1,0]}'><span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[1,13,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"PAGENAME\",\"function\":\"pagename\"},\"params\":{},\"i\":0}}]}'>Parser test</span></li>\n<li data-parsoid='{\"dsr\":[14,28,1,0]}'><span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[15,28,null,null],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"PAGENAMEE\",\"function\":\"pagenamee\"},\"params\":{},\"i\":0}}]}'></span></li>\n<li data-parsoid='{\"dsr\":[29,46,1,0]}'><span about=\"#mwt3\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[30,46,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"FULLPAGENAME\",\"function\":\"fullpagename\"},\"params\":{},\"i\":0}}]}'>Parser test</span></li>\n<li data-parsoid='{\"dsr\":[47,65,1,0]}'><span about=\"#mwt4\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[48,65,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"FULLPAGENAMEE\",\"function\":\"fullpagenamee\"},\"params\":{},\"i\":0}}]}'>Parser test</span></li>\n<li data-parsoid='{\"dsr\":[66,83,1,0]}'><span about=\"#mwt5\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[67,83,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"BASEPAGENAME\",\"function\":\"basepagename\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_basepagename missing in Parsoid.</span></li>\n<li data-parsoid='{\"dsr\":[84,102,1,0]}'><span about=\"#mwt6\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[85,102,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"BASEPAGENAMEE\",\"function\":\"basepagenamee\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_basepagenamee missing in Parsoid.</span></li>\n<li data-parsoid='{\"dsr\":[103,119,1,0]}'><span about=\"#mwt7\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[104,119,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"SUBPAGENAME\",\"function\":\"subpagename\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_subpagename missing in Parsoid.</span></li>\n<li data-parsoid='{\"dsr\":[120,137,1,0]}'><span about=\"#mwt8\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[121,137,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"SUBPAGENAMEE\",\"function\":\"subpagenamee\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_subpagenamee missing in Parsoid.</span></li>\n<li data-parsoid='{\"dsr\":[138,155,1,0]}'><span about=\"#mwt9\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[139,155,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"ROOTPAGENAME\",\"function\":\"rootpagename\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_rootpagename missing in Parsoid.</span></li>\n<li data-parsoid='{\"dsr\":[156,174,1,0]}'><span about=\"#mwt10\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[157,174,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"ROOTPAGENAMEE\",\"function\":\"rootpagenamee\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_rootpagenamee missing in Parsoid.</span></li>\n<li data-parsoid='{\"dsr\":[175,192,1,0]}'><span about=\"#mwt11\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[176,192,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"TALKPAGENAME\",\"function\":\"talkpagename\"},\"params\":{},\"i\":0}}]}'>Parser test</span></li>\n<li data-parsoid='{\"dsr\":[193,211,1,0]}'><span about=\"#mwt12\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[194,211,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"TALKPAGENAMEE\",\"function\":\"talkpagenamee\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_talkpagenamee missing in Parsoid.</span></li>\n<li data-parsoid='{\"dsr\":[212,232,1,0]}'><span about=\"#mwt13\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[213,232,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"SUBJECTPAGENAME\",\"function\":\"subjectpagename\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_subjectpagename missing in Parsoid.</span></li>\n<li data-parsoid='{\"dsr\":[233,254,1,0]}'><span about=\"#mwt14\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[234,254,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"SUBJECTPAGENAMEE\",\"function\":\"subjectpagenamee\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_subjectpagenamee missing in Parsoid.</span></li>\n<li data-parsoid='{\"dsr\":[255,270,1,0]}'><span about=\"#mwt15\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[256,270,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"NAMESPACEE\",\"function\":\"namespacee\"},\"params\":{},\"i\":0}}]}'>Main</span></li>\n<li data-parsoid='{\"dsr\":[271,285,1,0]}'><span about=\"#mwt16\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[272,285,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"NAMESPACE\",\"function\":\"namespace\"},\"params\":{},\"i\":0}}]}'>Main</span></li>\n<li data-parsoid='{\"dsr\":[286,306,1,0]}'><span about=\"#mwt17\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[287,306,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"NAMESPACENUMBER\",\"function\":\"namespacenumber\"},\"params\":{},\"i\":0}}]}'>0</span></li>\n<li data-parsoid='{\"dsr\":[307,321,1,0]}'><span about=\"#mwt18\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[308,321,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"TALKSPACE\",\"function\":\"talkspace\"},\"params\":{},\"i\":0}}]}'>Talk</span></li>\n<li data-parsoid='{\"dsr\":[322,337,1,0]}'><span about=\"#mwt19\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[323,337,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"TALKSPACEE\",\"function\":\"talkspacee\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_talkspacee missing in Parsoid.</span></li>\n<li data-parsoid='{\"dsr\":[338,355,1,0]}'><span about=\"#mwt20\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[339,355,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"SUBJECTSPACE\",\"function\":\"subjectspace\"},\"params\":{},\"i\":0}}]}'>Main</span></li>\n<li data-parsoid='{\"dsr\":[356,374,1,0]}'><span about=\"#mwt21\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[357,374,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"SUBJECTSPACEE\",\"function\":\"subjectspacee\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_subjectspacee missing in Parsoid.</span></li>\n<li data-parsoid='{\"dsr\":[375,522,1,0]}'><span about=\"#mwt30\" typeof=\"mw:Error mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"},{\"k\":\"2\"},{\"k\":\"3\"},{\"k\":\"4\"},{\"k\":\"5\"},{\"k\":\"6\"},{\"k\":\"7\"}]],\"dsr\":[376,522,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"Dynamic\",\"href\":\"./Template:Dynamic\"},\"params\":{\"1\":{\"wt\":\"{{NUMBEROFUSERS}}\"},\"2\":{\"wt\":\"{{NUMBEROFPAGES}}\"},\"3\":{\"wt\":\"{{CURRENTVERSION}}\"},\"4\":{\"wt\":\"{{CONTENTLANGUAGE}}\"},\"5\":{\"wt\":\"{{DIRECTIONMARK}}\"},\"6\":{\"wt\":\"{{CURRENTTIMESTAMP}}\"},\"7\":{\"wt\":\"{{NUMBEROFARTICLES}}\"}},\"errors\":[{\"key\":\"mw-api-tplfetch-error\",\"message\":\"Page / template fetching disabled, and no cache for Template:Dynamic\"}],\"i\":0}}]}'>{{Dynamic|{{NUMBEROFUSERS}}|{{NUMBEROFPAGES}}|{{CURRENTVERSION}}|{{CONTENTLANGUAGE}}|{{DIRECTIONMARK}}|{{CURRENTTIMESTAMP}}|{{NUMBEROFARTICLES}}}}</span></li></ul>");
add("wt2html", "Illegal character references (T106578)", "<dl data-parsoid='{\"dsr\":[0,167,0,0]}'><dt data-parsoid='{\"dsr\":[0,6,1,0]}'>Null</dt><dd data-parsoid='{\"stx\":\"row\",\"dsr\":[6,13,1,0]}'><span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;#00;\",\"srcContent\":\"�\",\"dsr\":[8,13,null,null]}'>�</span></dd>\n<dt data-parsoid='{\"dsr\":[14,18,1,0]}'>FF</dt><dd data-parsoid='{\"stx\":\"row\",\"dsr\":[18,25,1,0]}'><span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;#xC;\",\"srcContent\":\"\\f\",\"dsr\":[20,25,null,null]}'>\f</span></dd>\n<dt data-parsoid='{\"dsr\":[26,30,1,0]}'>CR</dt><dd data-parsoid='{\"stx\":\"row\",\"dsr\":[30,37,1,0]}'><span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;#xD;\",\"srcContent\":\"\\r\",\"dsr\":[32,37,null,null]}'>\r</span></dd>\n<dt data-parsoid='{\"dsr\":[38,53,1,0]}'>Control (low)</dt><dd data-parsoid='{\"stx\":\"row\",\"dsr\":[53,59,1,0]}'><span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;#8;\",\"srcContent\":\"\\b\",\"dsr\":[55,59,null,null]}'>\b</span></dd>\n<dt data-parsoid='{\"dsr\":[60,76,1,0]}'>Control (high)</dt><dd data-parsoid='{\"stx\":\"row\",\"dsr\":[76,91,1,0]}'><span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;#x7F;\",\"srcContent\":\"\",\"dsr\":[78,84,null,null]}'></span> <span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;#x9F;\",\"srcContent\":\"Ÿ\",\"dsr\":[85,91,null,null]}'>Ÿ</span></dd>\n<dt data-parsoid='{\"dsr\":[92,103,1,0]}'>Surrogate</dt><dd data-parsoid='{\"stx\":\"row\",\"dsr\":[103,121,1,0]}'><span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;#xD83D;\",\"srcContent\":\"�\",\"dsr\":[105,113,null,null]}'>�</span><span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;#xDCA9;\",\"srcContent\":\"�\",\"dsr\":[113,121,null,null]}'>�</span></dd>\n<dt data-parsoid='{\"dsr\":[122,156,1,0]}'>This is an okay astral character</dt><dd data-parsoid='{\"stx\":\"row\",\"dsr\":[156,167,1,0]}'><span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;#x1F4A9;\",\"srcContent\":\"💩\",\"dsr\":[158,167,null,null]}'>💩</span></dd></dl>");
add("wt2html", "Parents of subpages, one level up, not named", "<p data-parsoid='{\"dsr\":[0,7,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Subpage_test/L1/L2\" title=\"Subpage test/L1/L2\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Subpage_test/L1/L2\"},\"sa\":{\"href\":\"../\"},\"dsr\":[0,7,2,2]}'>Subpage_test/L1/L2</a></p>");
add("wt2html", "Parents of subpages, two levels up, with lots of extra trailing slashes.", "<p data-parsoid='{\"dsr\":[0,14,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Subpage_test/L1\" title=\"Subpage test/L1\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Subpage_test/L1\"},\"sa\":{\"href\":\"../../////\"},\"dsr\":[0,14,2,2]}'>Subpage_test/L1</a></p>");
add("wt2html", "RAW magic word", "<p data-parsoid='{\"dsr\":[0,14,0,0]}'><span about=\"#mwt2\" typeof=\"mw:Error mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[0,14,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"RAW:QUERTY\",\"href\":\"./Template:RAW:QUERTY\"},\"params\":{},\"errors\":[{\"key\":\"mw-api-tplfetch-error\",\"message\":\"Page / template fetching disabled, and no cache for Template:RAW:QUERTY\"}],\"i\":0}}]}'>{{RAW:QUERTY}}</span></p>");
add("wt2html", "Out-of-order TOC heading levels", "<h2 id=\"2\" data-parsoid='{\"dsr\":[0,5,2,2]}'>2</h2>\n<h6 id=\"6\" data-parsoid='{\"dsr\":[6,19,6,6]}'>6</h6>\n<h3 id=\"3\" data-parsoid='{\"dsr\":[20,27,3,3]}'>3</h3>\n<h1 id=\"1\" data-parsoid='{\"dsr\":[28,31,1,1]}'>1</h1>\n<h5 id=\"5\" data-parsoid='{\"dsr\":[32,43,5,5]}'>5</h5>\n<h2 id=\"2_2\" data-parsoid='{\"dsr\":[44,49,2,2]}'>2</h2>");
add("wt2html", "T2529: Uncovered bullet in parser function result", "<ul data-parsoid='{\"dsr\":[0,23,0,0]}'><li data-parsoid='{\"dsr\":[0,23,1,0]}'>Foo <span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[5,23,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"lc:{{bullet}} \",\"function\":\"lc\"},\"params\":{},\"i\":0}}]}'>bar</span></li></ul>");
add("wt2html", "T7678: Double-parsed template invocation", "<p about=\"#mwt3\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,42,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"lc:{{paramtest {{!}} param = hello }} \",\"function\":\"lc\"},\"params\":{},\"i\":0}}]}'>{{paramtest param = hello }}</p>");
add("wt2html", "formatdate parser function", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,26,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#formatdate:2009-03-24\",\"function\":\"formatdate\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_formatdate missing in Parsoid.</p>");
add("wt2html", "formatdate parser function, with default format", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,30,0,0],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#formatdate:2009-03-24\",\"function\":\"formatdate\"},\"params\":{\"1\":{\"wt\":\"mdy\"}},\"i\":0}}]}'>Parser function implementation for pf_formatdate missing in Parsoid.</p>");
add("wt2html", "Spacing of numbers in formatted dates", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,26,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#formatdate:January 15\",\"function\":\"formatdate\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_formatdate missing in Parsoid.</p>");
add("wt2html", "formatdate parser function, with default format and on a page of which the content language is always English and different from the wiki content language", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,30,0,0],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#formatdate:2009-03-24\",\"function\":\"formatdate\"},\"params\":{\"1\":{\"wt\":\"dmy\"}},\"i\":0}}]}'>Parser function implementation for pf_formatdate missing in Parsoid.</p>");
add("wt2html", "Bad images - basic functionality", "<p data-parsoid='{\"dsr\":[0,16,0,0]}'><figure-inline class=\"mw-default-size\" typeof=\"mw:Error mw:Image\" data-parsoid='{\"optList\":[],\"dsr\":[0,16,null,null]}' data-mw='{\"errors\":[{\"key\":\"apierror-filedoesnotexist\",\"message\":\"This image does not exist.\"}]}'><a href=\"./File:Bad.jpg\" data-parsoid='{\"a\":{\"href\":\"./File:Bad.jpg\"},\"sa\":{\"href\":\"File:Bad.jpg\"}}'><img resource=\"./File:Bad.jpg\" src=\"./Special:FilePath/Bad.jpg\" height=\"220\" width=\"220\" data-parsoid='{\"a\":{\"resource\":\"./File:Bad.jpg\",\"height\":\"220\",\"width\":\"220\"},\"sa\":{\"resource\":\"File:Bad.jpg\"}}'/></a></figure-inline></p>");
add("wt2html", "Bad images - T18039: text after bad image disappears", "<p data-parsoid='{\"dsr\":[0,32,0,0]}'>Foo bar\n<figure-inline class=\"mw-default-size\" typeof=\"mw:Error mw:Image\" data-parsoid='{\"optList\":[],\"dsr\":[8,24,null,null]}' data-mw='{\"errors\":[{\"key\":\"apierror-filedoesnotexist\",\"message\":\"This image does not exist.\"}]}'><a href=\"./File:Bad.jpg\" data-parsoid='{\"a\":{\"href\":\"./File:Bad.jpg\"},\"sa\":{\"href\":\"File:Bad.jpg\"}}'><img resource=\"./File:Bad.jpg\" src=\"./Special:FilePath/Bad.jpg\" height=\"220\" width=\"220\" data-parsoid='{\"a\":{\"resource\":\"./File:Bad.jpg\",\"height\":\"220\",\"width\":\"220\"},\"sa\":{\"resource\":\"File:Bad.jpg\"}}'/></a></figure-inline>\nBar foo</p>");
add("wt2html", "T33098 Template which includes system messages which includes the template", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,13,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"Identical\",\"href\":\"./Template:Identical\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_int missing in Parsoid.\nParser function implementation for pf_int missing in Parsoid.</p>");
add("wt2html", "T33490 Turkish: ucfirst 'ix'", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,14,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"ucfirst:ix\",\"function\":\"ucfirst\"},\"params\":{},\"i\":0}}]}'>Ix</p>");
add("wt2html", "T33490 Turkish: ucfırst (with a dotless i)", "<p data-parsoid='{\"dsr\":[0,16,0,0]}'><span about=\"#mwt2\" typeof=\"mw:Error mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[0,16,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"ucfırst:blah\",\"href\":\"./Şablon:Ucfırst:blah\"},\"params\":{},\"errors\":[{\"key\":\"mw-api-tplfetch-error\",\"message\":\"Page / template fetching disabled, and no cache for Şablon:Ucfırst:blah\"}],\"i\":0}}]}'>{{ucfırst:blah}}</span></p>");
add("wt2html", "T33490 ucfırst (with a dotless i) with English language", "<p data-parsoid='{\"dsr\":[0,16,0,0]}'><span about=\"#mwt2\" typeof=\"mw:Error mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[0,16,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"ucfırst:blah\",\"href\":\"./Template:Ucfırst:blah\"},\"params\":{},\"errors\":[{\"key\":\"mw-api-tplfetch-error\",\"message\":\"Page / template fetching disabled, and no cache for Template:Ucfırst:blah\"}],\"i\":0}}]}'>{{ucfırst:blah}}</span></p>");
add("wt2html", "T34057: Title needed when expanding <h> nodes.", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,14,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"int:T34057\",\"function\":\"int\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_int missing in Parsoid.</p>");
add("wt2html", "Check noCommafy in formatNum", "<p data-parsoid='{\"dsr\":[0,53,0,0]}'><span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[0,23,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"formatnum:123456.78\",\"function\":\"formatnum\"},\"params\":{},\"i\":0}}]}'>123456.78</span>\n<span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[24,53,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"formatnum:123456.78\",\"function\":\"formatnum\"},\"params\":{\"1\":{\"wt\":\"NOSEP\"}},\"i\":0}}]}'>123456.78</span></p>");
add("wt2html", "Wrong option for formatNum (T58199)", "<p data-parsoid='{\"dsr\":[0,126,0,0]}'><span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[0,29,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"formatnum:1,234.56\",\"function\":\"formatnum\"},\"params\":{\"1\":{\"wt\":\"Random\"}},\"i\":0}}]}'>1,234.56</span>\n<span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[30,63,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"formatnum:1,234.56\",\"function\":\"formatnum\"},\"params\":{\"1\":{\"wt\":\"EVERYTHING\"}},\"i\":0}}]}'>1,234.56</span>\n<span about=\"#mwt3\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[64,126,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"formatnum:1234.56\",\"function\":\"formatnum\"},\"params\":{\"1\":{\"wt\":\"any argument that has the string &apos;NOSEP&apos;\"}},\"i\":0}}]}'>1234.56</span></p>");
add("wt2html", "Strip marker in grammar", "<p about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,35,0,0],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"grammar:elative\",\"function\":\"grammar\"},\"params\":{\"1\":{\"wt\":\"foo&lt;nowiki/>bar\"}},\"i\":0}}]}'>Parser function implementation for pf_grammar missing in Parsoid.</p>");
add("wt2html", "Language parser function", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,16,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#language:ar\",\"function\":\"language\"},\"params\":{},\"i\":0}}]}'>ar</p>");
add("wt2html", "Special parser function", "<p data-parsoid='{\"dsr\":[0,65,0,0]}'><span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[0,23,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#special:RandomPage\",\"function\":\"special\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_special missing in Parsoid.</span>\n<span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[24,45,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#special:BaDtItLe\",\"function\":\"special\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_special missing in Parsoid.</span>\n<span about=\"#mwt3\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[46,65,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#special:Foobar\",\"function\":\"special\"},\"params\":{},\"i\":0}}]}'>Parser function implementation for pf_special missing in Parsoid.</span></p>");
add("wt2html", "1. SOL-sensitive wikitext tokens as template-args", "<p data-parsoid='{\"dsr\":[0,35,0,0]}'><span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[0,11,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"*a\"}},\"i\":0}}]}'>*a</span>\n<span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[12,23,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"#a\"}},\"i\":0}}]}'>#a</span>\n<span about=\"#mwt3\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[24,35,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\":a\"}},\"i\":0}}]}'>:a</span></p>");
add("wt2html", "Empty table rows go away", "<table data-parsoid='{\"dsr\":[0,37,2,2]}'>\n<tbody data-parsoid='{\"dsr\":[3,35,0,0]}'><tr data-parsoid='{\"autoInsertedStart\":true,\"dsr\":[3,16,0,0]}'><td data-parsoid='{\"dsr\":[3,9,1,0]}'>Hello</td>\n<td data-parsoid='{\"dsr\":[10,16,1,0]}'>there</td></tr>\n<tr class=\"foo\" data-parsoid='{\"startTagSrc\":\"|-\",\"dsr\":[17,31,14,0]}'></tr>\n<tr class=\"mw-empty-elt\" data-parsoid='{\"startTagSrc\":\"|-\",\"dsr\":[32,34,2,0]}'></tr>\n</tbody></table>");
// Blacklist for wt2wt
add("wt2wt", "Quote balancing context should be restricted to td/th cells on the same wikitext line", "{|\n!''a''!!''b''\n|''a''||''b''\n|}");
add("wt2wt", "Non-word characters don't terminate tag names", "<blockquote|>a\n\n<b→> doesn't terminate </b→>\n\n<bä> doesn't terminate </bä>\n\n<boo> doesn't terminate </boo>\n\n<s.foo> doesn't terminate </s.foo>\n\n<sub-ID#1>");
add("wt2wt", "Templates: Indent-Pre: 1f: Wrapping should be based on expanded content", "{{echo| }}a\n\n{{echo|\n }}a\n\n{{echo|\n b}}\n\n{{echo|a\n }}b\n\n{{echo|a\n}}\n b\n");
add("wt2wt", "Templates: Handle comments in the target", "{{echo\n<!-- should be ignored -->\n|foo}}\n\n{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}\n\n{{echo<!-- should be ignored -->\n|foo}}\n\n{{echo<!-- should be ignored -->|foo}}\n\n{{echo|foo}}");
add("wt2wt", "Definition lists: self-closed tag", ";one<br />two :two-line fun");
add("wt2wt", "Definition lists: ignore colons inside tags", ";one <b>two : tag <i>fun:</i>:</b><nowiki>:def</nowiki>");
add("wt2wt", "Definition lists: excess closed tags", ";onetwo :bad tag fun");
add("wt2wt", "Definition Lists: Hacky use to indent tables", "::{|\n|foo\n|bar\n|}\n\nthis text\nshould be left alone");
add("wt2wt", "Definition Lists: Hacky use to indent tables, with comments (T65979)", "<!-- foo -->\n::{|\n|foo\n|bar\n|}<!-- bar -->\n\nthis text\nshould be left alone");
add("wt2wt", "Definition Lists: Hacky use to indent tables (WS-insensitive)", ":{|\n|a\n|}");
add("wt2wt", "Definition Lists: Mixed Lists: Test 13", "*#*#;*;;foo :bar\n*#*#;boo :baz\n");
add("wt2wt", "Definition Lists: colons occurring in tags", ";a:b\n;'''a:b'''\n;<i>a:b</i>\n;<span>a:b</span>\n;<div>a:b</div>\n;<div>a\n:b\n;{{echo|a:b}}\n;{{echo|''a:b''}}\n;;;''a:b''\n");
add("wt2wt", "T2289: \">\"-token in bracketed URL", "[http://www.example.com/ <hello> stuff]");
add("wt2wt", "T2289: literal \">\"-token in bracketed URL", "[http://www.example.com/ <b>html</b> stuff]");
add("wt2wt", "T2289: literal double quote in bracketed URL", "[http://www.example.com/ \"hello\" stuff]");
add("wt2wt", "External links: multiple legal whitespace is fine, Magnus. Don't break it please. (T7081)", "[http://www.example.com test]");
add("wt2wt", "T4702: Mismatched <i>, <b> and <a> tags are invalid", "''[http://example.com text''<nowiki/>'']''\n[http://example.com '''text''']'''<nowiki/>'''\n''Something [http://example.com in italic''<nowiki/>'']''\n''Something [http://example.com mixed''''', even bold''''']'''\n'''''Now [http://example.com both'''''<nowiki/>''''']'''''");
add("wt2wt", "External link containing double-single-quotes with no space separating the url from text in italics", "[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm ''La muerte de Casagemas'' (1901) en el sitio de ][[Museo Picasso (París)|Museo Picasso]].");
add("wt2wt", "Unclosed and unmatched quotes", "'''''Bold italic text '''with bold deactivated''' in between.'''''\n\n'''''Bold italic text ''with italic deactivated'' in between.'''''\n\n'''Bold text..'''\n\n..spanning two paragraphs (should not work).'''<nowiki/>'''\n\n'''Bold tag left open'''\n\n''Italic tag left open''\n\nNormal text.\n\n<!-- Unmatching number of opening, closing tags: -->\n'''This year'<nowiki/>'''s election ''should'' beat '''last year''''s.\n\n''Tom'''s car is bigger than '''''<nowiki/>'''Susan'''s.\n\nPlain ''italic'''s plain");
add("wt2wt", "A table with captions with non-default spaced attributes and a table row", "{|\n|+ style=\"color: red;\" |caption2\n|+ style=\"color: red;\" |caption3\n|-\n|foo\n|}");
add("wt2wt", "Table td-cell syntax variations", "{|\n| foo bar |baz\n|foo bar foo||baz\n| style=\"color:red;\" |baz\n|style='color:red;'||baz\n|}");
add("wt2wt", "Accept \"| !\" at start of line in tables (ignore !-attribute)", "{|\n|-\n| !style=\"color:red\" |bar\n|}");
add("wt2wt", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- ", "{|\n|-\n| style=\"color:red;\" |+1\n| style=\"color:blue;\" |-1\n|-\n|1||2||3\n|1||+2||-3\n|-\n|<nowiki>+1</nowiki>\n|<nowiki>-1</nowiki>\n|}");
add("wt2wt", "Table rowspan", "{| border=\"1\"\n|Cell 1, row 1\n| rowspan=\"2\" |Cell 2, row 1 (and 2)\n|Cell 3, row 1\n|-\n|Cell 1, row 2\n|Cell 3, row 2\n|}");
add("wt2wt", "Nested table", "{| border=\"1\"\n|&alpha;\n|\n{| bgcolor=\"#ABCDEF\" border=\"2\"\n|nested\n|-\n|table\n|}\n|the original table again\n|}");
add("wt2wt", "Invalid attributes in table cell (T3830)", "{|\n| Cell: |broken\n|}");
add("wt2wt", "Table cell attributes: Pipes protected by nowikis should be treated as a plain character", "{|\n| title=\"foo\" |bar\n| title=\"foo<nowiki>|</nowiki>\" |bar\n|title=\"foo<nowiki>|</nowiki>\" bar\n|}");
add("wt2wt", "Build table with {{!}}", "{{{!}} class=\"wikitable\"\n!header\n!second header\n{{!}}- style=\"color:red;\"\n{{!}}data{{!}}{{!}} style=\"color:red;\"{{!}}second data\n{{!}}}");
add("wt2wt", "Build table with pipe as data", "{| class=\"wikitable\"\n!header\n!second header\n|- style=\"color:red;\"\n|data|| style=\"color:red;\" |second data\n|-\n| style=\"color:red;\" |<nowiki>data with |</nowiki>|| style=\"color:red;\" |second data with |\n|-\n||<nowiki>data with |</nowiki>|||second data with |\n|}");
add("wt2wt", "Parsoid: Row-syntax table headings followed by comment & table cells", "{|\n!foo||bar\n<!-- foo -->||baz||quux\n|}");
add("wt2wt", "Piped link with multiple pipe characters in link text", "[[Main Page|<nowiki>|The|Main|Page|</nowiki>]]");
add("wt2wt", "<nowiki> inside a link", "[[Main<nowiki> Page</nowiki><nowiki>]] </nowiki>[[Main Page|the main page <nowiki>[it's not very good]</nowiki>]]");
add("wt2wt", "Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved", "[[Foo| bar]]\n\n[[Foo| ''bar'']]\n\n[http://wp.org foo]\n\n[http://wp.org ''foo'']");
-add("wt2wt", "Handling html with a div self-closing tag", "<div title=\"\" />\n<div title=\"\" />\n<div title=\"\" />\n<div title=\"bar\" />\n<div title=\"bar\" />\n<div title=\"bar/\">");
-add("wt2wt", "Handling html with a br self-closing tag", "<br title=\"\" />\n<br title=\"\" />\n<br title=\"\" />\n<br title=\"bar\" />\n<br title=\"bar\" />\n<br title=\"bar/\">");
+add("wt2wt", "Handling html with a div self-closing tag", "<div title=\"\" />\n<div title=\"\" />\n<div title=\"\">\n<div title=\"bar\" />\n<div title=\"bar\" />\n<div title=\"bar/\">");
+add("wt2wt", "Handling html with a br self-closing tag", "<br title=\"\" />\n<br title=\"\" />\n<br title=\"\">\n<br title=\"bar\" />\n<br title=\"bar\" />\n<br title=\"bar/\">");
add("wt2wt", "Horizontal ruler (should it add that extra space?)", "<hr />\n<hr />\nfoo <hr> bar");
add("wt2wt", "Mixed list", "*Mixed list\n*#with numbers\n**and bullets\n*#and numbers\n*bullets again\n**bullet level 2\n***bullet level 3\n***#Number on level 4\n**bullet level 2\n**#Number on level 3\n**#Number on level 3\n*#number level 2\n*Level 1\n***Level 3\n\n#**Level 3, but ordered\n");
add("wt2wt", "Nested lists 3 (first element empty)", "\n**bar\n");
add("wt2wt", "Nested lists 6 (both elements empty)", "\n**\n");
add("wt2wt", "List interrupted by empty line or heading", "*foo\n\n**bar\n\n==A heading==\n\n*Another list item");
add("wt2wt", "2. List embedded in a formatting tag in a misnested way", "<small>\n\n*a\n*b</small>");
add("wt2wt", "Template with invalid target containing tags", "<nowiki>{{a</nowiki><b>b</b>|{{echo|foo}}|{{echo|a}}={{echo|b}}<nowiki>|a =b}}</nowiki>");
add("wt2wt", "Template with invalid target containing unclosed tag", "<nowiki>{{a</nowiki><b>|{{echo|foo}}|{{echo|a}}={{echo|b}}<nowiki>|a =b}}</nowiki>");
add("wt2wt", "Template with invalid target containing wikilink", "<nowiki>{{</nowiki>[[Main Page]]<nowiki>}}</nowiki>");
add("wt2wt", "Template with just whitespace in it, T70421", "{{echo|{{ }<nowiki>}</nowiki>}}");
add("wt2wt", "Template with argument in separate line", "{{templateasargtest |\n templ = simple }}");
add("wt2wt", "T2553: link with two variables in a piped link", "{|\n|[[{{{1}}}<nowiki>|</nowiki>{{{2}}}]]\n|}");
add("wt2wt", "Abort table cell attribute parsing on wikilink", "{|\n|testing [[one|two]]<nowiki> |three</nowiki>||four\n| testing one two |three||four\n|testing=\"[[one|two]]<nowiki>\" |three</nowiki>||four\n|}");
add("wt2wt", "2. includeonly in html attr value", "<span id=\"<noinclude>v1</noinclude><includeonly>v2</includeonly>\">bar</span>\n<span id=\"<noinclude>&quot;v1&quot;</noinclude><includeonly>&quot;v2&quot;</includeonly>\">bar</span>");
add("wt2wt", "1. Table tag in SOL posn. should get reparsed correctly with valid TSR", "{{echo|}}\n{| width=\"100%\"\n|foo\n|}");
add("wt2wt", "Templates: HTML Tag: 2. Generation of HTML attr. value", "<div style=\"{{echo|'color:red;'}}\">foo</div>");
add("wt2wt", "Templates: HTML Tag: 3. Generation of HTML attr key and value", "<div {{echo|style}}=\"{{echo|'color:red;'}}\">foo</div>");
add("wt2wt", "Templates: HTML Tag: 9. Multiple template-generated attributes", "<div {{echo|1=id=\"v1\" title=\"foo\"}} title=\"foo\">bar</div>");
add("wt2wt", "Templates: HTML Tables: 5. Proper fostering of categories from inside", "[[Category:foo1]]\n<table><tr><td>foo</td></tr></table>\n<!--Two categories (T52330)-->\n[[Category:bar1]]\n[[Category:bar2]]\n<table><tr><td>foo</td></tr></table>");
add("wt2wt", "Allow empty links in image captions (T62753)", "[[File:Foobar.jpg|thumb|Caption [[Link1]]\n<nowiki>[[]]</nowiki>\n[[Link2]]\n]]");
add("wt2wt", "Image with multiple attributes from the same template", "[[File:Foobar.jpg|right|Caption text]]");
add("wt2wt", "Image with multiple widths -- use last", "[[File:Foobar.jpg|300px|caption]]");
add("wt2wt", "Render invalid page names as plain text (T53090)", "[[./../foo|bar]]\n[[foo�|bar]]\n[[foo/.|bar]]\n[[foo/..|bar]]\n<nowiki>[[foo~~~bar]]</nowiki>\n[[foo>bar]]\n[[foo[bar]]\n[[.]]\n[[..]]\n[[foo././bar]]\n[[foo[http://example.com]xyz]]\n\n[[{{echo|./../foo}}|bar]]\n[[{{echo|foo/.}}|bar]]\n[[{{echo|foo/..}}|bar]]\n[[{{echo|foo~~~~bar}}]]\n[[{{echo|foo>bar}}]]\n[[{{echo|foo././bar}}]]\n[[{{echo|foo{bar}}]]\n[[{{echo|foo}bar}}]]\n[[{{echo|foo[bar}}]]\n[[{{echo|foo]bar}}]]\n[[{{echo|foo<bar}}]]");
add("wt2wt", "div with single-quoted attribute", "<div id=\"rock\">HTML rocks</div>");
add("wt2wt", "div with unquoted attribute", "<div id=\"rock\">HTML rocks</div>");
add("wt2wt", "div with illegal double attributes", "<div id=\"b\">HTML rocks</div>");
add("wt2wt", "HTML multiple attributes correction", "<p class=\"awesome\">Awesome!</p>");
add("wt2wt", "Table multiple attributes correction", "{|\n! class=\"awesome\" + |status\n|}");
add("wt2wt", "DIV IN UPPERCASE", "<DIV id=\"x\">HTML ROCKS</DIV>");
add("wt2wt", "Empty attribute crash test single-quotes (T4067)", "<font color=\"\">foo</font>");
add("wt2wt", "Attribute test: unquoted but illegal value (hash)", "<font color=\"#x\">foo</font>");
add("wt2wt", "T4095: link with pipe and three closing brackets, version 2", "[[Main Page|<nowiki>[http://example.com/]</nowiki>]]");
add("wt2wt", "Table attribute legitimate extension", "{|\n! style=\"<nowiki>color:blue</nowiki>\" + |status\n|}");
add("wt2wt", "Table attribute safety", "{|\n! style=\"<nowiki>border-width:expression(0+alert(document.cookie))</nowiki>\" + |status\n|}");
add("wt2wt", "Sanitizer: Validating that <meta> and <link> work, but only for Microdata", "<div itemscope=\"\">\n\t<nowiki><meta itemprop=\"hello\" content=\"world\"></nowiki>\n\t<nowiki><meta http-equiv=\"refresh\" content=\"5\"></nowiki>\n\t<nowiki><meta itemprop=\"hello\" http-equiv=\"refresh\" content=\"5\"></nowiki>\n\t<nowiki><link itemprop=\"hello\" href=\"{{SERVER}}\"></nowiki>\n\t<nowiki><link rel=\"stylesheet\" href=\"{{SERVER}}\"></nowiki>\n\t<nowiki><link rel=\"stylesheet\" itemprop=\"hello\" href=\"{{SERVER}}\"></nowiki>\n</div>");
add("wt2wt", "Fuzz testing: Parser13", "{| \n| http: / a |\n|}");
add("wt2wt", "Fuzz testing: Parser16", "{|\n!https://|| || ||\n|}");
add("wt2wt", "Fuzz testing: Parser21", "{|\n!irc://{{ftp://a\" onmouseover=\"alert('hello world');\"\n|\n|}");
add("wt2wt", "Fuzz testing: Parser22", "http://===r:::https://b\n\n{|\n|}");
add("wt2wt", "Inline wiki vs wiki block nesting", "'''Bold paragraph'''\n\nNew wiki paragraph");
add("wt2wt", "Mixing markup for italics and bold", "'<nowiki/>''bold'<nowiki/>'''''bold''bolditalics'''''");
add("wt2wt", "Illegal character references (T106578)", ";Null:&#00;\n;FF:&#xC;\n;CR:&#x0A;\n;Control (low):&#8;\n;Control (high):&#x7F; &#x9F;\n;Surrogate:&#xD83D;&#xDCA9;\n;This is an okay astral character:&#x1F4A9;");
add("wt2wt", "Don't fall for the self-closing div", "<div>hello world</div>");
add("wt2wt", "Parsing of overlapping (improperly nested) inline html tags", "<span><s>x</span>");
add("wt2wt", "T153140: Don't break table handling if language converter markup is in the cell.", "{|\n|-\n|<nowiki/>-{R|B}-\n|}");
add("wt2wt", "T2529: Uncovered bullet", "*Foo{{bullet}}");
add("wt2wt", "T2529: Uncovered bullet in a deeply nested list", "*******Foo\n{{bullet}}");
add("wt2wt", "HHP2.1: Heuristics for headings in preprocessor parenthetical structures", "<nowiki>{{foo|</nowiki>\n=heading=\n");
add("wt2wt", "HHP2.2: Heuristics for headings in preprocessor parenthetical structures", "<nowiki>{{foo|</nowiki>\n==heading==\n");
add("wt2wt", "Corner case: french spaces in definition list", ";foo :bar");
add("wt2wt", "T21052 U+3000 IDEOGRAPHIC SPACE should terminate bracketed external links", "[http://www.example.org/ ideograms]");
add("wt2wt", "Ignore pipe between table row attributes", "{|\n|quux\n|- id=\"foo\" style=\"color: red\" |\n|bar\n|}");
add("wt2wt", "2. Treebuilder fixup of formatting elt", "'''foo'''\n\n'''[[File:Foobar.jpg|thumb|caption]]'''\n\n'''bar'''\n\n<small>[[Image:Foobar.jpg|right|300px]]</small>");
add("wt2wt", "3. Treebuilder fixup of formatting elt", "<small>'''foo'''\n\n'''[[File:Foobar.jpg|thumb|caption]]'''\n\n'''bar'''</small>");
add("wt2wt", "Trailing newlines in a deep dom-subtree that ends a wikitext line should be migrated out", "{|\n|<small>foo\n\nbar\n|}\n\n{|\n|<small>foo<small>\n|}");
add("wt2wt", "Empty TD followed by TD with tpl-generated attribute", "{|\n|-\n|\n| {{echo|style='color:red'}} |foo\n|}");
add("wt2wt", "Improperly nested inline or quotes tags with whitespace in between", "<span> <s>x</span> </s>\n''' ''x'''''<nowiki/>'' ''");
add("wt2wt", "2. Ensure fostered text content is wrapped in element nodes (traps regressions around fostered marker on the element getting lost)", "<nowiki> </nowiki><nowiki>||</nowiki> <nowiki>||</nowiki>\n<table>\n<tr><td> a\n</table>");
add("wt2wt", "8. Encapsulate foster-parented transclusion content", "{{echo|a\n}}\n{|{{echo|style='color:red'}}\n|-\n|b\n|}\n");
add("wt2wt", "T73074: More fostering fun", "[[Category:Two]]\n<table><td></td></tr>{{echo|<tr>}}<!--c-->[[Category:Two]]");
add("wt2wt", "Image: upright option is ignored on inline and frame images (parsoid)", "[[File:Foobar.jpg|500x500px|caption]]");
add("wt2wt", "T88318: p-wrapped dash in table.", "{|\n!-\n!-\n|-\n|<nowiki>-</nowiki>\n|<nowiki>- </nowiki>\n|-\n|<small>-</small>\n|<br />\n-\n|<br />-\n|}");
add("wt2wt", "Empty LI (T49673)", "*a\n*\n*\n*b");
// Blacklist for html2html
add("html2html", "Extra newlines followed by heading", "<p data-parsoid='{\"dsr\":[0,1,0,0]}'>a</p>\n<p data-parsoid='{\"dsr\":[2,3,0,0]}'>\n<br data-parsoid='{\"dsr\":[3,3,0,0]}'/></p>\n<h1 id=\"b\" data-parsoid='{\"dsr\":[4,9,1,1]}'>b</h1>\n<p data-parsoid='{\"dsr\":[10,54,0,0]}'>[/index.php?title=A&amp;action=edit&amp;redlink=1 a]</p>\n<p data-parsoid='{\"dsr\":[55,56,0,0]}'>\n<br data-parsoid='{\"dsr\":[56,56,0,0]}'/></p>\n<h1 id=\"b_2\" data-parsoid='{\"dsr\":[57,62,1,1]}'>b</h1>\n");
add("html2html", "Italics and possessives (1)", "<p data-parsoid='{\"dsr\":[0,115,0,0]}'>obtained by <i data-parsoid='{\"dsr\":[12,91,2,2]}'>[/index.php?title=Lunar_Prospector&amp;action=edit&amp;redlink=1 Lunar Prospector]'</i>s gamma-ray spectrometer</p>\n");
add("html2html", "Italics and possessives (3)", "<p data-parsoid='{\"dsr\":[0,421,0,0]}'>The first monolingual dictionary written in a Romance language was <i data-parsoid='{\"dsr\":[67,93,2,2]}'>Sebastián Covarrubias'</i> <i data-parsoid='{\"dsr\":[94,139,2,2]}'>Tesoro de la lengua castellana o española</i>, published in 1611 in Madrid. In 1612 the first edition of the <i data-parsoid='{\"dsr\":[203,310,2,2]}'>Vocabolario dell'[/index.php?title=Accademia_della_Crusca&amp;action=edit&amp;redlink=1 Accademia della Crusca]</i>, for Italian, was published. In 1690 in Rotterdam was published, posthumously, the <i data-parsoid='{\"dsr\":[394,420,2,2]}'>Dictionnaire Universel</i>.</p>\n");
add("html2html", "post-expand include size being exceeded", "<p data-parsoid='{\"dsr\":[0,38,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Template:Echo3\" title=\"Wiki/Template:Echo3\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Template:Echo3\"},\"sa\":{\"href\":\"wiki/Template:Echo3\"},\"dsr\":[0,38,22,2]}'>Template:Echo3</a></p><!-- WARNING: template omitted, post&#x2D;expand include size too large -->\n");
add("html2html", "Preformatted text", "<pre data-parsoid='{\"dsr\":[0,96,1,0]}'>This is some\nPreformatted text\nWith <i data-parsoid='{\"dsr\":[39,49,2,2]}'>italic</i>\nAnd <b data-parsoid='{\"dsr\":[55,65,3,3]}'>bold</b>\nAnd a <a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[73,96,17,2]}'>link</a></pre>\n");
add("html2html", "T54763: Preformatted in <blockquote>", "<blockquote data-parsoid='{\"stx\":\"html\",\"dsr\":[0,75,12,13]}'>\n<p data-parsoid='{\"dsr\":[13,18,0,0]}'> Blah</p>\n\n<table data-parsoid='{\"dsr\":[20,61,2,2]}'>\n<tbody data-parsoid='{\"dsr\":[23,59,0,0]}'><tr data-parsoid='{\"autoInsertedStart\":true,\"dsr\":[23,58,0,0]}'><td data-parsoid='{\"dsr\":[23,58,1,0]}'>\n<pre data-parsoid='{\"dsr\":[25,58,1,0]}'>indented cell (no pre-wrapping!)</pre></td></tr>\n</tbody></table>\n</blockquote>\n");
add("html2html", "<pre> with attributes (T5202)", "<pre data-parsoid='{\"dsr\":[0,24,1,0]}'>Bluescreen of WikiDeath</pre>\n");
add("html2html", "<pre> with width attribute (T5202)", "<pre data-parsoid='{\"dsr\":[0,22,1,0]}'>Narrow screen goodies</pre>\n");
add("html2html", "<pre> with forbidden attribute (T5202)", "<pre data-parsoid='{\"dsr\":[0,22,1,0]}'>Narrow screen goodies</pre>\n");
add("html2html", "<pre> with forbidden attribute values (T5202)", "<pre data-parsoid='{\"dsr\":[0,22,1,0]}'>Narrow screen goodies</pre>\n");
add("html2html", "<nowiki> inside <pre> (T15238)", "<pre data-parsoid='{\"dsr\":[0,15,1,0]}'><span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;lt;\",\"srcContent\":\"&lt;\",\"dsr\":[1,5,null,null]}'>&lt;</span>nowiki<span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;gt;\",\"srcContent\":\">\",\"dsr\":[11,15,null,null]}'>></span></pre>\n<p data-parsoid='{\"dsr\":[16,18,0,0]}'>\n <br data-parsoid='{\"dsr\":[18,18,0,0]}'/></p>\n\n<pre data-parsoid='{\"dsr\":[20,53,1,0]}'><span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;lt;\",\"srcContent\":\"&lt;\",\"dsr\":[21,25,null,null]}'>&lt;</span>nowiki<span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;gt;\",\"srcContent\":\">\",\"dsr\":[31,35,null,null]}'>></span>Foo<span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;lt;\",\"srcContent\":\"&lt;\",\"dsr\":[38,42,null,null]}'>&lt;</span>/nowiki<span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;gt;\",\"srcContent\":\">\",\"dsr\":[49,53,null,null]}'>></span></pre>\n");
add("html2html", "Templates: Handle comments in the target", "<p about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,39,0,0],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\\n&lt;!-- should be ignored -->\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo\"}},\"i\":0}}]}'>foo</p>\n\n<p about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[41,136,0,0],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\\n&lt;!-- should be ignored and spaces on next line should not trip us up (T147742) -->\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo\"}},\"i\":0}}]}'>foo</p>\n\n<p about=\"#mwt3\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[138,176,0,0],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo&lt;!-- should be ignored -->\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo\"}},\"i\":0}}]}'>foo</p>\n\n<p about=\"#mwt4\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[178,216,0,0],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo&lt;!-- should be ignored -->\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo\"}},\"i\":0}}]}'>foo</p>\n\n<p about=\"#mwt5\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[218,230,0,0],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo\"}},\"i\":0}}]}'>foo</p>");
add("html2html", "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("html2html", "3c. Indent-Pre and block tags (pre-content on separate line)", "\n<p data-parsoid='{\"dsr\":[1,22,0,0]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[1,19,8,9]}'> </span>foo</p>\n\n<div data-parsoid='{\"stx\":\"html\",\"dsr\":[24,42,5,6]}'>\n<pre data-parsoid='{\"dsr\":[30,34,1,0]}'>foo</pre>\n\n</div>\n<center data-parsoid='{\"stx\":\"html\",\"dsr\":[43,67,8,9]}'>\n<pre data-parsoid='{\"dsr\":[52,56,1,0]}'>foo</pre>\n\n</center>\n<blockquote data-parsoid='{\"stx\":\"html\",\"dsr\":[68,100,12,13]}'>\n<p data-parsoid='{\"dsr\":[81,85,0,0]}'> foo</p>\n\n</blockquote>\n<blockquote data-parsoid='{\"stx\":\"html\",\"dsr\":[101,133,12,13]}'>\n<p data-parsoid='{\"dsr\":[114,118,0,0]}'> foo</p>\n\n</blockquote>\n<table data-parsoid='{\"dsr\":[134,146,2,2]}'>\n<tbody data-parsoid='{\"dsr\":[137,144,0,0]}'><tr data-parsoid='{\"autoInsertedStart\":true,\"dsr\":[137,143,0,0]}'><td data-parsoid='{\"dsr\":[137,143,1,0]}'>\n<pre data-parsoid='{\"dsr\":[139,143,1,0]}'>foo</pre></td></tr>\n</tbody></table>\n\n<ul data-parsoid='{\"dsr\":[148,154,0,0]}'><li data-parsoid='{\"dsr\":[148,154,1,0]}'>foo</li></ul>\n");
add("html2html", "Definition list with wikilink containing colon", "<dl data-parsoid='{\"dsr\":[0,95,0,0]}'><dt data-parsoid='{\"dsr\":[0,24,1,0]}'>[/index.php?title=Help</dt><dd data-parsoid='{\"stx\":\"row\",\"dsr\":[24,60,1,0]}'>FAQ&amp;action=edit&amp;redlink=1 Help:FAQ]</dd>\n<dd data-parsoid='{\"dsr\":[61,95,1,0]}'>The least-read page on Wikipedia</dd></dl>\n");
add("html2html", "Definition lists: colon in HTML attribute", "<dl data-parsoid='{\"dsr\":[0,12,0,0]}'><dt data-parsoid='{\"dsr\":[0,12,1,0]}'><b data-parsoid='{\"dsr\":[2,12,3,3]}'>bold</b></dt></dl>\n");
add("html2html", "Build table with wikilink", "<table class=\"wikitable\" data-parsoid='{\"dsr\":[0,204,20,2]}'>\n<tbody data-parsoid='{\"dsr\":[21,202,0,0]}'><tr data-parsoid='{\"autoInsertedStart\":true,\"dsr\":[21,43,0,0]}'><th data-parsoid='{\"dsr\":[21,28,1,0]}'>header</th>\n<th data-parsoid='{\"dsr\":[29,43,1,0]}'>second header</th></tr>\n<tr style=\"color:red;\" data-parsoid='{\"startTagSrc\":\"|-\",\"dsr\":[44,140,21,0]}'>\n<td data-parsoid='{\"dsr\":[66,99,1,0]}'>data <a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[72,99,17,2]}'>linktext</a></td>\n<td data-parsoid='{\"dsr\":[100,140,1,0]}'>second data <a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[113,140,17,2]}'>linktext</a></td></tr>\n<tr data-parsoid='{\"startTagSrc\":\"|-\",\"dsr\":[141,201,2,0]}'>\n<td data-parsoid='{\"dsr\":[144,149,1,0]}'>data</td>\n<td data-parsoid='{\"dsr\":[150,201,1,0]}'>second data <a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[163,201,17,2]}'>link|text with pipe</a></td></tr>\n</tbody></table>\n");
add("html2html", "Fostered content in tables: Lists", "<ul data-parsoid='{\"dsr\":[0,3,0,0]}'><li data-parsoid='{\"dsr\":[0,3,1,0]}'>a</li></ul>\n\n<table data-parsoid='{\"dsr\":[5,13,2,2]}'>\n<tbody data-parsoid='{\"dsr\":[8,11,0,0]}'><tr class=\"mw-empty-elt\" data-parsoid='{\"startTagSrc\":\"|-\",\"dsr\":[8,10,2,0]}'></tr>\n</tbody></table>");
add("html2html", "Plain link, capitalized", "<p data-parsoid='{\"dsr\":[0,28,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[0,28,17,2]}'>Main Page</a></p>\n");
add("html2html", "Plain link, uncapitalized", "<p data-parsoid='{\"dsr\":[0,28,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[0,28,17,2]}'>main Page</a></p>\n");
add("html2html", "Piped link", "<p data-parsoid='{\"dsr\":[0,32,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[0,32,17,2]}'>The Main Page</a></p>\n");
add("html2html", "Piped link with comment in link text", "<p data-parsoid='{\"dsr\":[0,32,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[0,32,17,2]}'>The Main Page</a></p>\n");
add("html2html", "Piped link with multiple pipe characters in link text", "<p data-parsoid='{\"dsr\":[0,46,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page\" title=\"Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page\"},\"sa\":{\"href\":\"Main Page\"},\"dsr\":[0,46,12,2]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[12,44,8,9]}'>|The|Main|Page|</span></a></p>");
add("html2html", "Broken link", "<p data-parsoid='{\"dsr\":[0,72,0,0]}'>[/index.php?title=Zigzagzogzagzig&amp;action=edit&amp;redlink=1 Zigzagzogzagzig]</p>\n");
add("html2html", "Broken link with fragment", "<p data-parsoid='{\"dsr\":[0,76,0,0]}'>[/index.php?title=Zigzagzogzagzig&amp;action=edit&amp;redlink=1 Zigzagzogzagzig#zug]</p>\n");
add("html2html", "Special page link with fragment", "<p data-parsoid='{\"dsr\":[0,54,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Special:Version#anchor\" title=\"Wiki/Special:Version\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Special:Version#anchor\"},\"sa\":{\"href\":\"wiki/Special:Version#anchor\"},\"dsr\":[0,54,30,2]}'>Special:Version#anchor</a></p>\n");
add("html2html", "Nonexistent special page link with fragment", "<p data-parsoid='{\"dsr\":[0,97,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Special:ThisNameWillHopefullyNeverBeUsed\" title=\"Wiki/Special:ThisNameWillHopefullyNeverBeUsed\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Special:ThisNameWillHopefullyNeverBeUsed\"},\"sa\":{\"href\":\"wiki/Special:ThisNameWillHopefullyNeverBeUsed\"},\"dsr\":[0,97,48,2]}'>Special:ThisNameWillHopefullyNeverBeUsed#anchor</a></p>\n");
add("html2html", "Link with prefix", "<p data-parsoid='{\"dsr\":[0,162,0,0]}'>xxx<a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[3,31,17,2]}'>main Page</a>, xxx<a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[36,64,17,2]}'>Main Page</a>, Xxx<a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[69,97,17,2]}'>main Page</a> XXX<a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[101,129,17,2]}'>main Page</a>, XXX<a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[134,162,17,2]}'>Main Page</a></p>\n");
add("html2html", "Link with suffix", "<p data-parsoid='{\"dsr\":[0,97,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[0,31,17,2]}'>Main Pagexxx</a>, <a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[33,61,17,2]}'>Main Page</a>XXX, <a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[66,94,17,2]}'>Main Page</a>!!!</p>\n");
add("html2html", "T45661: Piped links with identical prefixes", "<p data-parsoid='{\"dsr\":[0,55,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Prefixed_article\" title=\"Wiki/Prefixed article\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Prefixed_article\"},\"sa\":{\"href\":\"wiki/Prefixed article\"},\"dsr\":[0,55,24,2]}'>prefixed articles with spaces</a></p>\n\n<p data-parsoid='{\"dsr\":[57,104,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Prefixed_article\" title=\"Wiki/Prefixed article\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Prefixed_article\"},\"sa\":{\"href\":\"wiki/Prefixed article\"},\"dsr\":[57,104,24,2]}'>prefixed articlesaoeu</a></p>\n\n<p data-parsoid='{\"dsr\":[106,139,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[106,139,17,2]}'>Main Page test</a></p>\n");
add("html2html", "Link with 4 brackets", "<p data-parsoid='{\"dsr\":[0,32,0,0]}'>[[<a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[2,30,17,2]}'>Main Page</a>]]</p>\n");
add("html2html", "Link with multiple pipes", "<p data-parsoid='{\"dsr\":[0,32,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[0,32,17,2]}'>The|Main|Page</a></p>\n");
add("html2html", "Link to namespaces", "<p data-parsoid='{\"dsr\":[0,156,0,0]}'>[/index.php?title=Talk:Parser_testing&amp;action=edit&amp;redlink=1 Talk:Parser testing], [/index.php?title=Meta:Disclaimers&amp;action=edit&amp;redlink=1 Meta:Disclaimers]</p>\n");
add("html2html", "Link with space in namespace", "<p data-parsoid='{\"dsr\":[0,76,0,0]}'>[/index.php?title=User_talk:Foo_bar&amp;action=edit&amp;redlink=1 User talk:Foo bar]</p>\n");
add("html2html", "Namespace takes precedence over interwiki link (T53680)", "<p data-parsoid='{\"dsr\":[0,52,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/MemoryAlpha:AlphaTest\" title=\"Wiki/MemoryAlpha:AlphaTest\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/MemoryAlpha:AlphaTest\"},\"sa\":{\"href\":\"wiki/MemoryAlpha:AlphaTest\"},\"dsr\":[0,52,29,2]}'>MemoryAlpha:AlphaTest</a></p>\n");
add("html2html", "Piped link to namespace", "<p data-parsoid='{\"dsr\":[0,73,0,0]}'>[/index.php?title=Meta:Disclaimers&amp;action=edit&amp;redlink=1 The disclaimers]</p>\n");
add("html2html", "Link containing double-single-quotes '' in text embedded in italics (T6598 sanity check)", "<p data-parsoid='{\"dsr\":[0,84,0,0]}'><i data-parsoid='{\"dsr\":[0,61,2,2]}'>Some [/index.php?title=Link&amp;action=edit&amp;redlink=1 pretty </i>italics<i data-parsoid='{\"dsr\":[68,84,2,2]}'> and stuff]!</i></p>\n");
add("html2html", "Plain link to page with question mark in title", "<p data-parsoid='{\"dsr\":[0,16,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/A%3Fb\" title=\"Wiki/A?b\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/A%3Fb\"},\"sa\":{\"href\":\"wiki/A?b\"},\"dsr\":[0,16,11,2]}'>A?b</a></p>\n\n<p data-parsoid='{\"dsr\":[18,34,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/A%3Fb\" title=\"Wiki/A?b\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/A%3Fb\"},\"sa\":{\"href\":\"wiki/A?b\"},\"dsr\":[18,34,11,2]}'>Baz</a></p>\n");
add("html2html", "Self-link to section should not be bold", "<p data-parsoid='{\"dsr\":[0,44,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page#section\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page#section\"},\"sa\":{\"href\":\"wiki/Main Page#section\"},\"dsr\":[0,44,25,2]}'>Main Page#section</a></p>\n");
add("html2html", "Self-link to numeric title", "<p data-parsoid='{\"dsr\":[0,1,0,0]}'>0</p>\n");
add("html2html", "Link to numeric-equivalent title", "<p data-parsoid='{\"dsr\":[0,14,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/00\" title=\"Wiki/00\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/00\"},\"sa\":{\"href\":\"wiki/00\"},\"dsr\":[0,14,10,2]}'>00</a></p>\n");
add("html2html", "<nowiki> inside a link", "<p data-parsoid='{\"dsr\":[0,84,0,0]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[0,30,8,9]}'>[[Main Page]]</span> <a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[31,83,17,2]}'>the main page [it's not very good</a>]</p>\n");
add("html2html", "Non-breaking spaces in title", "<p data-parsoid='{\"dsr\":[0,34,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[0,34,17,2]}'>  Main   Page  </a></p>\n");
add("html2html", "Internal link with ca linktrail, surrounded by bold apostrophes (T29473 primary issue)", "<p data-parsoid='{\"dsr\":[0,34,0,0]}'><b data-parsoid='{\"dsr\":[0,34,3,3]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[3,31,17,2]}'>Main Page</a></b></p>\n");
add("html2html", "Internal link with ca linktrail, surrounded by italic apostrophes (T29473 primary issue)", "<p data-parsoid='{\"dsr\":[0,32,0,0]}'><i data-parsoid='{\"dsr\":[0,32,2,2]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[2,30,17,2]}'>Main Page</a></i></p>\n");
add("html2html", "Internal link with en linktrail: no apostrophes (T29473)", "<p data-parsoid='{\"dsr\":[0,65,0,0]}'>[/index.php?title=Something&amp;action=edit&amp;redlink=1 Something]'nice</p>\n");
add("html2html", "Internal link with ca linktrail with apostrophes (T29473)", "<p data-parsoid='{\"dsr\":[0,65,0,0]}'>[/index.php?title=Something&amp;action=edit&amp;redlink=1 Something'nice]</p>\n");
add("html2html", "Internal link with kaa linktrail with apostrophes (T29473)", "<p data-parsoid='{\"dsr\":[0,65,0,0]}'>[/index.php?title=Something&amp;action=edit&amp;redlink=1 Something'nice]</p>\n");
add("html2html", "Internal link with is link prefix", "<p data-parsoid='{\"dsr\":[0,45,0,0]}'>Aðrir <a rel=\"mw:WikiLink\" href=\"./Wiki/Söfnuður\" title=\"Wiki/Söfnuður\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Söfnuður\"},\"sa\":{\"href\":\"wiki/Söfnuður\"},\"dsr\":[6,42,16,2]}'>mótmælendasöfnuðir</a> og</p>\n");
add("html2html", "Internal link with is link trail and link prefix", "<p data-parsoid='{\"dsr\":[0,181,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Mótmælendatrú\" title=\"Wiki/Mótmælendatrú\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Mótmælendatrú\"},\"sa\":{\"href\":\"wiki/Mótmælendatrú\"},\"dsr\":[0,28,21,2]}'>xxxar</a>\n<a rel=\"mw:WikiLink\" href=\"./Wiki/Mótmælendatrú\" title=\"Wiki/Mótmælendatrú\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Mótmælendatrú\"},\"sa\":{\"href\":\"wiki/Mótmælendatrú\"},\"dsr\":[29,67,21,2]}'>mótmælendatrúar</a>\n<a rel=\"mw:WikiLink\" href=\"./Wiki/Söfnuður\" title=\"Wiki/Söfnuður\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Söfnuður\"},\"sa\":{\"href\":\"wiki/Söfnuður\"},\"dsr\":[68,104,16,2]}'>mótmælendasöfnuður</a>\n<a rel=\"mw:WikiLink\" href=\"./Wiki/Söfnuður\" title=\"Wiki/Söfnuður\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Söfnuður\"},\"sa\":{\"href\":\"wiki/Söfnuður\"},\"dsr\":[105,141,16,2]}'>mótmælendasöfnuðir</a>\n<a rel=\"mw:WikiLink\" href=\"./Wiki/Söfnuður\" title=\"Wiki/Söfnuður\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Söfnuður\"},\"sa\":{\"href\":\"wiki/Söfnuður\"},\"dsr\":[142,181,16,2]}'>mótmælendasöfnuðirxxx</a></p>\n");
add("html2html", "Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved", "<p data-parsoid='{\"dsr\":[0,18,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Foo\" title=\"Wiki/Foo\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Foo\"},\"sa\":{\"href\":\"wiki/Foo\"},\"dsr\":[0,18,11,2]}'> bar</a></p>\n\n<p data-parsoid='{\"dsr\":[20,42,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Foo\" title=\"Wiki/Foo\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Foo\"},\"sa\":{\"href\":\"wiki/Foo\"},\"dsr\":[20,42,11,2]}'> <i data-parsoid='{\"dsr\":[33,40,2,2]}'>bar</i></a></p>\n\n<p data-parsoid='{\"dsr\":[44,63,0,0]}'><a rel=\"mw:ExtLink\" class=\"external text\" href=\"http://wp.org\" data-parsoid='{\"targetOff\":59,\"contentOffsets\":[59,62],\"dsr\":[44,63,15,1]}'>foo</a></p>\n\n<p data-parsoid='{\"dsr\":[65,88,0,0]}'><a rel=\"mw:ExtLink\" class=\"external text\" href=\"http://wp.org\" data-parsoid='{\"targetOff\":80,\"contentOffsets\":[80,87],\"dsr\":[65,88,15,1]}'><i data-parsoid='{\"dsr\":[80,87,2,2]}'>foo</i></a></p>\n");
add("html2html", "Space and question mark encoding in interlanguage links (T95473)", "<p data-parsoid='{\"dsr\":[0,14,0,0]}'>Blah blah blah</p>\n<link rel=\"mw:PageProp/Language\" href=\"http://es.wikipedia.org/wiki/Foo_bar?\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://es.wikipedia.org/wiki/Foo_bar?\"},\"sa\":{\"href\":\"es:Foo_bar?\"},\"dsr\":[15,30,null,null]}'/>");
add("html2html", "Parsoid-specific test: Wikilinks with &nbsp; should RT properly", "<p data-parsoid='{\"dsr\":[0,52,0,0]}'>[/index.php?title=WW_II&amp;action=edit&amp;redlink=1 WW II]</p>\n");
add("html2html", "<br> to <br />", "<p data-parsoid='{\"dsr\":[0,3,0,0]}'>123</p>\n");
add("html2html", "Incorrecly removing closing slashes from correctly formed XHTML", "\n\n");
add("html2html", "Failing to transform badly formed HTML into correct XHTML", "\n<p data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[1,2,0,0]}'>\n<br data-parsoid='{\"dsr\":[2,2,0,0]}'/></p>\n");
add("html2html", "Handling html with a br self-closing tag", "\n<p data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[1,2,0,0]}'>\n<br data-parsoid='{\"dsr\":[2,2,0,0]}'/></p>\n");
add("html2html", "2. List embedded in a formatting tag in a misnested way", "<p data-parsoid='{\"dsr\":[0,7,0,0]}'><small data-parsoid='{\"stx\":\"html\",\"autoInsertedEnd\":true,\"dsr\":[0,7,7,0]}'></small></p>\n\n<ul data-parsoid='{\"dsr\":[9,24,0,0]}'><small data-parsoid='{\"stx\":\"html\",\"autoInsertedEnd\":true,\"autoInsertedStart\":true,\"dsr\":[9,12,0,0]}'><li data-parsoid='{\"dsr\":[9,12,1,0]}'>a</li></small>\n<li data-parsoid='{\"dsr\":[13,24,1,0]}'><small data-parsoid='{\"stx\":\"html\",\"autoInsertedStart\":true,\"dsr\":[14,24,0,8]}'> b</small></li></ul>");
add("html2html", "Case-sensitive magic words, when cased differently, should just be template transclusions", "<p data-parsoid='{\"dsr\":[0,331,0,0]}'>[/index.php?title=Template:CurrentMonth&amp;action=edit&amp;redlink=1 Template:CurrentMonth]\n[/index.php?title=Template:Currentday&amp;action=edit&amp;redlink=1 Template:Currentday]\n[/index.php?title=Template:CURreNTweEK&amp;action=edit&amp;redlink=1 Template:CURreNTweEK]\n[/index.php?title=Template:CurrentHour&amp;action=edit&amp;redlink=1 Template:CurrentHour]</p>\n");
add("html2html", "Nonexistent template", "<p data-parsoid='{\"dsr\":[0,108,0,0]}'>[/index.php?title=Template:Thistemplatedoesnotexist&amp;action=edit&amp;redlink=1 Template:Thistemplatedoesnotexist]</p>\n");
add("html2html", "Template with invalid target containing wikilink", "<p data-parsoid='{\"dsr\":[0,17,0,0]}'>{{<a rel=\"mw:WikiLink\" href=\"./Main_Page\" title=\"Main Page\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Main_Page\"},\"sa\":{\"href\":\"Main Page\"},\"dsr\":[2,15,2,2]}'>Main Page</a>}}</p>");
add("html2html", "Template with just whitespace in it, T70421", "<p data-parsoid='{\"dsr\":[1,31,0,0]}'>{{echo|{{}<span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[11,29,8,9]}'>}</span>}}</p>");
add("html2html", "Template unnamed parameter", "<p data-parsoid='{\"dsr\":[0,32,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[0,32,17,2]}'>the main page</a></p>\n");
add("html2html", "Templates with templated name", "<p data-parsoid='{\"dsr\":[0,45,0,0]}'><span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[0,21,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"{{echo|echo}}\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo\"}},\"i\":0}}]}'>foo</span>\n{<span about=\"#mwt3\" typeof=\"mw:Param\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[23,44,null,null]}' data-mw='{\"parts\":[{\"templatearg\":{\"target\":{\"wt\":\"echo\"},\"params\":{\"1\":{\"wt\":\"inner list\"}},\"i\":0}}]}'>inner list</span>}</p>");
add("html2html", "Templates with invalid templated targets", "<p about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,21,0,0],\"pi\":[[]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\\n{{echo|foo}}\"},\"params\":{},\"i\":0}}]}'>{{echo\nfoo}}</p>");
add("html2html", "Template with complex arguments", "<p data-parsoid='{\"dsr\":[0,84,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Template:Complextemplate\" title=\"Wiki/Template:Complextemplate\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Template:Complextemplate\"},\"sa\":{\"href\":\"wiki/Template:Complextemplate\"},\"dsr\":[0,38,32,2]}'>link</a> This is a test template with parameter (test)</p>\n");
add("html2html", "T2553: link with two variables in a piped link", "<table data-parsoid='{\"dsr\":[0,43,2,2]}'>\n<tbody data-parsoid='{\"dsr\":[3,41,0,0]}'><tr data-parsoid='{\"autoInsertedStart\":true,\"dsr\":[3,40,0,0]}'><td data-parsoid='{\"dsr\":[3,40,1,0]}'>[[<span about=\"#mwt7\" typeof=\"mw:Param\" data-parsoid='{\"pi\":[[]],\"dsr\":[6,13,null,null]}' data-mw='{\"parts\":[{\"templatearg\":{\"target\":{\"wt\":\"1\"},\"params\":{},\"i\":0}}]}'>{{{1}}}</span><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[13,31,8,9]}'>|</span><span about=\"#mwt8\" typeof=\"mw:Param\" data-parsoid='{\"pi\":[[]],\"dsr\":[31,38,null,null]}' data-mw='{\"parts\":[{\"templatearg\":{\"target\":{\"wt\":\"2\"},\"params\":{},\"i\":0}}]}'>{{{2}}}</span>]]</td></tr>\n</tbody></table>");
add("html2html", "Abort table cell attribute parsing on wikilink", "<table data-parsoid='{\"dsr\":[0,140,2,2]}'>\n<tbody data-parsoid='{\"dsr\":[3,138,0,0]}'><tr data-parsoid='{\"autoInsertedStart\":true,\"dsr\":[3,137,0,0]}'><td data-parsoid='{\"dsr\":[3,47,1,0]}'>testing <a rel=\"mw:WikiLink\" href=\"./One\" title=\"One\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./One\"},\"sa\":{\"href\":\"one\"},\"dsr\":[12,23,6,2]}'>two</a><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[23,47,8,9]}'> |three</span></td><td data-parsoid='{\"stx\":\"row\",\"dsr\":[47,53,2,0]}'>four</td>\n<td data-parsoid='{\"a\":{\"testing\":null,\"one\":null,\"two\":null},\"sa\":{\"testing\":\"\",\"one\":\"\",\"two\":\"\"},\"dsr\":[54,78,19,0]}'>three</td><td data-parsoid='{\"stx\":\"row\",\"dsr\":[78,84,2,0]}'>four</td>\n<td data-parsoid='{\"dsr\":[85,131,1,0]}'>testing=\"<a rel=\"mw:WikiLink\" href=\"./One\" title=\"One\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./One\"},\"sa\":{\"href\":\"one\"},\"dsr\":[95,106,6,2]}'>two</a><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[106,131,8,9]}'>\" |three</span></td><td data-parsoid='{\"stx\":\"row\",\"dsr\":[131,137,2,0]}'>four</td></tr>\n</tbody></table>");
add("html2html", "Template parameter as link source", "<p data-parsoid='{\"dsr\":[0,23,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[0,23,17,2]}'>link</a></p>\n");
add("html2html", "Template as link source", "<p data-parsoid='{\"dsr\":[0,28,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[0,28,17,2]}'>Main Page</a></p>\n\n<p data-parsoid='{\"dsr\":[30,58,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[30,58,17,2]}'>Main Page</a></p>\n\n<p data-parsoid='{\"dsr\":[60,92,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[60,88,17,2]}'>Main Page</a>Page</p>\n");
add("html2html", "Template infinite loop", "<p data-parsoid='{\"dsr\":[0,89,0,0]}'><span class=\"error\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,89,20,7]}'>Template loop detected: <a rel=\"mw:WikiLink\" href=\"./Wiki/Template:Loop1\" title=\"Wiki/Template:Loop1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Template:Loop1\"},\"sa\":{\"href\":\"wiki/Template:Loop1\"},\"dsr\":[44,82,22,2]}'>Template:Loop1</a></span></p>\n");
add("html2html", "Template from non-includable namespace", "<p data-parsoid='{\"dsr\":[0,36,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Template:Echo\" title=\"Wiki/Template:Echo\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Template:Echo\"},\"sa\":{\"href\":\"wiki/Template:Echo\"},\"dsr\":[0,36,21,2]}'>Template:Echo</a></p>\n");
add("html2html", "Self-closed noinclude, includeonly, onlyinclude tags", "\n\n");
add("html2html", "T8563: Section extraction for section shown by <includeonly>", "<p data-parsoid='{\"dsr\":[0,32,0,0]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[0,32,8,9]}'>==Section T-2==</span></p>");
add("html2html", "T8563: Section extraction for section suppressed by <includeonly>", "<p data-parsoid='{\"dsr\":[0,30,0,0]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[0,30,8,9]}'>==Section 1==</span></p>");
add("html2html", "Templates: Links: 1. Simple example", "<p data-parsoid='{\"dsr\":[0,16,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Foo\" title=\"Wiki/Foo\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Foo\"},\"sa\":{\"href\":\"wiki/Foo\"},\"dsr\":[0,16,11,2]}'>bar</a></p>\n");
add("html2html", "Templates: Links: 2. Generation of link href", "<p data-parsoid='{\"dsr\":[0,16,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Foo\" title=\"Wiki/Foo\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Foo\"},\"sa\":{\"href\":\"wiki/Foo\"},\"dsr\":[0,16,11,2]}'>bar</a></p>\n");
add("html2html", "Templates: Links: 3. Generation of part of a link href", "<p data-parsoid='{\"dsr\":[0,16,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Foo\" title=\"Wiki/Foo\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Foo\"},\"sa\":{\"href\":\"wiki/Foo\"},\"dsr\":[0,16,11,2]}'>bar</a></p>\n\n<p data-parsoid='{\"dsr\":[18,72,0,0]}'>[/index.php?title=Foobar&amp;action=edit&amp;redlink=1 Foobar]</p>\n\n<p data-parsoid='{\"dsr\":[74,134,0,0]}'>[/index.php?title=Foobarbaz&amp;action=edit&amp;redlink=1 Foobarbaz]</p>\n\n<p data-parsoid='{\"dsr\":[136,187,0,0]}'>[/index.php?title=Foobar&amp;action=edit&amp;redlink=1 bar]</p>\n\n<p data-parsoid='{\"dsr\":[189,243,0,0]}'>[/index.php?title=Foobar&amp;action=edit&amp;redlink=1 Foobar]</p>\n\n<p data-parsoid='{\"dsr\":[245,296,0,0]}'>[/index.php?title=Foobar&amp;action=edit&amp;redlink=1 bar]</p>\n");
add("html2html", "Templates: Links: 4. Multiple templates generating link href", "<p data-parsoid='{\"dsr\":[0,54,0,0]}'>[/index.php?title=Foobar&amp;action=edit&amp;redlink=1 Foobar]</p>\n");
add("html2html", "Templates: Links: 5. Generation of link text", "<p data-parsoid='{\"dsr\":[0,16,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Foo\" title=\"Wiki/Foo\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Foo\"},\"sa\":{\"href\":\"wiki/Foo\"},\"dsr\":[0,16,11,2]}'>bar</a></p>\n");
add("html2html", "Templates: Links: 5. Nested templates (only outermost template should be marked)", "<p data-parsoid='{\"dsr\":[0,16,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Foo\" title=\"Wiki/Foo\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Foo\"},\"sa\":{\"href\":\"wiki/Foo\"},\"dsr\":[0,16,11,2]}'>bar</a></p>\n");
add("html2html", "Templates: Wiki Tables: 8. Fosterable meta-tags should get fostered", "<p data-parsoid='{\"dsr\":[0,63,0,0]}'><span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[0,22,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"{{{!}}\\n{{!}}-\"}},\"i\":0}}]}'>{|\n|-</span>\n<meta typeof=\"mw:Includes/OnlyInclude\" data-parsoid='{\"src\":\"&lt;onlyinclude>\",\"dsr\":[23,36,null,null]}'/>\n|foo\n<meta typeof=\"mw:Includes/OnlyInclude/End\" data-parsoid='{\"src\":\"&lt;/onlyinclude>\",\"dsr\":[42,56,null,null]}'/>\n<span about=\"#mwt3\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[57,62,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"!\",\"function\":\"!\"},\"params\":{},\"i\":0}}]}'>|</span>}</p>\n");
add("html2html", "Templates: Lists: Multi-line list-items via templates", "<ul data-parsoid='{\"dsr\":[0,173,0,0]}'><li data-parsoid='{\"dsr\":[0,86,1,0]}'>a [/index.php?title=Template:Nonexistent&amp;action=edit&amp;redlink=1 Template:Nonexistent]</li>\n<li data-parsoid='{\"dsr\":[87,173,1,0]}'>b [/index.php?title=Template:Nonexistent&amp;action=edit&amp;redlink=1 Template:Nonexistent]</li></ul>\n");
add("html2html", "Templates: Ugly templates: 4. newline-only template parameter inconsistency", "\n\n");
add("html2html", "message transform: magic variables", "<p data-parsoid='{\"dsr\":[0,9,0,0]}'>MediaWiki</p>");
add("html2html", "message transform: should not transform wiki markup", "<p data-parsoid='{\"dsr\":[0,25,0,0]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[0,25,8,9]}'>''test''</span></p>");
add("html2html", "message transform: <noinclude> in transcluded template (T6926)", "<p data-parsoid='{\"dsr\":[0,6,0,0]}'>Foobar</p>");
add("html2html", "message transform: <onlyinclude> in transcluded template (T6926)", "<p data-parsoid='{\"dsr\":[0,3,0,0]}'>Foo</p>");
add("html2html", "{{#special:}} page name, known", "<p data-parsoid='{\"dsr\":[0,21,0,0]}'>Special:RecentChanges</p>");
add("html2html", "{{#special:}} page name with subpage, known", "<p data-parsoid='{\"dsr\":[0,27,0,0]}'>Special:RecentChanges/param</p>");
add("html2html", "{{#special:}} page name, unknown", "<p data-parsoid='{\"dsr\":[0,26,0,0]}'>Special:Foobar nonexistent</p>");
add("html2html", "{{#speciale:}} page name, known", "<p data-parsoid='{\"dsr\":[0,21,0,0]}'>Special:RecentChanges</p>");
add("html2html", "{{#speciale:}} page name with subpage, known", "<p data-parsoid='{\"dsr\":[0,27,0,0]}'>Special:RecentChanges/param</p>");
add("html2html", "{{#speciale:}} page name, unknown", "<p data-parsoid='{\"dsr\":[0,26,0,0]}'>Special:Foobar_nonexistent</p>");
add("html2html", "Allow empty links in image captions (T62753)", "<figure class=\"mw-default-size\" typeof=\"mw:Image/Thumb\" data-parsoid='{\"optList\":[{\"ck\":\"thumbnail\",\"ak\":\"thumb\"},{\"ck\":\"caption\",\"ak\":\"Caption [[Link1]]\\n&lt;nowiki>[[]]&lt;/nowiki>\\n[[Link2]]\\n\"}],\"dsr\":[0,76,2,2]}'><a href=\"./File:Foobar.jpg\" data-parsoid='{\"a\":{\"href\":\"./File:Foobar.jpg\"},\"sa\":{\"href\":\"File:Foobar.jpg\"},\"dsr\":[2,null,null,null]}'><img resource=\"./File:Foobar.jpg\" src=\"//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg\" data-file-width=\"1941\" data-file-height=\"220\" data-file-type=\"bitmap\" height=\"25\" width=\"220\" data-parsoid='{\"a\":{\"resource\":\"./File:Foobar.jpg\",\"height\":\"25\",\"width\":\"220\"},\"sa\":{\"resource\":\"File:Foobar.jpg\"}}'/></a><figcaption data-parsoid='{\"dsr\":[null,74,null,null]}'>Caption <a rel=\"mw:WikiLink\" href=\"./Link1\" title=\"Link1\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Link1\"},\"sa\":{\"href\":\"Link1\"},\"dsr\":[32,41,2,2]}'>Link1</a>\n<span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[42,63,8,9]}'>[[]]</span>\n<a rel=\"mw:WikiLink\" href=\"./Link2\" title=\"Link2\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Link2\"},\"sa\":{\"href\":\"Link2\"},\"dsr\":[64,73,2,2]}'>Link2</a>\n</figcaption></figure>");
add("html2html", "Image with multiple attributes from the same template", "<figure class=\"mw-default-size mw-halign-right\" typeof=\"mw:Image\" data-parsoid='{\"optList\":[{\"ck\":\"right\",\"ak\":\"right\"},{\"ck\":\"caption\",\"ak\":\"Caption text\"}],\"dsr\":[0,38,2,2]}'><a href=\"./File:Foobar.jpg\" data-parsoid='{\"a\":{\"href\":\"./File:Foobar.jpg\"},\"sa\":{\"href\":\"File:Foobar.jpg\"},\"dsr\":[2,null,null,null]}'><img resource=\"./File:Foobar.jpg\" src=\"//example.com/images/3/3a/Foobar.jpg\" data-file-width=\"1941\" data-file-height=\"220\" data-file-type=\"bitmap\" height=\"220\" width=\"1941\" data-parsoid='{\"a\":{\"resource\":\"./File:Foobar.jpg\",\"height\":\"220\",\"width\":\"1941\"},\"sa\":{\"resource\":\"File:Foobar.jpg\"}}'/></a><figcaption data-parsoid='{\"dsr\":[null,36,null,null]}'>Caption text</figcaption></figure>\n");
add("html2html", "Image with link tails", "<p data-parsoid='{\"dsr\":[0,29,0,0]}'>123<figure-inline class=\"mw-default-size\" typeof=\"mw:Image\" data-parsoid='{\"optList\":[],\"dsr\":[3,22,null,null]}'><a href=\"./File:Foobar.jpg\" data-parsoid='{\"a\":{\"href\":\"./File:Foobar.jpg\"},\"sa\":{\"href\":\"File:Foobar.jpg\"}}'><img resource=\"./File:Foobar.jpg\" src=\"//example.com/images/3/3a/Foobar.jpg\" data-file-width=\"1941\" data-file-height=\"220\" data-file-type=\"bitmap\" height=\"220\" width=\"1941\" data-parsoid='{\"a\":{\"resource\":\"./File:Foobar.jpg\",\"height\":\"220\",\"width\":\"1941\"},\"sa\":{\"resource\":\"File:Foobar.jpg\"}}'/></a></figure-inline>456\n123</p>\n<figure class=\"mw-default-size mw-halign-right\" typeof=\"mw:Image\" data-parsoid='{\"optList\":[{\"ck\":\"right\",\"ak\":\"right\"}],\"dsr\":[30,55,2,2]}'><a href=\"./File:Foobar.jpg\" data-parsoid='{\"a\":{\"href\":\"./File:Foobar.jpg\"},\"sa\":{\"href\":\"File:Foobar.jpg\"},\"dsr\":[32,53,null,null]}'><img resource=\"./File:Foobar.jpg\" src=\"//example.com/images/3/3a/Foobar.jpg\" data-file-width=\"1941\" data-file-height=\"220\" data-file-type=\"bitmap\" height=\"220\" width=\"1941\" data-parsoid='{\"a\":{\"resource\":\"./File:Foobar.jpg\",\"height\":\"220\",\"width\":\"1941\"},\"sa\":{\"resource\":\"File:Foobar.jpg\"}}'/></a></figure>\n<p data-parsoid='{\"dsr\":[56,63,0,0]}'>456\n123</p>\n<figure class=\"mw-default-size\" typeof=\"mw:Image/Thumb\" data-parsoid='{\"optList\":[{\"ck\":\"thumbnail\",\"ak\":\"thumb\"}],\"dsr\":[64,89,2,2]}'><a href=\"./File:Foobar.jpg\" data-parsoid='{\"a\":{\"href\":\"./File:Foobar.jpg\"},\"sa\":{\"href\":\"File:Foobar.jpg\"},\"dsr\":[66,87,null,null]}'><img resource=\"./File:Foobar.jpg\" src=\"//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg\" data-file-width=\"1941\" data-file-height=\"220\" data-file-type=\"bitmap\" height=\"25\" width=\"220\" data-parsoid='{\"a\":{\"resource\":\"./File:Foobar.jpg\",\"height\":\"25\",\"width\":\"220\"},\"sa\":{\"resource\":\"File:Foobar.jpg\"}}'/></a></figure>\n<p data-parsoid='{\"dsr\":[90,93,0,0]}'>456</p>");
add("html2html", "Link to image page- image page normally doesn't exists, hence edit link\nAdd test with existing image page\n#<p><a href=\"/wiki/File:Test\" title=\"Image:Test\">Image:test</a>", "<p data-parsoid='{\"dsr\":[0,61,0,0]}'>[/index.php?title=File:Test&amp;action=edit&amp;redlink=1 Image:test]</p>\n");
add("html2html", "T20784 Link to non-existent image page with caption should use caption as link text", "<p data-parsoid='{\"dsr\":[0,58,0,0]}'>[/index.php?title=File:Test&amp;action=edit&amp;redlink=1 caption]</p>\n");
add("html2html", "SVG thumbnails with invalid language code", "<figure class=\"mw-default-size\" typeof=\"mw:Image/Thumb\" data-parsoid='{\"optList\":[{\"ck\":\"thumbnail\",\"ak\":\"thumb\"},{\"ck\":\"lang\",\"ak\":\"lang=invalid:language:code\"}],\"dsr\":[0,52,2,2]}'><a href=\"./File:Foobar.svg\" data-parsoid='{\"a\":{\"href\":\"./File:Foobar.svg\"},\"sa\":{\"href\":\"File:Foobar.svg\"},\"dsr\":[2,50,null,null]}'><img resource=\"./File:Foobar.svg\" src=\"//example.com/images/thumb/f/ff/Foobar.svg/220px-Foobar.svg.png\" lang=\"invalid:language:code\" data-file-width=\"240\" data-file-height=\"180\" data-file-type=\"drawing\" height=\"165\" width=\"220\" data-parsoid='{\"a\":{\"resource\":\"./File:Foobar.svg\",\"lang\":\"invalid:language:code\",\"height\":\"165\",\"width\":\"220\"},\"sa\":{\"resource\":\"File:Foobar.svg\",\"lang\":\"lang=invalid:language:code\"}}'/></a></figure>\n");
add("html2html", "Subpage link", "<p data-parsoid='{\"dsr\":[0,38,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Subpage_test/subpage\" title=\"Wiki/Subpage test/subpage\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Subpage_test/subpage\"},\"sa\":{\"href\":\"wiki/Subpage test/subpage\"},\"dsr\":[0,38,28,2]}'>/subpage</a></p>\n");
add("html2html", "Subpage noslash link", "<p data-parsoid='{\"dsr\":[0,37,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Subpage_test/subpage\" title=\"Wiki/Subpage test/subpage\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Subpage_test/subpage\"},\"sa\":{\"href\":\"wiki/Subpage test/subpage\"},\"dsr\":[0,37,28,2]}'>subpage</a></p>\n");
add("html2html", "Render invalid page names as plain text (T53090)", "<p data-parsoid='{\"dsr\":[0,172,0,0]}'>[[./../foo|bar]]\n[[foo�|bar]]\n[[foo/.|bar]]\n[[foo/..|bar]]\n<span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[59,89,8,9]}'>[[foo~~~bar]]</span>\n[[foo>bar]]\n[[foo[bar]]\n[[.]]\n[[..]]\n[[foo././bar]]\n[[foo<a rel=\"mw:ExtLink\" class=\"external autonumber\" href=\"http://example.com\" data-parsoid='{\"targetOff\":166,\"contentOffsets\":[166,166],\"dsr\":[147,167,19,1]}'></a>xyz]]</p>\n\n<p data-parsoid='{\"dsr\":[174,420,0,0]}'>[[<span about=\"#mwt36\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[176,193,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"./../foo\"}},\"i\":0}}]}'>./../foo</span>|bar]]\n[[<span about=\"#mwt37\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[202,216,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo/.\"}},\"i\":0}}]}'>foo/.</span>|bar]]\n[[<span about=\"#mwt38\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[225,240,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo/..\"}},\"i\":0}}]}'>foo/..</span>|bar]]\n[[<span about=\"#mwt39\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[249,268,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo~~~~bar\"}},\"i\":0}}]}'>foo~~~~bar</span>]]\n[[<span about=\"#mwt40\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[273,289,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo>bar\"}},\"i\":0}}]}'>foo>bar</span>]]\n[[<span about=\"#mwt41\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[294,313,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo././bar\"}},\"i\":0}}]}'>foo././bar</span>]]\n[[<span about=\"#mwt42\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[318,334,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo{bar\"}},\"i\":0}}]}'>foo{bar</span>]]\n[[<span about=\"#mwt43\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[339,355,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo}bar\"}},\"i\":0}}]}'>foo}bar</span>]]\n[[<span about=\"#mwt44\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[360,376,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo[bar\"}},\"i\":0}}]}'>foo[bar</span>]]\n[[<span about=\"#mwt45\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[381,397,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo]bar\"}},\"i\":0}}]}'>foo]bar</span>]]\n[[<span about=\"#mwt46\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[402,418,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo&lt;bar\"}},\"i\":0}}]}'>foo&lt;bar</span>]]</p>");
add("html2html", "Disabled subpages", "<p data-parsoid='{\"dsr\":[0,58,0,0]}'>[/index.php?title=/subpage&amp;action=edit&amp;redlink=1 /subpage]</p>\n");
add("html2html", "T2561: {{/Subpage}}", "<p data-parsoid='{\"dsr\":[0,66,0,0]}'>[/index.php?title=Page/Subpage&amp;action=edit&amp;redlink=1 Page/Subpage]</p>\n");
add("html2html", "Link to category", "<p data-parsoid='{\"dsr\":[0,72,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Category:MediaWiki_User's_Guide\" title=\"Wiki/Category:MediaWiki User's Guide\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Category:MediaWiki_User&apos;s_Guide\"},\"sa\":{\"href\":\"wiki/Category:MediaWiki User&apos;s Guide\"},\"dsr\":[0,72,39,2]}'>Category:MediaWiki User's Guide</a></p>\n");
add("html2html", "Section headings with TOC", "<div id=\"toc\" class=\"toc\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,916,26,6]}'>&lt;input type=\"checkbox\" role=\"button\" id=\"toctogglecheckbox\" class=\"toctogglecheckbox\" style=\"display:none\" /><div class=\"toctitle\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[135,296,42,6]}'>\n<h2 id=\"Contents\" data-parsoid='{\"dsr\":[178,192,2,2]}'>Contents</h2>\n<span class=\"toctogglespan\" data-parsoid='{\"stx\":\"html\",\"dsr\":[193,290,28,7]}'>&lt;label class=\"toctogglelabel\" for=\"toctogglecheckbox\">&lt;/label></span></div>\n\n<ul data-parsoid='{\"dsr\":[298,908,0,0]}'><li data-parsoid='{\"dsr\":[298,711,1,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#Headline_1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#Headline_1\"},\"sa\":{\"href\":\"#Headline_1\"},\"dsr\":[300,388,14,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[314,346,24,7]}'>1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[347,386,22,7]}'>Headline 1</span></a>\n<ul data-parsoid='{\"dsr\":[389,711,0,0]}'><li data-parsoid='{\"dsr\":[389,711,2,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#Subheadline_1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#Subheadline_1\"},\"sa\":{\"href\":\"#Subheadline_1\"},\"dsr\":[392,488,17,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[409,443,24,7]}'>1.1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[444,486,22,7]}'>Subheadline 1</span></a>\n<ul data-parsoid='{\"dsr\":[489,711,0,0]}'><li data-parsoid='{\"dsr\":[489,711,3,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#Skipping_a_level\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#Skipping_a_level\"},\"sa\":{\"href\":\"#Skipping_a_level\"},\"dsr\":[493,597,20,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[513,549,24,7]}'>1.1.1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[550,595,22,7]}'>Skipping a level</span></a>\n<ul data-parsoid='{\"dsr\":[598,711,0,0]}'><li data-parsoid='{\"dsr\":[598,711,4,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#Skipping_a_level_2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#Skipping_a_level_2\"},\"sa\":{\"href\":\"#Skipping_a_level_2\"},\"dsr\":[603,711,22,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[625,663,24,7]}'>1.1.1.1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[664,709,22,7]}'>Skipping a level</span></a></li></ul></li></ul></li></ul></li>\n<li data-parsoid='{\"dsr\":[712,908,1,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#Headline_2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#Headline_2\"},\"sa\":{\"href\":\"#Headline_2\"},\"dsr\":[714,802,14,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[728,760,24,7]}'>2</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[761,800,22,7]}'>Headline 2</span></a>\n<ul data-parsoid='{\"dsr\":[803,908,0,0]}'><li data-parsoid='{\"dsr\":[803,908,2,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#Another_headline\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#Another_headline\"},\"sa\":{\"href\":\"#Another_headline\"},\"dsr\":[806,908,20,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[826,860,24,7]}'>2.1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[861,906,22,7]}'>Another headline</span></a></li></ul></li></ul>\n\n</div>\n\n<h2 id=\"Headline_1\" data-parsoid='{\"dsr\":[918,934,2,2]}'>Headline 1</h2>\n\n<h3 id=\"Subheadline_1\" data-parsoid='{\"dsr\":[936,957,3,3]}'>Subheadline 1</h3>\n\n<h5 id=\"Skipping_a_level\" data-parsoid='{\"dsr\":[959,987,5,5]}'>Skipping a level</h5>\n\n<h6 id=\"Skipping_a_level_2\" data-parsoid='{\"dsr\":[989,1019,6,6]}'>Skipping a level</h6>\n\n<h2 id=\"Headline_2\" data-parsoid='{\"dsr\":[1021,1037,2,2]}'>Headline 2</h2>\n<p data-parsoid='{\"dsr\":[1038,1047,0,0]}'>Some text</p>\n\n<h3 id=\"Another_headline\" data-parsoid='{\"dsr\":[1049,1073,3,3]}'>Another headline</h3>\n");
add("html2html", "TOC regression (T11764)", "<div id=\"toc\" class=\"toc\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,850,26,6]}'>&lt;input type=\"checkbox\" role=\"button\" id=\"toctogglecheckbox\" class=\"toctogglecheckbox\" style=\"display:none\" /><div class=\"toctitle\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[135,296,42,6]}'>\n<h2 id=\"Contents\" data-parsoid='{\"dsr\":[178,192,2,2]}'>Contents</h2>\n<span class=\"toctogglespan\" data-parsoid='{\"stx\":\"html\",\"dsr\":[193,290,28,7]}'>&lt;label class=\"toctogglelabel\" for=\"toctogglecheckbox\">&lt;/label></span></div>\n\n<ul data-parsoid='{\"dsr\":[298,842,0,0]}'><li data-parsoid='{\"dsr\":[298,665,1,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#title_1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#title_1\"},\"sa\":{\"href\":\"#title_1\"},\"dsr\":[300,382,11,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[311,343,24,7]}'>1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[344,380,22,7]}'>title 1</span></a>\n<ul data-parsoid='{\"dsr\":[383,665,0,0]}'><li data-parsoid='{\"dsr\":[383,573,2,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#title_1.1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#title_1.1\"},\"sa\":{\"href\":\"#title_1.1\"},\"dsr\":[386,474,13,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[399,433,24,7]}'>1.1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[434,472,22,7]}'>title 1.1</span></a>\n<ul data-parsoid='{\"dsr\":[475,573,0,0]}'><li data-parsoid='{\"dsr\":[475,573,3,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#title_1.1.1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#title_1.1.1\"},\"sa\":{\"href\":\"#title_1.1.1\"},\"dsr\":[479,573,15,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[494,530,24,7]}'>1.1.1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[531,571,22,7]}'>title 1.1.1</span></a></li></ul></li>\n<li data-parsoid='{\"dsr\":[574,665,2,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#title_1.2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#title_1.2\"},\"sa\":{\"href\":\"#title_1.2\"},\"dsr\":[577,665,13,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[590,624,24,7]}'>1.2</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[625,663,22,7]}'>title 1.2</span></a></li></ul></li>\n<li data-parsoid='{\"dsr\":[666,842,1,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#title_2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#title_2\"},\"sa\":{\"href\":\"#title_2\"},\"dsr\":[668,750,11,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[679,711,24,7]}'>2</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[712,748,22,7]}'>title 2</span></a>\n<ul data-parsoid='{\"dsr\":[751,842,0,0]}'><li data-parsoid='{\"dsr\":[751,842,2,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#title_2.1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#title_2.1\"},\"sa\":{\"href\":\"#title_2.1\"},\"dsr\":[754,842,13,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[767,801,24,7]}'>2.1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[802,840,22,7]}'>title 2.1</span></a></li></ul></li></ul>\n\n</div>\n\n<h2 id=\"title_1\" data-parsoid='{\"dsr\":[852,865,2,2]}'>title 1</h2>\n\n<h3 id=\"title_1.1\" data-parsoid='{\"dsr\":[867,884,3,3]}'>title 1.1</h3>\n\n<h4 id=\"title_1.1.1\" data-parsoid='{\"dsr\":[886,907,4,4]}'>title 1.1.1</h4>\n\n<h3 id=\"title_1.2\" data-parsoid='{\"dsr\":[909,926,3,3]}'>title 1.2</h3>\n\n<h2 id=\"title_2\" data-parsoid='{\"dsr\":[928,941,2,2]}'>title 2</h2>\n\n<h3 id=\"title_2.1\" data-parsoid='{\"dsr\":[943,960,3,3]}'>title 2.1</h3>\n");
add("html2html", "TOC with wgMaxTocLevel=3 (T8204)", "<div id=\"toc\" class=\"toc\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,751,26,6]}'>&lt;input type=\"checkbox\" role=\"button\" id=\"toctogglecheckbox\" class=\"toctogglecheckbox\" style=\"display:none\" /><div class=\"toctitle\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[135,296,42,6]}'>\n<h2 id=\"Contents\" data-parsoid='{\"dsr\":[178,192,2,2]}'>Contents</h2>\n<span class=\"toctogglespan\" data-parsoid='{\"stx\":\"html\",\"dsr\":[193,290,28,7]}'>&lt;label class=\"toctogglelabel\" for=\"toctogglecheckbox\">&lt;/label></span></div>\n\n<ul data-parsoid='{\"dsr\":[298,743,0,0]}'><li data-parsoid='{\"dsr\":[298,566,1,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#title_1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#title_1\"},\"sa\":{\"href\":\"#title_1\"},\"dsr\":[300,382,11,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[311,343,24,7]}'>1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[344,380,22,7]}'>title 1</span></a>\n<ul data-parsoid='{\"dsr\":[383,566,0,0]}'><li data-parsoid='{\"dsr\":[383,474,2,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#title_1.1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#title_1.1\"},\"sa\":{\"href\":\"#title_1.1\"},\"dsr\":[386,474,13,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[399,433,24,7]}'>1.1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[434,472,22,7]}'>title 1.1</span></a></li>\n<li data-parsoid='{\"dsr\":[475,566,2,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#title_1.2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#title_1.2\"},\"sa\":{\"href\":\"#title_1.2\"},\"dsr\":[478,566,13,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[491,525,24,7]}'>1.2</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[526,564,22,7]}'>title 1.2</span></a></li></ul></li>\n<li data-parsoid='{\"dsr\":[567,743,1,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#title_2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#title_2\"},\"sa\":{\"href\":\"#title_2\"},\"dsr\":[569,651,11,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[580,612,24,7]}'>2</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[613,649,22,7]}'>title 2</span></a>\n<ul data-parsoid='{\"dsr\":[652,743,0,0]}'><li data-parsoid='{\"dsr\":[652,743,2,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#title_2.1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#title_2.1\"},\"sa\":{\"href\":\"#title_2.1\"},\"dsr\":[655,743,13,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[668,702,24,7]}'>2.1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[703,741,22,7]}'>title 2.1</span></a></li></ul></li></ul>\n\n</div>\n\n<h2 id=\"title_1\" data-parsoid='{\"dsr\":[753,766,2,2]}'>title 1</h2>\n\n<h3 id=\"title_1.1\" data-parsoid='{\"dsr\":[768,785,3,3]}'>title 1.1</h3>\n\n<h4 id=\"title_1.1.1\" data-parsoid='{\"dsr\":[787,808,4,4]}'>title 1.1.1</h4>\n\n<h3 id=\"title_1.2\" data-parsoid='{\"dsr\":[810,827,3,3]}'>title 1.2</h3>\n\n<h2 id=\"title_2\" data-parsoid='{\"dsr\":[829,842,2,2]}'>title 2</h2>\n\n<h3 id=\"title_2.1\" data-parsoid='{\"dsr\":[844,861,3,3]}'>title 2.1</h3>\n");
add("html2html", "TOC with wgMaxTocLevel=3 and two level four headings (T8204)", "<div id=\"toc\" class=\"toc\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,579,26,6]}'>&lt;input type=\"checkbox\" role=\"button\" id=\"toctogglecheckbox\" class=\"toctogglecheckbox\" style=\"display:none\" /><div class=\"toctitle\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[135,296,42,6]}'>\n<h2 id=\"Contents\" data-parsoid='{\"dsr\":[178,192,2,2]}'>Contents</h2>\n<span class=\"toctogglespan\" data-parsoid='{\"stx\":\"html\",\"dsr\":[193,290,28,7]}'>&lt;label class=\"toctogglelabel\" for=\"toctogglecheckbox\">&lt;/label></span></div>\n\n<ul data-parsoid='{\"dsr\":[298,571,0,0]}'><li data-parsoid='{\"dsr\":[298,482,1,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#Section_1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#Section_1\"},\"sa\":{\"href\":\"#Section_1\"},\"dsr\":[300,386,13,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[313,345,24,7]}'>1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[346,384,22,7]}'>Section 1</span></a>\n<ul data-parsoid='{\"dsr\":[387,482,0,0]}'><li data-parsoid='{\"dsr\":[387,482,2,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#Section_1.1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#Section_1.1\"},\"sa\":{\"href\":\"#Section_1.1\"},\"dsr\":[390,482,15,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[405,439,24,7]}'>1.1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[440,480,22,7]}'>Section 1.1</span></a></li></ul></li>\n<li data-parsoid='{\"dsr\":[483,571,1,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#Section_2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#Section_2\"},\"sa\":{\"href\":\"#Section_2\"},\"dsr\":[485,571,13,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[498,530,24,7]}'>2</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[531,569,22,7]}'>Section 2</span></a></li></ul>\n\n</div>\n\n<h2 id=\"Section_1\" data-parsoid='{\"dsr\":[581,596,2,2]}'>Section 1</h2>\n\n<h3 id=\"Section_1.1\" data-parsoid='{\"dsr\":[598,617,3,3]}'>Section 1.1</h3>\n\n<h4 id=\"Section_1.1.1\" data-parsoid='{\"dsr\":[619,642,4,4]}'>Section 1.1.1</h4>\n\n<h4 id=\"Section_1.1.1.1\" data-parsoid='{\"dsr\":[644,669,4,4]}'>Section 1.1.1.1</h4>\n\n<h2 id=\"Section_2\" data-parsoid='{\"dsr\":[671,686,2,2]}'>Section 2</h2>\n");
add("html2html", "Link inside a section heading", "<h2 id=\"Section_with_a_link_in_it\" data-parsoid='{\"dsr\":[0,50,2,2]}'>Section with a <a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[18,41,17,2]}'>link</a> in it</h2>\n");
add("html2html", "TOC regression (T14077)", "<div id=\"toc\" class=\"toc\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,567,26,6]}'>&lt;input type=\"checkbox\" role=\"button\" id=\"toctogglecheckbox\" class=\"toctogglecheckbox\" style=\"display:none\" /><div class=\"toctitle\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[135,296,42,6]}'>\n<h2 id=\"Contents\" data-parsoid='{\"dsr\":[178,192,2,2]}'>Contents</h2>\n<span class=\"toctogglespan\" data-parsoid='{\"stx\":\"html\",\"dsr\":[193,290,28,7]}'>&lt;label class=\"toctogglelabel\" for=\"toctogglecheckbox\">&lt;/label></span></div>\n\n<ul data-parsoid='{\"dsr\":[298,559,0,0]}'><li data-parsoid='{\"dsr\":[298,474,1,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#title_1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#title_1\"},\"sa\":{\"href\":\"#title_1\"},\"dsr\":[300,382,11,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[311,343,24,7]}'>1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[344,380,22,7]}'>title 1</span></a>\n<ul data-parsoid='{\"dsr\":[383,474,0,0]}'><li data-parsoid='{\"dsr\":[383,474,2,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#title_1.1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#title_1.1\"},\"sa\":{\"href\":\"#title_1.1\"},\"dsr\":[386,474,13,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[399,433,24,7]}'>1.1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[434,472,22,7]}'>title 1.1</span></a></li></ul></li>\n<li data-parsoid='{\"dsr\":[475,559,1,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#title_2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#title_2\"},\"sa\":{\"href\":\"#title_2\"},\"dsr\":[477,559,11,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[488,520,24,7]}'>2</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[521,557,22,7]}'>title 2</span></a></li></ul>\n\n</div>\n\n<h2 id=\"title_1\" data-parsoid='{\"dsr\":[569,582,2,2]}'>title 1</h2>\n\n<h3 id=\"title_1.1\" data-parsoid='{\"dsr\":[584,601,3,3]}'>title 1.1</h3>\n\n<h2 id=\"title_2\" data-parsoid='{\"dsr\":[603,616,2,2]}'>title 2</h2>\n");
add("html2html", "Character reference normalization in link text (T3938)", "<p data-parsoid='{\"dsr\":[0,28,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main Page\"},\"dsr\":[0,28,17,2]}'>this&amp;that</a></p>\n");
add("html2html", "(T21451) Links should refer to the normalized form.", "<p data-parsoid='{\"dsr\":[0,73,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/אַ\" title=\"Wiki/אַ\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/אַ\"},\"sa\":{\"href\":\"wiki/אַ\"},\"dsr\":[0,13,10,2]}'>אַ</a>\n<a rel=\"mw:WikiLink\" href=\"./Wiki/אַ\" title=\"Wiki/אַ\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/אַ\"},\"sa\":{\"href\":\"wiki/אַ\"},\"dsr\":[14,28,10,2]}'>אַ</a>\n<a rel=\"mw:WikiLink\" href=\"./Wiki/אַ\" title=\"Wiki/אַ\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/אַ\"},\"sa\":{\"href\":\"wiki/אַ\"},\"dsr\":[29,43,10,2]}'>אַ</a>\n<a rel=\"mw:WikiLink\" href=\"./Wiki/אַ\" title=\"Wiki/אַ\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/אַ\"},\"sa\":{\"href\":\"wiki/אַ\"},\"dsr\":[44,58,10,2]}'>אַ</a>\n<a rel=\"mw:WikiLink\" href=\"./Wiki/אַ\" title=\"Wiki/אַ\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/אַ\"},\"sa\":{\"href\":\"wiki/אַ\"},\"dsr\":[59,73,10,2]}'>אַ</a></p>\n");
add("html2html", "T4095: link with pipe and three closing brackets, version 2", "<p data-parsoid='{\"dsr\":[0,52,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page\" title=\"Main Page\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page\"},\"sa\":{\"href\":\"Main Page\"},\"dsr\":[0,52,12,2]}'><span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[12,50,8,9]}'>[http://example.com/]</span></a></p>");
add("html2html", "Table attribute safety", "<table data-parsoid='{\"dsr\":[0,44,2,2]}'>\n<tbody data-parsoid='{\"dsr\":[3,42,0,0]}'><tr data-parsoid='{\"autoInsertedStart\":true,\"dsr\":[3,41,0,0]}'><th style=\" \" data-parsoid='{\"a\":{\"style\":\" \"},\"sa\":{\"style\":\"/* insecure input */\"},\"dsr\":[3,41,32,0]}'>status</th></tr>\n</tbody></table>\n");
add("html2html", "CSS line continuation 1", "<div style=\" \" data-parsoid='{\"stx\":\"html\",\"a\":{\"style\":\" \"},\"sa\":{\"style\":\"/* insecure input */\"},\"dsr\":[0,40,34,6]}'></div>\n");
add("html2html", "CSS line continuation 2", "<div style=\" \" data-parsoid='{\"stx\":\"html\",\"a\":{\"style\":\" \"},\"sa\":{\"style\":\"/* invalid control char */\"},\"dsr\":[0,46,40,6]}'></div>\n");
add("html2html", "Sanitizer: Validating that <meta> and <link> work, but only for Microdata", "<div itemscope=\"\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,244,18,6]}'>\n\t<p data-parsoid='{\"dsr\":[20,236,0,0]}'>&lt;meta itemprop=\"hello\" content=\"world\" />\n\t&lt;meta http-equiv=\"refresh\" content=\"5\">\n\t&lt;meta itemprop=\"hello\" content=\"5\" />\n\t<a rel=\"mw:ExtLink\" class=\"external autonumber\" href=\"http://example.org\" data-parsoid='{\"targetOff\":162,\"contentOffsets\":[162,162],\"dsr\":[143,163,19,1]}'></a>\n\t&lt;link rel=\"stylesheet\" href=\"http://example.org\">\n\t<a rel=\"mw:ExtLink\" class=\"external autonumber\" href=\"http://example.org\" data-parsoid='{\"targetOff\":235,\"contentOffsets\":[235,235],\"dsr\":[216,236,19,1]}'></a></p>\n\n</div>\n");
add("html2html", "HTML ordered list item with parameters oddity", "<ol data-parsoid='{\"dsr\":[0,5,0,0]}'><li data-parsoid='{\"dsr\":[0,5,1,0]}'>One</li></ol>\n");
add("html2html", "Special page transclusion", "<ul data-parsoid='{\"dsr\":[0,24,0,0]}'><li data-parsoid='{\"dsr\":[0,24,1,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Xyzzyx\" title=\"Wiki/Xyzzyx\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Xyzzyx\"},\"sa\":{\"href\":\"wiki/Xyzzyx\"},\"dsr\":[2,24,14,2]}'>Xyzzyx</a></li></ul>\n");
add("html2html", "Special page transclusion twice (T7021)", "<ul data-parsoid='{\"dsr\":[0,24,0,0]}'><li data-parsoid='{\"dsr\":[0,24,1,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Xyzzyx\" title=\"Wiki/Xyzzyx\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Xyzzyx\"},\"sa\":{\"href\":\"wiki/Xyzzyx\"},\"dsr\":[2,24,14,2]}'>Xyzzyx</a></li></ul>\n\n<ul data-parsoid='{\"dsr\":[26,50,0,0]}'><li data-parsoid='{\"dsr\":[26,50,1,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Xyzzyx\" title=\"Wiki/Xyzzyx\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Xyzzyx\"},\"sa\":{\"href\":\"wiki/Xyzzyx\"},\"dsr\":[28,50,14,2]}'>Xyzzyx</a></li></ul>\n");
add("html2html", "Transclusion of nonexistent MediaWiki message", "<p data-parsoid='{\"dsr\":[0,84,0,0]}'>[/index.php?title=MediaWiki:Mainpagexxx&amp;action=edit&amp;redlink=1 MediaWiki:Mainpagexxx]</p>\n");
add("html2html", "Special:Search page linking.", "<p data-parsoid='{\"dsr\":[0,38,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Special:Search\" title=\"Wiki/Special:Search\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Special:Search\"},\"sa\":{\"href\":\"wiki/Special:Search\"},\"dsr\":[0,38,22,2]}'>Special:Search</a></p>\n");
add("html2html", "Say the magic word", "<ul data-parsoid='{\"dsr\":[0,308,0,0]}'><li data-parsoid='{\"dsr\":[0,13,1,0]}'>Parser test</li>\n<li data-parsoid='{\"dsr\":[14,27,1,0]}'>Parser_test</li>\n<li data-parsoid='{\"dsr\":[28,41,1,0]}'>Parser test</li>\n<li data-parsoid='{\"dsr\":[42,55,1,0]}'>Parser_test</li>\n<li data-parsoid='{\"dsr\":[56,69,1,0]}'>Parser test</li>\n<li data-parsoid='{\"dsr\":[70,83,1,0]}'>Parser_test</li>\n<li data-parsoid='{\"dsr\":[84,97,1,0]}'>Parser test</li>\n<li data-parsoid='{\"dsr\":[98,111,1,0]}'>Parser_test</li>\n<li data-parsoid='{\"dsr\":[112,125,1,0]}'>Parser test</li>\n<li data-parsoid='{\"dsr\":[126,139,1,0]}'>Parser_test</li>\n<li data-parsoid='{\"dsr\":[140,158,1,0]}'>Talk:Parser test</li>\n<li data-parsoid='{\"dsr\":[159,177,1,0]}'>Talk:Parser_test</li>\n<li data-parsoid='{\"dsr\":[178,191,1,0]}'>Parser test</li>\n<li data-parsoid='{\"dsr\":[192,205,1,0]}'>Parser_test</li>\n<li class=\"mw-empty-elt\" data-parsoid='{\"dsr\":[206,207,1,0]}'></li>\n<li class=\"mw-empty-elt\" data-parsoid='{\"dsr\":[208,209,1,0]}'></li>\n<li data-parsoid='{\"dsr\":[210,213,1,0]}'>0</li>\n<li data-parsoid='{\"dsr\":[214,220,1,0]}'>Talk</li>\n<li data-parsoid='{\"dsr\":[221,227,1,0]}'>Talk</li>\n<li class=\"mw-empty-elt\" data-parsoid='{\"dsr\":[228,229,1,0]}'></li>\n<li class=\"mw-empty-elt\" data-parsoid='{\"dsr\":[230,231,1,0]}'></li>\n<li data-parsoid='{\"dsr\":[232,308,1,0]}'>[/index.php?title=Template:Dynamic&amp;action=edit&amp;redlink=1 Template:Dynamic]</li></ul>\n");
add("html2html", "Parents of subpages, one level up", "<p data-parsoid='{\"dsr\":[0,62,0,0]}'>[/index.php?title=Subpage_test/L1/L2&amp;action=edit&amp;redlink=1 L2]</p>\n");
add("html2html", "Parents of subpages, one level up, not named", "<p data-parsoid='{\"dsr\":[0,78,0,0]}'>[/index.php?title=Subpage_test/L1/L2&amp;action=edit&amp;redlink=1 Subpage test/L1/L2]</p>\n");
add("html2html", "Parents of subpages, two levels up", "<p data-parsoid='{\"dsr\":[0,60,0,0]}'>[/index.php?title=Subpage_test/L1&amp;action=edit&amp;redlink=1 L1]2</p>\n\n<p data-parsoid='{\"dsr\":[62,122,0,0]}'>[/index.php?title=Subpage_test/L1&amp;action=edit&amp;redlink=1 L1l]</p>\n");
add("html2html", "Parents of subpages, two levels up, with lots of extra trailing slashes.", "<p data-parsoid='{\"dsr\":[0,72,0,0]}'>[/index.php?title=Subpage_test/L1&amp;action=edit&amp;redlink=1 Subpage test/L1]</p>\n");
add("html2html", "RAW magic word", "<p data-parsoid='{\"dsr\":[0,72,0,0]}'>[/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1 Template:QUERTY]</p>\n");
add("html2html", "Out-of-order TOC heading levels", "<div id=\"toc\" class=\"toc\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,757,26,6]}'>&lt;input type=\"checkbox\" role=\"button\" id=\"toctogglecheckbox\" class=\"toctogglecheckbox\" style=\"display:none\" /><div class=\"toctitle\" lang=\"en\" dir=\"ltr\" data-parsoid='{\"stx\":\"html\",\"dsr\":[135,296,42,6]}'>\n<h2 id=\"Contents\" data-parsoid='{\"dsr\":[178,192,2,2]}'>Contents</h2>\n<span class=\"toctogglespan\" data-parsoid='{\"stx\":\"html\",\"dsr\":[193,290,28,7]}'>&lt;label class=\"toctogglelabel\" for=\"toctogglecheckbox\">&lt;/label></span></div>\n\n<ul data-parsoid='{\"dsr\":[298,749,0,0]}'><li data-parsoid='{\"dsr\":[298,522,1,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#2\"},\"sa\":{\"href\":\"#2\"},\"dsr\":[300,370,5,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[305,337,24,7]}'>1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[338,368,22,7]}'>2</span></a>\n<ul data-parsoid='{\"dsr\":[371,522,0,0]}'><li data-parsoid='{\"dsr\":[371,446,2,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#6\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#6\"},\"sa\":{\"href\":\"#6\"},\"dsr\":[374,446,5,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[379,413,24,7]}'>1.1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[414,444,22,7]}'>6</span></a></li>\n<li data-parsoid='{\"dsr\":[447,522,2,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#3\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#3\"},\"sa\":{\"href\":\"#3\"},\"dsr\":[450,522,5,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[455,489,24,7]}'>1.2</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[490,520,22,7]}'>3</span></a></li></ul></li>\n<li data-parsoid='{\"dsr\":[523,749,1,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#1\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#1\"},\"sa\":{\"href\":\"#1\"},\"dsr\":[525,595,5,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[530,562,24,7]}'>2</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[563,593,22,7]}'>1</span></a>\n<ul data-parsoid='{\"dsr\":[596,749,0,0]}'><li data-parsoid='{\"dsr\":[596,671,2,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#5\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#5\"},\"sa\":{\"href\":\"#5\"},\"dsr\":[599,671,5,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[604,638,24,7]}'>2.1</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[639,669,22,7]}'>5</span></a></li>\n<li data-parsoid='{\"dsr\":[672,749,2,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page#2_2\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page#2_2\"},\"sa\":{\"href\":\"#2_2\"},\"dsr\":[675,749,7,2]}'><span class=\"tocnumber\" data-parsoid='{\"stx\":\"html\",\"dsr\":[682,716,24,7]}'>2.2</span> <span class=\"toctext\" data-parsoid='{\"stx\":\"html\",\"dsr\":[717,747,22,7]}'>2</span></a></li></ul></li></ul>\n\n</div>\n\n<h2 id=\"2\" data-parsoid='{\"dsr\":[759,766,2,2]}'>2</h2>\n\n<h6 id=\"6\" data-parsoid='{\"dsr\":[768,783,6,6]}'>6</h6>\n\n<h3 id=\"3\" data-parsoid='{\"dsr\":[785,794,3,3]}'>3</h3>\n\n<h1 id=\"1\" data-parsoid='{\"dsr\":[796,801,1,1]}'>1</h1>\n\n<h5 id=\"5\" data-parsoid='{\"dsr\":[803,816,5,5]}'>5</h5>\n\n<h2 id=\"2_2\" data-parsoid='{\"dsr\":[818,825,2,2]}'>2</h2>\n");
add("html2html", "Bad images - basic functionality", "<p data-parsoid='{\"dsr\":[0,16,0,0]}'><figure-inline class=\"mw-default-size\" typeof=\"mw:Error mw:Image\" data-parsoid='{\"optList\":[],\"dsr\":[0,16,null,null]}' data-mw='{\"errors\":[{\"key\":\"apierror-filedoesnotexist\",\"message\":\"This image does not exist.\"}]}'><a href=\"./File:Bad.jpg\" data-parsoid='{\"a\":{\"href\":\"./File:Bad.jpg\"},\"sa\":{\"href\":\"File:Bad.jpg\"}}'><img resource=\"./File:Bad.jpg\" src=\"./Special:FilePath/Bad.jpg\" height=\"220\" width=\"220\" data-parsoid='{\"a\":{\"resource\":\"./File:Bad.jpg\",\"height\":\"220\",\"width\":\"220\"},\"sa\":{\"resource\":\"File:Bad.jpg\"}}'/></a></figure-inline></p>");
add("html2html", "Bad images - T18039: text after bad image disappears", "<p data-parsoid='{\"dsr\":[0,32,0,0]}'>Foo bar\n<figure-inline class=\"mw-default-size\" typeof=\"mw:Error mw:Image\" data-parsoid='{\"optList\":[],\"dsr\":[8,24,null,null]}' data-mw='{\"errors\":[{\"key\":\"apierror-filedoesnotexist\",\"message\":\"This image does not exist.\"}]}'><a href=\"./File:Bad.jpg\" data-parsoid='{\"a\":{\"href\":\"./File:Bad.jpg\"},\"sa\":{\"href\":\"File:Bad.jpg\"}}'><img resource=\"./File:Bad.jpg\" src=\"./Special:FilePath/Bad.jpg\" height=\"220\" width=\"220\" data-parsoid='{\"a\":{\"resource\":\"./File:Bad.jpg\",\"height\":\"220\",\"width\":\"220\"},\"sa\":{\"resource\":\"File:Bad.jpg\"}}'/></a></figure-inline>\nBar foo</p>");
add("html2html", "T33098 Template which includes system messages which includes the template", "<p data-parsoid='{\"dsr\":[0,195,0,0]}'><span class=\"error\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,97,20,7]}'>Template loop detected: <a rel=\"mw:WikiLink\" href=\"./Wiki/Template:Identical\" title=\"Wiki/Template:Identical\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Template:Identical\"},\"sa\":{\"href\":\"wiki/Template:Identical\"},\"dsr\":[44,90,26,2]}'>Template:Identical</a></span>\n<span class=\"error\" data-parsoid='{\"stx\":\"html\",\"dsr\":[98,195,20,7]}'>Template loop detected: <a rel=\"mw:WikiLink\" href=\"./Wiki/Template:Identical\" title=\"Wiki/Template:Identical\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Template:Identical\"},\"sa\":{\"href\":\"wiki/Template:Identical\"},\"dsr\":[142,188,26,2]}'>Template:Identical</a></span></p>\n");
add("html2html", "T33490 Turkish: ucfırst (with a dotless i)", "<p data-parsoid='{\"dsr\":[0,90,0,0]}'>[/index.php?title=%C5%9Eablon:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1 Şablon:Ucfırst:blah]</p>\n");
add("html2html", "T33490 ucfırst (with a dotless i) with English language", "<p data-parsoid='{\"dsr\":[0,89,0,0]}'>[/index.php?title=Template:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1 Template:Ucfırst:blah]</p>\n");
add("html2html", "nowiki inside link inside heading (T20295)", "<h2 id=\"xyz\" data-parsoid='{\"dsr\":[0,22,2,2]}'><a rel=\"mw:WikiLink\" href=\"./Wiki/Foo\" title=\"Wiki/Foo\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Foo\"},\"sa\":{\"href\":\"wiki/Foo\"},\"dsr\":[3,19,11,2]}'>xyz</a></h2>\n");
add("html2html", "new support for bdi element (T33817)", "<p data-parsoid='{\"dsr\":[0,122,0,0]}'>ולדימיר לנין (ברוסית: <bdi lang=\"ru\" data-parsoid='{\"stx\":\"html\",\"dsr\":[22,57,15,6]}'>Владимир Ленин</bdi>, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.</p>\n");
add("html2html", "Empty LI and TR nodes should not be stripped from top-level content", "<ul data-parsoid='{\"dsr\":[0,9,0,0]}'><li data-parsoid='{\"dsr\":[0,3,1,0]}'>a</li>\n<li class=\"mw-empty-elt\" data-parsoid='{\"dsr\":[4,5,1,0]}'></li>\n<li data-parsoid='{\"dsr\":[6,9,1,0]}'>b</li></ul>\n\n<table data-parsoid='{\"dsr\":[11,24,2,2]}'>\n<tbody data-parsoid='{\"dsr\":[14,22,0,0]}'><tr data-parsoid='{\"startTagSrc\":\"|-\",\"dsr\":[14,21,2,0]}'>\n<td data-parsoid='{\"dsr\":[17,21,1,0]}'>foo</td></tr>\n</tbody></table>");
add("html2html", "Empty TR followed by a template-generated TR", "<table data-parsoid='{\"dsr\":[0,36,2,2]}'>\n<tbody about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[3,34,0,0],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"&lt;tr>&lt;td>foo&lt;/td>&lt;/tr>\"}},\"i\":0}},\"\\n\"]}'><tr><td>foo</td></tr>\n</tbody></table>");
add("html2html", "Empty TR followed by mixed-ws-comment line should RT correctly", "<table data-parsoid='{\"dsr\":[0,36,2,2]}'>\n\n <!--c--><tbody data-parsoid='{\"dsr\":[13,34,0,0]}'><tr data-parsoid='{\"startTagSrc\":\"|-\",\"dsr\":[13,25,2,0]}'>\n<!--c--> </tr><!--d-->\n</tbody></table>\n");
add("html2html", "T73074: More fostering fun", "<link rel=\"mw:PageProp/Category\" href=\"./Category:Two\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Category:Two\"},\"sa\":{\"href\":\"Category:Two\"},\"dsr\":[0,16,null,null]}'/>\n<link rel=\"mw:PageProp/Category\" href=\"./Category:Two\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Category:Two\"},\"sa\":{\"href\":\"Category:Two\"},\"fostered\":true,\"dsr\":[17,17]}'/><table data-parsoid='{\"stx\":\"html\",\"autoInsertedEnd\":true,\"dsr\":[17,70,7,0]}'><tbody data-parsoid='{\"dsr\":[24,70,0,0]}'><tr data-parsoid='{\"autoInsertedStart\":true,\"dsr\":[24,33,0,0]}'><td data-parsoid='{\"stx\":\"html\",\"dsr\":[24,33,4,5]}'></td></tr><tr about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"stx\":\"html\",\"autoInsertedEnd\":true,\"dsr\":[33,70,null,0],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"&lt;tr>\"}},\"i\":0}},\"&lt;!--c-->[[Category:Two]]\"]}'><!--c--></tr></tbody></table>");
add("html2html", "Image: upright option (parsoid)", "<figure class=\"mw-default-size\" typeof=\"mw:Image/Thumb\" data-parsoid='{\"optList\":[{\"ck\":\"thumbnail\",\"ak\":\"thumb\"},{\"ck\":\"caption\",\"ak\":\"caption\"}],\"dsr\":[0,33,2,2]}'><a href=\"./File:Foobar.jpg\" data-parsoid='{\"a\":{\"href\":\"./File:Foobar.jpg\"},\"sa\":{\"href\":\"File:Foobar.jpg\"},\"dsr\":[2,null,null,null]}'><img resource=\"./File:Foobar.jpg\" src=\"//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg\" data-file-width=\"1941\" data-file-height=\"220\" data-file-type=\"bitmap\" height=\"25\" width=\"220\" data-parsoid='{\"a\":{\"resource\":\"./File:Foobar.jpg\",\"height\":\"25\",\"width\":\"220\"},\"sa\":{\"resource\":\"File:Foobar.jpg\"}}'/></a><figcaption data-parsoid='{\"dsr\":[null,31,null,null]}'>caption</figcaption></figure>\n<figure class=\"mw-default-size\" typeof=\"mw:Image/Thumb\" data-parsoid='{\"optList\":[{\"ck\":\"thumbnail\",\"ak\":\"thumb\"},{\"ck\":\"caption\",\"ak\":\"caption\"}],\"dsr\":[34,67,2,2]}'><a href=\"./File:Foobar.jpg\" data-parsoid='{\"a\":{\"href\":\"./File:Foobar.jpg\"},\"sa\":{\"href\":\"File:Foobar.jpg\"},\"dsr\":[36,null,null,null]}'><img resource=\"./File:Foobar.jpg\" src=\"//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg\" data-file-width=\"1941\" data-file-height=\"220\" data-file-type=\"bitmap\" height=\"25\" width=\"220\" data-parsoid='{\"a\":{\"resource\":\"./File:Foobar.jpg\",\"height\":\"25\",\"width\":\"220\"},\"sa\":{\"resource\":\"File:Foobar.jpg\"}}'/></a><figcaption data-parsoid='{\"dsr\":[null,65,null,null]}'>caption</figcaption></figure>\n<figure typeof=\"mw:Image/Thumb\" data-parsoid='{\"optList\":[{\"ck\":\"thumbnail\",\"ak\":\"thumb\"},{\"ck\":\"width\",\"ak\":\"500x500px\"},{\"ck\":\"caption\",\"ak\":\"caption\"}],\"dsr\":[68,111,2,2]}'><a href=\"./File:Foobar.jpg\" data-parsoid='{\"a\":{\"href\":\"./File:Foobar.jpg\"},\"sa\":{\"href\":\"File:Foobar.jpg\"},\"dsr\":[70,null,null,null]}'><img resource=\"./File:Foobar.jpg\" src=\"//example.com/images/thumb/3/3a/Foobar.jpg/500px-Foobar.jpg\" data-file-width=\"1941\" data-file-height=\"220\" data-file-type=\"bitmap\" height=\"57\" width=\"500\" data-parsoid='{\"a\":{\"resource\":\"./File:Foobar.jpg\",\"height\":\"57\",\"width\":\"500\"},\"sa\":{\"resource\":\"File:Foobar.jpg\"}}'/></a><figcaption data-parsoid='{\"dsr\":[null,109,null,null]}'>caption</figcaption></figure>\n");
add("html2html", "Consecutive <pre>s should not get merged", "<pre data-parsoid='{\"dsr\":[0,2,1,0]}'>a</pre>\n\n<pre data-parsoid='{\"dsr\":[4,6,1,0]}'>b</pre>\n\n<pre data-parsoid='{\"dsr\":[8,10,1,0]}'>c</pre>\n\n<pre data-parsoid='{\"dsr\":[12,14,1,0]}'>d</pre>\n\n<pre data-parsoid='{\"dsr\":[16,19,1,0]}'>e</pre>\n\n<p data-parsoid='{\"dsr\":[21,23,0,0]}'>\n <br data-parsoid='{\"dsr\":[23,23,0,0]}'/></p>\n<pre data-parsoid='{\"dsr\":[24,26,1,0]}'>f</pre>\n");
// Blacklist for html2wt
add("html2wt", "Paragraphs with newline spacing with comment lines in between", "----\na\nb\n\n----\na\nb\n\n----\na\nb\n\n----\na\n\nb\n\n----\na\n\nb\n\n----\na\n\n\nb\n\n----\na\n\n\nb\n\n----\n");
add("html2wt", "Paragraphs with newline spacing with non-empty white-space lines in between", "----\na\n\nb\n\n----\na\n \n\nb\n\n----\n");
add("html2wt", "Paragraphs with newline spacing with non-empty mixed comment and white-space lines in between", "----\na\nb\n\n----\na\nb\n\n----\na\n\nb\n\n----\na\n \n\nb\n\n----\n");
add("html2wt", "Extra newlines: More paragraphs with indented comment", "a\n\n\nb\n");
add("html2wt", "Extra newlines followed by heading", "a\n\n\n= b =\n[/index.php?title=A&action=edit&redlink=1 a]\n\n\n= b =\n");
add("html2wt", "Extra newlines between heading and content are swallowed (Parsoid does not)", "= b =\n\n\n\n[[a]]");
add("html2wt", "Extra new lines before and after lists are preserved", "a\n\n\n* b\n\n\nc");
add("html2wt", "Parsing an URL", "http://fr.wikipedia.org/wiki/🍺\n");
add("html2wt", "Simple list", "* Item 1\n* Item 2\n");
add("html2wt", "Italics and bold", "* plain\n* plain''italic''plain\n* plain''italic''plain''italic''plain\n* plain'''bold'''plain\n* plain'''bold'''plain'''bold'''plain\n* plain''italic''plain'''bold'''plain\n* plain'''bold'''plain''italic''plain\n* plain''italic'''bold-italic'''italic''plain\n* plain'''bold''bold-italic''bold'''plain\n* plain'''''bold-italic'''italic''plain\n* plain'''''bold-italic''bold'''plain\n* plain''italic'''bold-italic'''''plain\n* plain'''bold''bold-italic'''''plain\n* plain l'''italic''plain\n* plain l''''bold''' plain\n");
add("html2wt", "Italics and possessives (1)", "obtained by ''[/index.php?title=Lunar_Prospector&action=edit&redlink=1 Lunar Prospector]'''s gamma-ray spectrometer\n");
add("html2wt", "Italics and possessives (3)", "The first monolingual dictionary written in a Romance language was ''Sebastián Covarrubias''' ''Tesoro de la lengua castellana o española'', published in 1611 in Madrid. In 1612 the first edition of the ''Vocabolario dell'[/index.php?title=Accademia_della_Crusca&action=edit&redlink=1 Accademia della Crusca]'', for Italian, was published. In 1690 in Rotterdam was published, posthumously, the ''Dictionnaire Universel''.\n");
add("html2wt", "<wbr> is valid wikitext (T54468)", "<wbr />\n");
add("html2wt", "Ruby markup (W3C-style)", "; Mono-ruby for individual base characters\n: <ruby>日<rt>に</rt>本<rt>ほん</rt>語<rt>ご</rt></ruby>\n; Group ruby\n: <ruby>今日<rt>きょう</rt></ruby>\n; Jukugo ruby\n: <ruby>法<rb>華</rb><rb>経</rb><rt>ほ</rt><rt>け</rt><rt>きょう</rt></ruby>\n; Inline ruby\n: <ruby>東<rb>京</rb><rp>(</rp><rt>とう</rt><rt>きょう</rt><rp>)</rp></ruby>\n; Double-sided ruby\n: <ruby><rb>旧</rb><rb>金</rb><rb>山</rb><rt>jiù</rt><rt>jīn</rt><rt>shān</rt><rtc>San Francisco</rtc></ruby>\n\n<ruby>\n<rb>♥</rb><rtc><rt>Heart</rt></rtc><rtc lang=\"fr\"><rt>Cœur</rt></rtc>\n<rb>☘</rb><rtc><rt>Shamrock</rt></rtc><rtc lang=\"fr\"><rt>Trèfle</rt></rtc>\n<rb>✶</rb><rtc><rt>Star</rt></rtc><rtc lang=\"fr\"><rt>Étoile</rt></rtc>\n</ruby>\n");
add("html2wt", "Non-word characters don't terminate tag names", "<blockquote|>a\n\n<b→> doesn't terminate </b→>\n\n<bä> doesn't terminate </bä>\n\n<boo> doesn't terminate </boo>\n\n<s.foo> doesn't terminate </s.foo>\n\n<sub-ID#1>\n");
add("html2wt", "Bare pipe character from a template (T54363)", "|\n");
add("html2wt", "T71950: 2. Put nowiki as close to cause as possible, after ' :'", "This text : L<nowiki>''</nowiki>[[Foo]]\n");
add("html2wt", "Comments and Indent-Pre", " asdf\n\n asdf\n\n asdf\n\nxyz\n\n asdf\n xyz\n");
add("html2wt", "Comment test 2a", "asdf\njkl\n");
add("html2wt", "Comment test 2b", "asdf\n\njkl\n");
add("html2wt", "Comment test 3", "asdf\njkl\n");
add("html2wt", "Comment test 4", "asdfjkl\n");
add("html2wt", "Comment spacing", "a\n\n b \n\nc\n");
add("html2wt", "Comment whitespace", "");
add("html2wt", "Comment in template title", "FOO\n");
add("html2wt", "Comment on its own line post-expand", "a\n\nb\n");
add("html2wt", "Comment on its own line post-expand with non-significant whitespace", "a\n\nb\n");
add("html2wt", "post-expand include size being exceeded", "[[wiki/Template:Echo3|Template:Echo3]]<!-- WARNING: template omitted, post-expand include size too large -->\n");
add("html2wt", "max template depth being reached", "<span class=\"error\">Template recursion depth limit exceeded (1)</span>\n");
add("html2wt", "multiple templates that are redirects", "FOO\nFOO\n");
add("html2wt", "Block tag on one line (<div>)", "a <div>foo</div>\nb\n");
add("html2wt", "Block tag on one line (<blockquote>)", "a <blockquote>foo</blockquote>\nb\n");
add("html2wt", "Block tag on both lines (<div>)", "a <div>foo</div>\nb <div>foo</div>");
add("html2wt", "Block tag on both lines (<blockquote>)", "a <blockquote>foo</blockquote>\nb <blockquote>foo</blockquote>");
add("html2wt", "Multiple lines without block tags", "<div>foo</div> a\n\nb\nc\nd e\n\nx <div>foo</div> z\n");
add("html2wt", "Preformatted text", " This is some\n Preformatted text\n With ''italic''\n And '''bold'''\n And a [[wiki/Main Page|link]]\n");
add("html2wt", "<pre> with <nowiki> inside (compatibility with 1.6 and earlier)", " <nowiki><b></nowiki>\n <nowiki><cite></nowiki>\n <nowiki><em></nowiki>\n");
add("html2wt", "Regression with preformatted in <center>", "<center>\n Blah\n\n</center>\n");
add("html2wt", "T54763: Preformatted in <blockquote>", "<blockquote>\n Blah\n\n{|\n|\n indented cell (no pre-wrapping!)\n|}\n</blockquote>\n");
add("html2wt", "T53086: Double newlines in blockquotes should be turned into paragraphs", "<blockquote>\nFoo\n\nBar\n\n</blockquote>\n");
add("html2wt", "T17491: <ins>/<del> in blockquote", "<blockquote>\nFoo <del>bar</del> <ins>baz</ins> quux\n\n</blockquote>");
add("html2wt", "<pre> with attributes (T5202)", " Bluescreen of WikiDeath\n");
add("html2wt", "<pre> with width attribute (T5202)", " Narrow screen goodies\n");
add("html2wt", "<pre> with forbidden attribute (T5202)", " Narrow screen goodies\n");
add("html2wt", "Entities inside <pre>", " <\n");
add("html2wt", "<pre> with forbidden attribute values (T5202)", " Narrow screen goodies\n");
add("html2wt", "<nowiki> inside <pre> (T15238)", " &lt;nowiki&gt;\n\n \n\n &lt;nowiki&gt;Foo&lt;/nowiki&gt;\n");
add("html2wt", "HTML pre followed by indent-pre", " foo\n\n bar\n");
add("html2wt", "Templates: Indent-Pre: 1a. Templates that break a line should suppress <pre>", "");
add("html2wt", "Templates: Indent-Pre: 1b. Templates that break a line should suppress <pre>", "foo\n");
add("html2wt", "Templates: Indent-Pre: 1c: Wrapping should be based on expanded content", " a\n\nb\n");
add("html2wt", "Templates: Indent-Pre: 1d: Wrapping should be based on expanded content", " a\n\nb\nc\n\n d\n\ne\n");
add("html2wt", "Templates: Indent-Pre: 1e. Wrapping should be based on expanded content", " foo\n\n foo bar\n\n foo\n bar\n\n foo\n\n foo\n\n bar\n");
add("html2wt", "Templates: Indent-Pre: 1f: Wrapping should be based on expanded content", " a\n\n\n a\n\n\n b\n\na\n\n b\n\na\n\n b\n");
add("html2wt", "Templates: Strip leading and trailing whitespace from named-param values", "a\n\nb\n\nc\n\n* d\n");
add("html2wt", "Templates: Don't strip whitespace from positional-param values", "a \n\nb \n\n c \n\n\n d\n\n\n e\n\n\n* f\n\n\n g\n");
add("html2wt", "Templates: Handle comments in the target", "{{echo\n<!-- should be ignored -->|foo}}\n\n{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->|foo}}\n\n{{echo<!-- should be ignored -->|foo}}\n\n{{echo<!-- should be ignored -->|foo}}\n\n{{echo|foo}}");
add("html2wt", "Templates: Handle comments in parameter names (T69657)", "{{echo|1\n<!-- should be ignored -->=foo}}\n\n{{echo|<!-- should be ignored -->\n1=foo}}\n\n{{echo|1<!-- should be ignored -->=foo}}\n\n{{echo|<!-- should be ignored -->1=foo}}");
add("html2wt", "1a. Indent-Pre and Comments", " a\n\nc\n");
add("html2wt", "1b. Indent-Pre and Comments", " a\n\nc\n");
add("html2wt", "1c. Indent-Pre and Comments", " a\n\n a\n");
add("html2wt", "1d. Indent-Pre and Comments\n(Pre-handler currently cannot distinguish between comment/ws order and normalizes them to [comment,ws] order)", " a\n\n b\n");
add("html2wt", "2a. Indent-Pre and tables", "{|\n!h1\n!h2\n|foo\n|bar\n|}\n");
add("html2wt", "2b. Indent-Pre and tables", "{|\n|foo\n|}\n");
add("html2wt", "2c. Indent-Pre and tables (T44252)", "{|\n|+foo\n!bar\n|}\n");
add("html2wt", "2d. Indent-Pre and tables", " a\n {|\n | b\n |}");
add("html2wt", "2g. Indented table markup mixed with indented pre content (proposed in T8200)", " {| \n |\n Text that should be rendered preformatted \n |}\n");
add("html2wt", "3c. Indent-Pre and block tags (pre-content on separate line)", "\n<nowiki> </nowiki>foo\n\n<div>\n foo\n\n</div>\n<center>\n foo\n\n</center>\n<blockquote>\n foo\n\n</blockquote>\n<blockquote>\n foo\n\n</blockquote>\n{|\n|\n foo\n|}\n\n* foo\n");
add("html2wt", "Render paragraphs when indent-pre is suppressed in blocklevels", "<blockquote>\n foo\n\n bar\n\n</blockquote>\n");
add("html2wt", "4. Multiple spaces at start-of-line", "<nowiki> </nowiki> foo \n foo\n\n{|\n|foo\n|}\n");
add("html2wt", "6. Pre-blocks should extend across lines with leading WS even when there is no wrappable content", " a\n \n b\n\n c\n \n\nd\n");
add("html2wt", "HTML-pre: 2: indented text", " foo\n");
add("html2wt", "Simple definition", "; name\n: Definition\n");
add("html2wt", "Definition list for indentation only", ": Indented text\n");
add("html2wt", "Definition list with no space", "; name\n: Definition\n");
add("html2wt", "Definition list with URL link", "; http://example.com/\n: definition\n");
add("html2wt", "Definition list with bracketed URL link", "; [http://www.example.com/ Example]\n: Something about it\n");
add("html2wt", "Definition list with wikilink containing colon", "; [/index.php?title=Help:FAQ&action=edit&redlink=1 Help:FAQ]\n: The least-read page on Wikipedia\n");
add("html2wt", "Definition list with news link containing colon", "; news:alt.wikipedia.rox<nowiki/>:This isn't even a real newsgroup!");
add("html2wt", "Malformed definition list with colon", "; news:alt.wikipedia.rox -- don't crash or enter an infinite loop\n");
add("html2wt", "Definition lists: colon in external link text", "; [http://www.wikipedia2.org/ Wikipedia :The Next Generation]\n: OK, I made that up\n");
add("html2wt", "Definition lists: colon in HTML attribute", "; '''bold'''\n");
add("html2wt", "Definition lists: self-closed tag", "; one<br />two\n: two-line fun\n");
add("html2wt", "Definition lists: ignore colons inside tags", "; one '''two : tag ''fun:'':'''\n: def\n");
add("html2wt", "Definition lists: excess closed tags", "\n; onetwo\n: bad tag fun\n");
add("html2wt", "T13748: Literal closing tags", "\n; test 1\n: test test test test test\n; test 2\n: test test test test test\n");
add("html2wt", "Definition and unordered list using wiki syntax nested in unordered list using html tags.", "\n*; term\n*: description\n** unordered\n");
add("html2wt", "Definition list with empty definition and following paragraph", "; term\n:\n\nParagraph text\n");
add("html2wt", "Nested definition lists using html syntax", "; x\n: a\n: b\n");
add("html2wt", "Definition Lists: No nesting: Multiple dd's", "; x\n: a\n: b\n");
add("html2wt", "Definition Lists: Indentation: Regular", ": i1\n:: i2\n::: i3\n");
add("html2wt", "Definition Lists: Indentation: Missing 1st level", ":: i2\n::: i3\n");
add("html2wt", "Definition Lists: Indentation: Multi-level indent", "::: i3\n");
add("html2wt", "Definition Lists: Hacky use to indent tables", ":: {|\n|foo\n|bar\n|}\n\nthis text\nshould be left alone\n");
add("html2wt", "Definition Lists: Hacky use to indent tables (with content following table)", ": {|\n|foo\n|bar\n|} <!--c1--> this text should be part of the dl");
add("html2wt", "Definition Lists: Hacky use to indent tables, with comments (T65979)", "<!-- foo -->\n:: {|\n|foo\n|bar\n|}<!-- bar -->\n\nthis text\nshould be left alone");
add("html2wt", "Definition Lists: Hacky use to indent tables (WS-insensitive)", ": {|\n|a\n|}\n");
add("html2wt", "Table / list interaction: indented table with lists in table contents", ": {|\n|a\n\n* b\n|-\n|c\n\n* d\n|}\n");
add("html2wt", "Table / list interaction: lists nested in tables nested in indented lists", ": {|\n|\n: a\n: b\n|\n* c\n* d\n|}\n\n* e\n* f\n");
add("html2wt", "Definition Lists: Nesting: Multi-level (Parsoid only)", "\n; t1 \n: d1 \n;; t2 \n;: :d2 \n;;; t3 \n;;: ::d3 \n");
add("html2wt", "Definition Lists: Nesting: Test 2", "; t1\n:: d2\n");
add("html2wt", "Definition Lists: Nesting: Test 3", ":; t1\n:::: d2\n");
add("html2wt", "Definition Lists: Nesting: Test 4", "::; t3\n::: d3\n");
add("html2wt", "Definition Lists: Mixed Lists: Test 1", "\n:;* foo\n::* bar\n:; baz\n");
add("html2wt", "Definition Lists: Mixed Lists: Test 2", "*: d1\n*: d2\n");
add("html2wt", "Definition Lists: Mixed Lists: Test 3", "*::: d1\n*::: d2\n");
add("html2wt", "Definition Lists: Mixed Lists: Test 4", "*; d1\n*: d2\n*; d3\n*: d4\n");
add("html2wt", "Definition Lists: Mixed Lists: Test 5", "*: d1\n*:: d2\n");
add("html2wt", "Definition Lists: Mixed Lists: Test 6", "#*: d1\n#*::: d3\n");
add("html2wt", "Definition Lists: Mixed Lists: Test 7", ":* d1\n:* d2\n");
add("html2wt", "Definition Lists: Mixed Lists: Test 8", ":* d1\n::* d2\n");
add("html2wt", "Definition Lists: Mixed Lists: Test 9", "*; foo\n*: bar\n");
add("html2wt", "Definition Lists: Mixed Lists: Test 10", "*#; foo\n*#: bar\n");
add("html2wt", "Definition Lists: Mixed Lists: Test 11", "; a\n:* b\n");
add("html2wt", "Definition Lists: Mixed Lists: Test 12", "\n*#*#;*;; foo:bar\n*#*#; boo:baz\n");
add("html2wt", "Definition Lists: Mixed Lists: Test 13", "*#*#; foo \n*#*#:*;; bar\n*#; boo \n*#: baz\n");
add("html2wt", "Definition Lists: Weird Ones: Test 1", "\n*#;*::;; foo:bar (who uses this?)\n");
add("html2wt", "Definition Lists: colons occurring in tags", "; a:b\n; '''a:b'''\n; <i>a:b</i>\n; <span>a:b</span>\n; <div>a:b</div>\n; <div>a\n: b\n; {{echo|a:b}}\n; {{echo|''a:b''}}\n;;; ''a:b''\n");
add("html2wt", "Definition Lists: colons and tables 1", ": {|\n|x\n|}\n: {|\n|y\n|}\n");
add("html2wt", "External links: Free with trailing punctuation", "http://example.com,\nhttp://example.com;\nhttp://example.com\\\nhttp://example.com.\nhttp://example.com:\nhttp://example.com!\nhttp://example.com?\nhttp://example.com)\nhttp://example.com/url_with_(brackets)\n(http://example.com/url_without_brackets)\nhttp://example.com/url_with_entity&\nhttp://example.com/url_with_entity&\nhttp://example.com/url_with_entity&\nhttp://example.com/url_with_entity&nbsp;\nhttp://example.com/url_with_entity&#xA0;\nhttp://example.com/url_with_entity&#160;\nhttp://example.com/url_with_entity&lt;\nhttp://example.com/url_with_entity&#x3C;\nhttp://example.com/url_with_entity&#60;");
add("html2wt", "External links: raw ampersand", "Old & use: http://x&y\n");
add("html2wt", "External links: encoded ampersand", "Old &#x26; use: http://x&y");
add("html2wt", "External links: encoded equals (T8102)", "http://example.com/?foo=bar");
add("html2wt", "External links: [raw ampersand]", "Old &#x26; use: [http://x&y]");
add("html2wt", "T2289: \">\"-token in bracketed URL", "[http://www.example.com/ <hello> stuff]\n");
add("html2wt", "T2289: literal \">\"-token in bracketed URL", "[http://www.example.com/ '''html''' stuff]\n");
add("html2wt", "T2289: literal double quote in bracketed URL", "[http://www.example.com/ \"hello\" stuff]\n");
add("html2wt", "External links: multiple legal whitespace is fine, Magnus. Don't break it please. (T7081)", "[http://www.example.com test]\n");
add("html2wt", "Bracketed external links with template-generated invalid target", "[http:/example.com title]\n");
add("html2wt", "T4702: Mismatched <i>, <b> and <a> tags are invalid", "[http://example.com ''text'']\n[http://example.com '''text''']\n''Something ''[http://example.com ''in italic'']\n''Something ''[http://example.com ''mixed''''', even bold''']\n'''''Now '''''[http://example.com '''''both''''']\n");
add("html2wt", "External link containing double-single-quotes in text embedded in italics (T6598 sanity check)", "''Some ''[http://example.com/ ''pretty ''italics'' and stuff'']''!''\n");
add("html2wt", "External link containing double-single-quotes with no space separating the url from text in italics", "[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm ''La muerte de Casagemas'' (1901) en el sitio de ][[Museo Picasso (París)|Museo Picasso]]<span>.</span>");
add("html2wt", "URL-encoding in URL functions (single parameter)", "/index.php?title=Some_page&amp=&\n");
add("html2wt", "URL-encoding in URL functions (multiple parameters)", "/index.php?title=Some_page&q=?&amp=&\n");
add("html2wt", "IPv6 urls, autolink format (T23261)", "http://[2404:130:0:1000::187:2]/index.php\n\nExamples from RFC 2373, section 2.2:\n\n* http://[1080::8:800:200C:417A]/unicast\n* http://[FF01::101]/multicast\n* http://[::1]/loopback\n* http://[::]/unspecified\n* http://[::13.1.68.3]/ipv4compat\n* http://[::FFFF:129.144.52.38]/ipv4compat\n\nExamples from RFC 2732, section 2:\n\n* http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html\n* http://[1080:0:0:0:8:800:200C:417A]/index.html\n* http://[3ffe:2a00:100:7031::1]\n* http://[1080::8:800:200C:417A]/foo\n* http://[::192.9.5.5]/ipng\n* http://[::FFFF:129.144.52.38]:80/index.html\n* http://[2010:836B:4179::836B:4179]");
add("html2wt", "IPv6 urls, bracketed format (T23261)", "[http://[2404:130:0:1000::187:2]/index.php test]\n\nExamples from RFC 2373, section 2.2:\n\n* [http://[1080::8:800:200C:417A] unicast]\n* [http://[FF01::101] multicast]\n* [http://[::1]/ loopback]\n* [http://[::] unspecified]\n* [http://[::13.1.68.3] ipv4compat]\n* [http://[::FFFF:129.144.52.38] ipv4compat]\n\nExamples from RFC 2732, section 2:\n\n* [http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html 1]\n* [http://[1080:0:0:0:8:800:200C:417A]/index.html 2]\n* [http://[3ffe:2a00:100:7031::1] 3]\n* [http://[1080::8:800:200C:417A]/foo 4]\n* [http://[::192.9.5.5]/ipng 5]\n* [http://[::FFFF:129.144.52.38]:80/index.html 6]\n* [http://[2010:836B:4179::836B:4179] 7]");
add("html2wt", "Unclosed and unmatched quotes", "'''''Bold italic text '''with bold deactivated''' in between.'''''\n\n'''''Bold italic text ''with italic deactivated'' in between.'''''\n\n'''Bold text..'''\n\n..spanning two paragraphs (should not work).'''<nowiki/>'''\n\n'''Bold tag left open'''\n\n''Italic tag left open''\n\nNormal text.\n\n<!-- Unmatching number of opening, closing tags: -->\n'''This year'<nowiki/>'''s election ''should'' beat '''last year''''s.\n\n''Tom'''s car is bigger than '''''<nowiki/>'''Susan'''s.\n\nPlain ''italic'''s plain\n");
add("html2wt", "A table with caption with default-spaced attributes and a table row", "{|\n|+ style=\"color: red;\" |caption1\n|foo\n|}\n");
add("html2wt", "A table with captions with non-default spaced attributes and a table row", "{|\n|+ style=\"color: red;\" |caption2\n|+ style=\"color: red;\" |caption3\n|foo\n|}\n");
add("html2wt", "Table td-cell syntax variations", "{|\n|baz\n|foo bar foo\n|baz\n| style=\"color:red;\" |baz\n|style='color:red;'\n|baz\n|}\n");
add("html2wt", "Simple table", "{|\n|1\n|2\n|-\n|3\n|4\n|}\n");
add("html2wt", "Simple table but with multiple dashes for row wikitext", "{|\n|foo\n|-\n|bar\n|}\n");
add("html2wt", "Multiplication table", "{| border=\"1\" cellpadding=\"2\"\n|+Multiplication table\n!×\n!1\n!2\n!3\n|-\n!1\n|1\n|2\n|3\n|-\n!2\n|2\n|4\n|6\n|-\n!3\n|3\n|6\n|9\n|-\n!4\n|4\n|8\n|12\n|-\n!5\n|5\n|10\n|15\n|}\n");
add("html2wt", "Accept \"||\" in table headings", "{|\n!h1\n!h2\n|}\n");
add("html2wt", "Accept \"!!\" in table data", "{|\n| Foo!! ||\n|}");
add("html2wt", "Accept \"||\" in indented table headings", ": {|\n!h1\n!h2\n|}\n");
add("html2wt", "Accept empty attributes in td/th cells (td/th cells starting with leading ||)", "{|\n!h1\n|a\n|}\n");
add("html2wt", "Accept \"| !\" at start of line in tables (ignore !-attribute)", "{|\n|bar\n|}\n");
add("html2wt", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- ", "{|\n| style=\"color:red;\" |+1\n| style=\"color:blue;\" |-1\n|-\n|1\n|2\n|3\n|1\n|<nowiki>+2</nowiki>\n|<nowiki>-3</nowiki>\n|-\n|<nowiki>+1</nowiki>\n|<nowiki>-1</nowiki>\n|}\n");
add("html2wt", "Table rowspan", "{| border=\"1\"\n|Cell 1, row 1\n| rowspan=\"2\" |Cell 2, row 1 (and 2)\n|Cell 3, row 1\n|-\n|Cell 1, row 2\n|Cell 3, row 2\n|}\n");
add("html2wt", "Nested table", "{| border=\"1\"\n|α\n|\n{| bgcolor=\"#ABCDEF\" border=\"2\"\n|nested\n|-\n|table\n|}\n|the original table again\n|}\n");
add("html2wt", "Invalid attributes in table cell (T3830)", "{|\n|broken\n|}\n");
add("html2wt", "Table cell attributes: Pipes protected by nowikis should be treated as a plain character", "{|\n| title=\"foo\" |bar\n| title=\"foo<nowiki>|</nowiki>\" |bar\n| title=\"foo<nowiki>|</nowiki>\" bar\n|}");
add("html2wt", "1. Template-generated table cell attributes and cell content", "{|\n| style=\"color:red;\" |Foo\n| style=\"color:red;\" |Foo\n|style=\"color:red;\"\n|Bar\n| style=\"color:red;\" |Foo\n| align=\"center\" style=\"color:red;\" |Foo\n| align=\"center\" style=\"color:red;\" |Foo\n|}\n");
add("html2wt", "Wikitext table with a lot of comments", "{|\n|foo\n|-\n|\n|}\n");
add("html2wt", "Table cell with a single comment", "{|\n|\n|a\n|}\n");
add("html2wt", "Build table with {{!}}", "{| class=\"wikitable\"\n!header\n!second header\n|- style=\"color:red;\"\n|data\n| style=\"color:red;\" |second data\n|}\n");
add("html2wt", "Build table with pipe as data", "{| class=\"wikitable\"\n!header\n!second header\n|- style=\"color:red;\"\n|data\n| style=\"color:red;\" |second data\n|-\n| style=\"color:red;\" |<nowiki>data with |</nowiki>\n| style=\"color:red;\" |<nowiki>second data with |</nowiki>\n|-\n|<nowiki>data with |</nowiki>\n|<nowiki>second data with |</nowiki>\n|}\n");
add("html2wt", "Build table with wikilink", "{| class=\"wikitable\"\n!header\n!second header\n|- style=\"color:red;\"\n|data [[wiki/Main Page|linktext]]\n|second data [[wiki/Main Page|linktext]]\n|-\n|data\n|second data [[wiki/Main Page|link|text with pipe]]\n|}\n");
add("html2wt", "Wikitext table with html-syntax row", "{|\n|foo\n|}");
add("html2wt", "Plain link, capitalized", "[[wiki/Main Page|Main Page]]\n");
add("html2wt", "Plain link, uncapitalized", "[[wiki/Main Page|main Page]]\n");
add("html2wt", "Piped link", "[[wiki/Main Page|The Main Page]]\n");
add("html2wt", "Piped link with comment in link text", "[[wiki/Main Page|The Main Page]]\n");
add("html2wt", "Piped link with multiple pipe characters in link text", "[[Main Page|<nowiki>|The|Main|Page|</nowiki>]]");
add("html2wt", "Broken link", "[/index.php?title=Zigzagzogzagzig&action=edit&redlink=1 Zigzagzogzagzig]\n");
add("html2wt", "Broken link with fragment", "[/index.php?title=Zigzagzogzagzig&action=edit&redlink=1 Zigzagzogzagzig#zug]\n");
add("html2wt", "Special page link with fragment", "[[wiki/Special:Version#anchor|Special:Version#anchor]]\n");
add("html2wt", "Nonexistent special page link with fragment", "[[wiki/Special:ThisNameWillHopefullyNeverBeUsed|Special:ThisNameWillHopefullyNeverBeUsed#anchor]]\n");
add("html2wt", "Link with prefix", "xxx[[wiki/Main Page|main Page]], xxx[[wiki/Main Page|Main Page]], Xxx[[wiki/Main Page|main Page]] XXX[[wiki/Main Page|main Page]], XXX[[wiki/Main Page|Main Page]]\n");
add("html2wt", "Link with suffix", "[[wiki/Main Page|Main Pagexxx]], [[wiki/Main Page|Main Page]]XXX, [[wiki/Main Page|Main Page]]!!!\n");
add("html2wt", "T45661: Piped links with identical prefixes", "[[wiki/Prefixed article|prefixed articles with spaces]]\n\n[[wiki/Prefixed article|prefixed articlesaoeu]]\n\n[[wiki/Main Page|Main Page test]]\n");
add("html2wt", "Link with 4 brackets", "[[[[wiki/Main Page|Main Page]]]]\n");
add("html2wt", "Link with multiple pipes", "[[wiki/Main Page|The|Main|Page]]\n");
add("html2wt", "Link to namespaces", "[/index.php?title=Talk:Parser_testing&action=edit&redlink=1 Talk:Parser testing], [/index.php?title=Meta:Disclaimers&action=edit&redlink=1 Meta:Disclaimers]\n");
add("html2wt", "Link with space in namespace", "[/index.php?title=User_talk:Foo_bar&action=edit&redlink=1 User talk:Foo bar]\n");
add("html2wt", "Namespace takes precedence over interwiki link (T53680)", "[[wiki/MemoryAlpha:AlphaTest|MemoryAlpha:AlphaTest]]\n");
add("html2wt", "Piped link to namespace", "[/index.php?title=Meta:Disclaimers&action=edit&redlink=1 The disclaimers]\n");
add("html2wt", "Link containing double-single-quotes '' in text embedded in italics (T6598 sanity check)", "''Some [/index.php?title=Link&action=edit&redlink=1 pretty ''italics'' and stuff]!''\n");
add("html2wt", "Plain link to page with question mark in title", "[[wiki/A?b|A?b]]\n\n[[wiki/A?b|Baz]]\n");
add("html2wt", "T2337: Escaped self-links should be bold", "[[Bug462]] [[Bug462]]");
add("html2wt", "Self-link to section should not be bold", "[[wiki/Main Page#section|Main Page#section]]\n");
add("html2wt", "Self-link to numeric title", "0\n");
add("html2wt", "Link to numeric-equivalent title", "[[wiki/00|00]]\n");
add("html2wt", "<nowiki> inside a link", "<nowiki>[[Main Page]]</nowiki> [[wiki/Main Page|the main page [it's not very good]]]\n");
add("html2wt", "Non-breaking spaces in title", "[[wiki/Main Page|  Main   Page  ]]\n");
add("html2wt", "Internal link with ca linktrail, surrounded by bold apostrophes (T29473 primary issue)", "'''[[wiki/Main Page|Main Page]]'''\n");
add("html2wt", "Internal link with ca linktrail, surrounded by italic apostrophes (T29473 primary issue)", "''[[wiki/Main Page|Main Page]]''\n");
add("html2wt", "Internal link with en linktrail: no apostrophes (T29473)", "[/index.php?title=Something&action=edit&redlink=1 Something]'nice\n");
add("html2wt", "Internal link with ca linktrail with apostrophes (T29473)", "[/index.php?title=Something&action=edit&redlink=1 Something'nice]\n");
add("html2wt", "Internal link with kaa linktrail with apostrophes (T29473)", "[/index.php?title=Something&action=edit&redlink=1 Something'nice]\n");
add("html2wt", "Internal link with is link prefix", "Aðrir [[wiki/Söfnuður|mótmælendasöfnuðir]] og\n");
add("html2wt", "Internal link with is link trail and link prefix", "[[wiki/Mótmælendatrú|xxxar]]\n[[wiki/Mótmælendatrú|mótmælendatrúar]]\n[[wiki/Söfnuður|mótmælendasöfnuður]]\n[[wiki/Söfnuður|mótmælendasöfnuðir]]\n[[wiki/Söfnuður|mótmælendasöfnuðirxxx]]\n");
add("html2wt", "Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved", "[[wiki/Foo| bar]]\n\n[[wiki/Foo| ''bar'']]\n\n[http://wp.org foo]\n\n[http://wp.org ''foo'']\n");
add("html2wt", "Interwiki link with fragment (T4130)", "[[meatball:SoftSecurity#foo|MeatBall:SoftSecurity#foo]]\n");
add("html2wt", "Escaping of interlanguage links (T129218, T156308)", "Blah blah blah\n[[:es:Spanish]]\n[[:zh:Chinese| zh : Chinese ]]");
add("html2wt", "Parsoid-specific test: Wikilinks with &nbsp; should RT properly", "[/index.php?title=WW_II&action=edit&redlink=1 WW II]\n");
add("html2wt", "<br> to <br />", "123\n");
add("html2wt", "Incorrecly removing closing slashes from correctly formed XHTML", "\n\n");
add("html2wt", "Failing to transform badly formed HTML into correct XHTML", "\n\n\n");
-add("html2wt", "Handling html with a div self-closing tag", "<div title=\"\" />\n<div title=\"\" />\n<div title=\"\" />\n<div title=\"bar\" />\n<div title=\"bar\" />\n<div title=\"bar/\">");
+add("html2wt", "Handling html with a div self-closing tag", "<div title=\"\" />\n<div title=\"\" />\n<div title=\"\">\n<div title=\"bar\" />\n<div title=\"bar\" />\n<div title=\"bar/\">");
add("html2wt", "Handling html with a br self-closing tag", "\n\n\n");
add("html2wt", "Horizontal ruler (should it add that extra space?)", "----\n----\nfoo \n---- bar\n");
add("html2wt", "Horizontal ruler -- eats additional dashes on the same line", "----\n");
add("html2wt", "Common list", "* Common list\n* item 2\n* item 3\n");
add("html2wt", "Numbered list", "# Numbered list\n# item 2\n# item 3\n");
add("html2wt", "Mixed list", "* Mixed list\n*# with numbers\n** and bullets\n*# and numbers\n* bullets again\n** bullet level 2\n*** bullet level 3\n***# Number on level 4\n** bullet level 2\n**# Number on level 3\n**# Number on level 3\n*# number level 2\n* Level 1\n*** Level 3\n\n#** Level 3, but ordered\n");
add("html2wt", "1. Nested mixed wikitext and html list", "* hi\n* <ul><li>ho</li></ul>\n* hi\n** ho\n");
add("html2wt", "2. Nested mixed wikitext and html list (incompatible)", "; hi\n: {{echo|<li>ho</li>}}");
add("html2wt", "Nested lists 1", "* foo\n** bar\n");
add("html2wt", "Nested lists 2", "** foo\n* bar\n");
add("html2wt", "Nested lists 3 (first element empty)", "\n** bar\n");
add("html2wt", "Nested lists 4 (first element empty)", "**\n* bar\n");
add("html2wt", "Nested lists 6 (both elements empty)", "\n**\n");
add("html2wt", "Nested lists 7 (skip initial nesting levels)", "*** foo\n");
add("html2wt", "Nested lists 8 (multiple nesting transitions)", "* foo\n*** bar\n** baz\n* boo\n");
add("html2wt", "1. Lists with start-of-line-transparent tokens before bullets: Comments", "* foo\n* bar\n* baz\n");
add("html2wt", "Nested lists 10 (list and span siblings: wt2wt regression)", "* a <span>x</span>\n** b <span>y</span>\n");
add("html2wt", "2. Lists with start-of-line-transparent tokens before bullets: Template close", "* foo bar\n* baz\n");
add("html2wt", "List items are not parsed correctly following a <pre> block (T2785)", "* <pre>foo</pre>\n* <pre>bar</pre>\n* zar");
add("html2wt", "List items from template", "* item 1\n* item 2\n\n* item 0\n* item 1\n* item 2\n\n* item 0\n* notSOL\n* item 1\n* item 2\n");
add("html2wt", "List interrupted by empty line or heading", "* foo\n\n** bar\n\n== A heading ==\n\n* Another list item\n");
add("html2wt", "Single-comment whitespace lines dont break lists, and neither do multi-comment whitespace lines", "* a\n* b\n* c\n* d\n");
add("html2wt", "Replacing whitespace with tabs still doesn't break the list (gerrit 78327)", "* a\n* b\n* c\n* d\n");
add("html2wt", "Parsoid: Make sure nested lists are serialized on their own line even if HTML contains no newlines", "# foo\n## bar\n\n* foo\n** bar\n\n: foo\n:: bar\n");
add("html2wt", "Unbalanced closing block tags break a list", "<div>\n* a\n</div>\n<div>\n* b\n</div>");
add("html2wt", "2. List embedded in a formatting tag in a misnested way", "<small>\n\n* a\n* b</small>");
add("html2wt", "Magic Word: {{CURRENTDAY}}", "1\n");
add("html2wt", "Magic Word: {{CURRENTDAY2}}", "01\n");
add("html2wt", "Magic Word: {{CURRENTDAYNAME}}", "Thursday\n");
add("html2wt", "Magic Word: {{CURRENTDOW}}", "4\n");
add("html2wt", "Magic Word: {{CURRENTMONTH}}", "01\n");
add("html2wt", "Magic Word: {{CURRENTMONTH1}}", "1\n");
add("html2wt", "Magic Word: {{CURRENTMONTHABBREV}}", "Jan\n");
add("html2wt", "Magic Word: {{CURRENTMONTHNAME}}", "January\n");
add("html2wt", "Magic Word: {{CURRENTMONTHNAMEGEN}}", "January\n");
add("html2wt", "Magic Word: {{CURRENTTIME}}", "00:02\n");
add("html2wt", "Magic Word: {{CURRENTHOUR}}", "00\n");
add("html2wt", "Magic Word: {{CURRENTWEEK}} (T6594)", "1\n");
add("html2wt", "Magic Word: {{CURRENTYEAR}}", "1970\n");
add("html2wt", "Magic Word: {{CURRENTTIMESTAMP}}", "19700101000203\n");
add("html2wt", "Magic Words LOCAL (UTC)", "* 01\n* 1\n* January\n* January\n* Jan\n* 1\n* 01\n* Thursday\n* 1970\n* 00:02\n* 00\n* 1\n* 4\n* 19700101000203\n");
add("html2wt", "Case-sensitive magic words, when cased differently, should just be template transclusions", "[/index.php?title=Template:CurrentMonth&action=edit&redlink=1 Template:CurrentMonth]\n[/index.php?title=Template:Currentday&action=edit&redlink=1 Template:Currentday]\n[/index.php?title=Template:CURreNTweEK&action=edit&redlink=1 Template:CURreNTweEK]\n[/index.php?title=Template:CurrentHour&action=edit&redlink=1 Template:CurrentHour]\n");
add("html2wt", "Case-insensitive magic words should still work with weird casing.", "example.org\naOEU\nAoeu\nhttp://example.org\n");
add("html2wt", "Namespace 1 {{ns:1}}", "Talk\n");
add("html2wt", "Namespace 1 {{ns:01}}", "Talk\n");
add("html2wt", "Namespace 0 {{ns:0}} (T6783)", "");
add("html2wt", "Namespace 0 {{ns:00}} (T6783)", "");
add("html2wt", "Namespace -1 {{ns:-1}}", "Special\n");
add("html2wt", "Namespace User {{ns:User}}", "User\n");
add("html2wt", "Namespace User talk {{ns:User_talk}}", "User talk\n");
add("html2wt", "Namespace User talk {{ns:uSeR tAlK}}", "User talk\n");
add("html2wt", "Namespace File {{ns:File}}", "File\n");
add("html2wt", "Namespace File {{ns:Image}}", "File\n");
add("html2wt", "Namespace (lang=de) Benutzer {{ns:User}}", "Benutzer\n");
add("html2wt", "Namespace (lang=de) Benutzer Diskussion {{ns:3}}", "Benutzer Diskussion\n");
add("html2wt", "Nonexistent template", "[/index.php?title=Template:Thistemplatedoesnotexist&action=edit&redlink=1 Template:Thistemplatedoesnotexist]\n");
add("html2wt", "Template with invalid target containing tags", "<nowiki>{{a</nowiki>'''b'''<nowiki>|foo|a=b|a = b}}</nowiki>\n");
add("html2wt", "Template with invalid target containing unclosed tag", "<nowiki>{{a</nowiki>'''<nowiki>|foo|a=b|a = b}}</nowiki>'''\n");
add("html2wt", "Template with just whitespace in it, T70421", "{{echo|{{ }<nowiki>}</nowiki>}}");
add("html2wt", "Simple template", "This is a test template\n");
add("html2wt", "Template with explicit namespace", "This is a test template\n");
add("html2wt", "Template parameter", "This is a test template with parameter foo\n");
add("html2wt", "Template unnamed parameter", "[[wiki/Main Page|the main page]]\n");
add("html2wt", "Template with template name as unnamed argument", "(test)\n");
add("html2wt", "Template with template name as argument", "(test)\n");
add("html2wt", "Template with template name as argument (2)", "(test)\n");
add("html2wt", "Template with default value", "(test)\n");
add("html2wt", "Template with default value (value set)", "'''templ'''\n");
add("html2wt", "Template with argument in separate line", "(test)\n");
add("html2wt", "Template with complex template as argument", "This is a test template with parameter (test)\n");
add("html2wt", "Templates with templated name", "{{{{echo|echo}}|foo}}\n{{{{echo|inner list}}}}");
add("html2wt", "Templates with invalid templated targets", "{{echo\n{{echo|foo}}}}");
add("html2wt", "Template with complex arguments", "[[wiki/Template:Complextemplate|link]] This is a test template with parameter (test)\n");
add("html2wt", "T2553: link with two variables in a piped link", "{|\n|[[{{{1}}}<nowiki>|</nowiki>{{{2}}}]]\n|}");
add("html2wt", "Abort table cell attribute parsing on wikilink", "{|\n|testing [[one|two]]<nowiki> |three</nowiki>||four\n| testing one two |three||four\n|testing=\"[[one|two]]<nowiki>\" |three</nowiki>||four\n|}");
add("html2wt", "Magic variable as template parameter", "This is a test template with parameter MediaWiki\n");
add("html2wt", "Template parameter as link source", "[[wiki/Main Page|link]]\n");
add("html2wt", "Template passing argument to another template", "including another template, This is a test template with parameter 'hmm'\n");
add("html2wt", "Template as link source", "[[wiki/Main Page|Main Page]]\n\n[[wiki/Main Page|Main Page]]\n\n[[wiki/Main Page|Main Page]]Page\n");
add("html2wt", "Template infinite loop", "<span class=\"error\">Template loop detected: [[wiki/Template:Loop1|Template:Loop1]]</span>\n");
add("html2wt", "Template from main namespace", "blah blah\n");
add("html2wt", "Template from non-includable namespace", "[[wiki/Template:Echo|Template:Echo]]\n");
add("html2wt", "T2529: Template with table, not included at beginning of line", "foo \n\n{|\n|1\n|2\n|-\n|3\n|4\n|}\n");
add("html2wt", "T2523: Template shouldn't eat newline (or add an extra one before table)", "foo\n\n{|\n|1\n|2\n|-\n|3\n|4\n|}\n");
add("html2wt", "T2041: Template parameters shown as broken links", "<nowiki>{{{parameter}}}</nowiki>\n");
add("html2wt", "int keyword", "You have lots of money (not!).\n");
add("html2wt", "int keyword - non-existing message", "⧼var⧽\n");
add("html2wt", "<includeonly> and <noinclude> being included", "Foobar\n");
add("html2wt", "<onlyinclude> being included", "Foo\n");
add("html2wt", "<onlyinclude> and <includeonly> being included", "Foo\n");
add("html2wt", "<includeonly> and <noinclude> on a page", "Foozar\n");
add("html2wt", "Un-closed <noinclude>", "");
add("html2wt", "<onlyinclude> on a page", "Foobar\n");
add("html2wt", "Un-closed <onlyinclude>", "");
add("html2wt", "Self-closed noinclude, includeonly, onlyinclude tags", "\n\n");
add("html2wt", "Unbalanced includeonly and noinclude tags", "{|\n|a\n|b\n|c</includeonly>\n|d</includeonly></includeonly>\n|}\n");
add("html2wt", "T8563: Edit link generation for section shown by <includeonly>", "== Includeonly section ==\n\n== Section T-1 ==\n");
add("html2wt", "T8563: Section extraction for section shown by <includeonly>", "<nowiki>==Section T-2==</nowiki>");
add("html2wt", "T8563: Edit link generation for section suppressed by <includeonly>", "== Section 1 ==\n");
add("html2wt", "T8563: Section extraction for section suppressed by <includeonly>", "<nowiki>==Section 1==</nowiki>");
add("html2wt", "0. includeonly around the entire attribute", "<span id=\"v2\">bar</span>\n");
add("html2wt", "1. includeonly in html attr key", "<span id=\"foo\">bar</span>\n");
add("html2wt", "2. includeonly in html attr value", "<span id=\"v1\">bar</span>\n<span id=\"v1\">bar</span>\n");
add("html2wt", "3. includeonly in part of an attr value", "<span style=\"color:red;\">bar</span>\n");
add("html2wt", "4. includeonly in table attributes", "{|\n|a\n|}\n");
add("html2wt", "Preprocessor precedence 14: broken language converter in comment", "* <!--{{foo}}-->...should be ok\n* <!---{{foo}}-->...extra dashes\n* {{echo|foo<!-- -{bar} -->bat}}...should be ok\n");
add("html2wt", "Templates: Template Name/Arg clash: 1. Use of positional param", "foo\n");
add("html2wt", "Templates: Template Name/Arg clash: 2. Use of named param", "foo\n");
add("html2wt", "Templates: Template Name/Arg clash: 3. Use of named param with empty input", "quote\n");
add("html2wt", "Templates: 1. Simple use", "Foo\n");
add("html2wt", "Templates: 2. Inside a block tag", "<div>Foo</div>\n<blockquote>Foo</blockquote>");
add("html2wt", "Templates: P-wrapping: 1a. Templates on consecutive lines", "Foo\nbar\n");
add("html2wt", "Templates: P-wrapping: 1b. Templates on consecutive lines", "Foo\n\nbar\nbaz\n");
add("html2wt", "Templates: P-wrapping: 1c. Templates on consecutive lines", "Foo\n\nbar <div>baz</div>");
add("html2wt", "Templates: Inline Text: 1. Multiple template uses", "Foobarbaz\n");
add("html2wt", "Templates: Inline Text: 2. Back-to-back template uses", "Foobar\n");
add("html2wt", "Templates: Block Tags: 1. Multiple template uses", "<div>Foo</div><div>bar</div><div>baz</div>\n");
add("html2wt", "Templates: Block Tags: 2. Back-to-back template uses", "<div>Foo</div><div>bar</div>\n");
add("html2wt", "Templates: Links: 1. Simple example", "[[wiki/Foo|bar]]\n");
add("html2wt", "Templates: Links: 2. Generation of link href", "[[wiki/Foo|bar]]\n");
add("html2wt", "Templates: Links: 3. Generation of part of a link href", "[[wiki/Foo|bar]]\n\n[/index.php?title=Foobar&action=edit&redlink=1 Foobar]\n\n[/index.php?title=Foobarbaz&action=edit&redlink=1 Foobarbaz]\n\n[/index.php?title=Foobar&action=edit&redlink=1 bar]\n\n[/index.php?title=Foobar&action=edit&redlink=1 Foobar]\n\n[/index.php?title=Foobar&action=edit&redlink=1 bar]\n");
add("html2wt", "Templates: Links: 4. Multiple templates generating link href", "[/index.php?title=Foobar&action=edit&redlink=1 Foobar]\n");
add("html2wt", "Templates: Links: 5. Generation of link text", "[[wiki/Foo|bar]]\n");
add("html2wt", "Templates: Links: 5. Nested templates (only outermost template should be marked)", "[[wiki/Foo|bar]]\n");
add("html2wt", "Templates: HTML Tag: 1. Generation of HTML attr. key", "<div style=\"color:red;\">foo</div>\n");
add("html2wt", "Templates: HTML Tag: 2. Generation of HTML attr. value", "<div style=\"color:red;\">foo</div>\n");
add("html2wt", "Templates: HTML Tag: 3. Generation of HTML attr key and value", "<div style=\"color:red;\">foo</div>\n");
add("html2wt", "Templates: HTML Tag: 4. Generation of starting piece of HTML attr value", "<div title=\"This is a long title with just one piece templated\">foo</div>\n");
add("html2wt", "Templates: HTML Tag: 5. Generation of middle piece of HTML attr value", "<div title=\"This is a long title with just one piece templated\">foo</div>\n");
add("html2wt", "Templates: HTML Tag: 6. Generation of end piece of HTML attr value", "<div title=\"This is a long title with just one piece templated\">foo</div>\n");
add("html2wt", "Templates: HTML Tag: 7. Generation of partial attribute key string", "<div style=\"color:red;\">foo</div>\n");
add("html2wt", "Templates: HTML Tag: 8. Template-generated attribute (k=v)", "<div id=\"v1\">bar</div>\n");
add("html2wt", "Templates: HTML Tag: 9. Multiple template-generated attributes", "<div id=\"v1\" title=\"foo\">bar</div>\n");
add("html2wt", "Templates: HTML Tables: 1. Generating start of a HTML table", "{|\n|foo\n|}\n");
add("html2wt", "Templates: HTML Tables: 2a. Generating middle of a HTML table", "{|\n|foo\n|}\n");
add("html2wt", "Templates: HTML Tables: 2b. Generating middle of a HTML table", "{|\n|foo\n|}\n");
add("html2wt", "Templates: HTML Tables: 3. Generating end of a HTML table", "{|\n|foo\n|}\n");
add("html2wt", "Templates: HTML Tables: 4a. Generating a single tag of a HTML table", "{|\n|foo\n|}\n");
add("html2wt", "Templates: HTML Tables: 4b. Generating a single tag of a HTML table", "{|\n|foo\n|}\n");
add("html2wt", "Templates: HTML Tables: 4c. Generating a single tag of a HTML table", "{|\n|foo\n|}\n");
add("html2wt", "Templates: HTML Tables: 4d. Generating a single tag of a HTML table", "{|\n|foo\n|}\n");
add("html2wt", "Templates: HTML Tables: 4e. Generating a single tag of a HTML table", "{|\n|foo\n|}\n");
add("html2wt", "Templates: HTML Tables: 4f. Generating a single tag of a HTML table", "{|\n|foo\n|}\n");
add("html2wt", "Templates: Wiki Tables: 3. td-content via multiple templates", "{|\n|ab\n|}\n");
add("html2wt", "Templates: Wiki Tables: 4. Templated tags, no content", "{|\n|\n|}\n");
add("html2wt", "Templates: Wiki Tables: 5. Templated tags, regular td-tags", "{|\n|foo\n|}\n");
add("html2wt", "Templates: Wiki Tables: 6. Templated tags, templated td-tags", "{|\n|foo\n|}\n");
add("html2wt", "Templates: Wiki Tables: 8. Fosterable meta-tags should get fostered", "{{echo|{{{!}}\n{{!}}-}}\n<onlyinclude>\n|foo\n</onlyinclude>\n{{!}}}\n");
add("html2wt", "Templates: Lists: Multi-line list-items via templates", "* a [/index.php?title=Template:Nonexistent&action=edit&redlink=1 Template:Nonexistent]\n* b [/index.php?title=Template:Nonexistent&action=edit&redlink=1 Template:Nonexistent]\n");
add("html2wt", "Templates: Ugly nesting: 1. Quotes opened/closed across templates (echo)", "''ab''c''d''e\n");
add("html2wt", "Templates: Ugly nesting: 4. Divs opened/closed across templates", "a<div>bc</div>de\n");
add("html2wt", "Templates: Ugly templates: 3. newline-only template parameter", "foo \n");
add("html2wt", "Templates: Ugly templates: 4. newline-only template parameter inconsistency", "\n\n");
add("html2wt", "Parser Functions: 1. Simple example", "FOO\n");
add("html2wt", "Parser Functions: 2. Nested use (only outermost should be marked up)", "FOO\n");
add("html2wt", "(confirming safety of fix for subst T3936)", "@<span>Oh no</span>\n");
add("html2wt", "T24297: safesubst: works during normal parse", "Foobar\n");
add("html2wt", "subst: does not work during normal parse", "<nowiki>{{subst:Includes}}</nowiki>\n");
add("html2wt", "message transform: magic variables", "MediaWiki");
add("html2wt", "message transform: should not transform wiki markup", "<nowiki>''test''</nowiki>");
add("html2wt", "message transform: <noinclude> in transcluded template (T6926)", "Foobar");
add("html2wt", "message transform: <onlyinclude> in transcluded template (T6926)", "Foo");
add("html2wt", "{{#special:}} page name, known", "Special:RecentChanges");
add("html2wt", "{{#special:}} page name with subpage, known", "Special:RecentChanges/param");
add("html2wt", "{{#special:}} page name, unknown", "Special:Foobar nonexistent");
add("html2wt", "{{#speciale:}} page name, known", "Special:RecentChanges");
add("html2wt", "{{#speciale:}} page name with subpage, known", "Special:RecentChanges/param");
add("html2wt", "{{#speciale:}} page name, unknown", "Special:Foobar_nonexistent");
add("html2wt", "Allow empty links in image captions (T62753)", "[[File:Foobar.jpg|thumb|Caption [[Link1]]\n<nowiki>[[]]</nowiki>\n[[Link2]]\n]]");
add("html2wt", "Image with multiple attributes from the same template", "[[File:Foobar.jpg|right|Caption text]]\n");
add("html2wt", "Image with link tails", "123[[File:Foobar.jpg]]456\n123\n[[File:Foobar.jpg|right]]\n456\n123\n[[File:Foobar.jpg|thumb]]\n456");
add("html2wt", "Image with multiple captions -- only last one is accepted", "[[File:Foobar.jpg|right|Caption3 - accepted]]\n");
add("html2wt", "Image with multiple widths -- use last", "[[File:Foobar.jpg|300x300px|caption]]");
add("html2wt", "Image with multiple alignments -- use first (T50664)", "[[File:Foobar.jpg|left|thumb|caption]]\n[[File:Foobar.jpg|middle|caption]]");
add("html2wt", "Image with width attribute at different positions", "[[File:Foobar.jpg|right|200x200px|Caption]]\n[[File:Foobar.jpg|right|200x200px|Caption]]\n[[File:Foobar.jpg|right|200x200px|Caption]]\n");
add("html2wt", "Image with link parameter, wiki target", "[[File:Foobar.jpg|link=Main_Page]]");
add("html2wt", "Image with heading and horizontal rule in caption", "[[File:Foobar.jpg|thumb|\n=== Testing ===\n123\n--------------\n]]");
add("html2wt", "Link to image page- image page normally doesn't exists, hence edit link\nAdd test with existing image page\n#<p><a href=\"/wiki/File:Test\" title=\"Image:Test\">Image:test</a>", "[/index.php?title=File:Test&action=edit&redlink=1 Image:test]\n");
add("html2wt", "T20784 Link to non-existent image page with caption should use caption as link text", "[/index.php?title=File:Test&action=edit&redlink=1 caption]\n");
add("html2wt", "Parsoid-specific image handling - simple image with size and middle alignment", "[[File:Foobar.jpg|middle|50x50px]]");
add("html2wt", "Parsoid-specific image handling - caption with a template in it", "[[File:Foobar.jpg|thumb|200x200px|This caption has a {{echo|transclusion}} in it.]]\n");
add("html2wt", "Subpage link", "[[wiki/Subpage test/subpage|/subpage]]\n");
add("html2wt", "Subpage noslash link", "[[wiki/Subpage test/subpage|subpage]]\n");
add("html2wt", "Render invalid page names as plain text (T53090)", "[[./../foo|bar]]\n[[foo�|bar]]\n[[foo/.|bar]]\n[[foo/..|bar]]\n<nowiki>[[foo~~~bar]]</nowiki>\n[[foo>bar]]\n[[foo[bar]]\n[[.]]\n[[..]]\n[[foo././bar]]\n[[foo[http://example.com]xyz]]\n\n[[{{echo|./../foo}}|bar]]\n[[{{echo|foo/.}}|bar]]\n[[{{echo|foo/..}}|bar]]\n[[{{echo|foo~~~~bar}}]]\n[[{{echo|foo>bar}}]]\n[[{{echo|foo././bar}}]]\n[[{{echo|foo{bar}}]]\n[[{{echo|foo}bar}}]]\n[[{{echo|foo[bar}}]]\n[[{{echo|foo]bar}}]]\n[[{{echo|foo<bar}}]]");
add("html2wt", "Disabled subpages", "[/index.php?title=/subpage&action=edit&redlink=1 /subpage]\n");
add("html2wt", "T2561: {{/Subpage}}", "[/index.php?title=Page/Subpage&action=edit&redlink=1 Page/Subpage]\n");
add("html2wt", "Link to category", "[[wiki/Category:MediaWiki User's Guide|Category:MediaWiki User's Guide]]\n");
add("html2wt", "PAGESINCATEGORY invalid title fatal (r33546 fix)", "0\n");
add("html2wt", "3. Categories and newlines: newline suppression for last list item should RT properly", "* a\n* b\n \n[[Category:Foo]]\n \n[[Category:Bar]]\n[[Category:Baz]]\n\n: c\n\n[[Category:C]]\n\n; d\n\n[[Category:D]]");
add("html2wt", "4. Categories and newlines: newline suppression for last list item should RT properly", "* a\n**** b\n\n[[Category:Foo]]");
add("html2wt", "7. Categories and newlines: migrateTrailingCategories dom pass should leave template content alone", "* {{echo|a\n[[Category:Foo]]}}");
add("html2wt", "8. Categories and newlines: migrateTrailingCategories dom pass should not get tripped by intervening templates", "* a\n\n{{echo|[[Category:Foo]]\n[[Category:Bar]]}}\n[[Category:Baz]]");
add("html2wt", "Categories and newlines: migrateTrailingCategories dom pass should not get tripped by comments and whitespace", "* a\n\n[[Category:Bar]]<!--boo1--> <!--boo2-->\n[[Category:Baz]]<!--boo3--> <!--boo4-->");
add("html2wt", "Basic section headings", "== Headline 1 ==\nSome text\n\n== Headline 2 ==\nMore\n\n=== Smaller headline ===\nBlah blah\n");
add("html2wt", "Section headings with TOC", "<div id=\"toc\" class=\"toc\"><input type=\"checkbox\" role=\"button\" id=\"toctogglecheckbox\" class=\"toctogglecheckbox\" style=\"display:none\" /><div class=\"toctitle\" lang=\"en\" dir=\"ltr\">\n== Contents ==\n<span class=\"toctogglespan\"><label class=\"toctogglelabel\" for=\"toctogglecheckbox\"></label></span></div>\n\n* [[#Headline_1|<span class=\"tocnumber\">1</span> <span class=\"toctext\">Headline 1</span>]]\n** [[#Subheadline_1|<span class=\"tocnumber\">1.1</span> <span class=\"toctext\">Subheadline 1</span>]]\n*** [[#Skipping_a_level|<span class=\"tocnumber\">1.1.1</span> <span class=\"toctext\">Skipping a level</span>]]\n**** [[#Skipping_a_level_2|<span class=\"tocnumber\">1.1.1.1</span> <span class=\"toctext\">Skipping a level</span>]]\n* [[#Headline_2|<span class=\"tocnumber\">2</span> <span class=\"toctext\">Headline 2</span>]]\n** [[#Another_headline|<span class=\"tocnumber\">2.1</span> <span class=\"toctext\">Another headline</span>]]\n\n</div>\n\n== Headline 1 ==\n\n=== Subheadline 1 ===\n\n===== Skipping a level =====\n\n====== Skipping a level ======\n\n== Headline 2 ==\nSome text\n\n=== Another headline ===\n");
add("html2wt", "TOC regression (T11764)", "<div id=\"toc\" class=\"toc\"><input type=\"checkbox\" role=\"button\" id=\"toctogglecheckbox\" class=\"toctogglecheckbox\" style=\"display:none\" /><div class=\"toctitle\" lang=\"en\" dir=\"ltr\">\n== Contents ==\n<span class=\"toctogglespan\"><label class=\"toctogglelabel\" for=\"toctogglecheckbox\"></label></span></div>\n\n* [[#title_1|<span class=\"tocnumber\">1</span> <span class=\"toctext\">title 1</span>]]\n** [[#title_1.1|<span class=\"tocnumber\">1.1</span> <span class=\"toctext\">title 1.1</span>]]\n*** [[#title_1.1.1|<span class=\"tocnumber\">1.1.1</span> <span class=\"toctext\">title 1.1.1</span>]]\n** [[#title_1.2|<span class=\"tocnumber\">1.2</span> <span class=\"toctext\">title 1.2</span>]]\n* [[#title_2|<span class=\"tocnumber\">2</span> <span class=\"toctext\">title 2</span>]]\n** [[#title_2.1|<span class=\"tocnumber\">2.1</span> <span class=\"toctext\">title 2.1</span>]]\n\n</div>\n\n== title 1 ==\n\n=== title 1.1 ===\n\n==== title 1.1.1 ====\n\n=== title 1.2 ===\n\n== title 2 ==\n\n=== title 2.1 ===\n");
add("html2wt", "TOC with wgMaxTocLevel=3 (T8204)", "<div id=\"toc\" class=\"toc\"><input type=\"checkbox\" role=\"button\" id=\"toctogglecheckbox\" class=\"toctogglecheckbox\" style=\"display:none\" /><div class=\"toctitle\" lang=\"en\" dir=\"ltr\">\n== Contents ==\n<span class=\"toctogglespan\"><label class=\"toctogglelabel\" for=\"toctogglecheckbox\"></label></span></div>\n\n* [[#title_1|<span class=\"tocnumber\">1</span> <span class=\"toctext\">title 1</span>]]\n** [[#title_1.1|<span class=\"tocnumber\">1.1</span> <span class=\"toctext\">title 1.1</span>]]\n** [[#title_1.2|<span class=\"tocnumber\">1.2</span> <span class=\"toctext\">title 1.2</span>]]\n* [[#title_2|<span class=\"tocnumber\">2</span> <span class=\"toctext\">title 2</span>]]\n** [[#title_2.1|<span class=\"tocnumber\">2.1</span> <span class=\"toctext\">title 2.1</span>]]\n\n</div>\n\n== title 1 ==\n\n=== title 1.1 ===\n\n==== title 1.1.1 ====\n\n=== title 1.2 ===\n\n== title 2 ==\n\n=== title 2.1 ===\n");
add("html2wt", "TOC with wgMaxTocLevel=3 and two level four headings (T8204)", "<div id=\"toc\" class=\"toc\"><input type=\"checkbox\" role=\"button\" id=\"toctogglecheckbox\" class=\"toctogglecheckbox\" style=\"display:none\" /><div class=\"toctitle\" lang=\"en\" dir=\"ltr\">\n== Contents ==\n<span class=\"toctogglespan\"><label class=\"toctogglelabel\" for=\"toctogglecheckbox\"></label></span></div>\n\n* [[#Section_1|<span class=\"tocnumber\">1</span> <span class=\"toctext\">Section 1</span>]]\n** [[#Section_1.1|<span class=\"tocnumber\">1.1</span> <span class=\"toctext\">Section 1.1</span>]]\n* [[#Section_2|<span class=\"tocnumber\">2</span> <span class=\"toctext\">Section 2</span>]]\n\n</div>\n\n== Section 1 ==\n\n=== Section 1.1 ===\n\n==== Section 1.1.1 ====\n\n==== Section 1.1.1.1 ====\n\n== Section 2 ==\n");
add("html2wt", "Resolving duplicate section names", "== Foo bar ==\n\n== Foo bar ==\n");
add("html2wt", "Resolving duplicate section names with differing case (T12721)", "== Foo bar ==\n\n== Foo Bar ==\n");
add("html2wt", "Template with sections, __NOTOC__", "== Section 0 ==\n\n=== Section 1 ===\n\n== Section 2 ==\n\n== Section 4 ==\n");
add("html2wt", "__NOEDITSECTION__ keyword", "== Section 1 ==\n\n== Section 2 ==\n");
add("html2wt", "Link inside a section heading", "== Section with a [[wiki/Main Page|link]] in it ==\n");
add("html2wt", "TOC regression (T14077)", "<div id=\"toc\" class=\"toc\"><input type=\"checkbox\" role=\"button\" id=\"toctogglecheckbox\" class=\"toctogglecheckbox\" style=\"display:none\" /><div class=\"toctitle\" lang=\"en\" dir=\"ltr\">\n== Contents ==\n<span class=\"toctogglespan\"><label class=\"toctogglelabel\" for=\"toctogglecheckbox\"></label></span></div>\n\n* [[#title_1|<span class=\"tocnumber\">1</span> <span class=\"toctext\">title 1</span>]]\n** [[#title_1.1|<span class=\"tocnumber\">1.1</span> <span class=\"toctext\">title 1.1</span>]]\n* [[#title_2|<span class=\"tocnumber\">2</span> <span class=\"toctext\">title 2</span>]]\n\n</div>\n\n== title 1 ==\n\n=== title 1.1 ===\n\n== title 2 ==\n");
add("html2wt", "Header with special characters (T27462)", "The tooltips shall not show entities to the user (ie. be double escaped)\n\n== text > text ==\nsection 1\n\n== text < text ==\nsection 2\n\n== text & text ==\nsection 3\n\n== text ' text ==\nsection 4\n\n== text \" text ==\nsection 5");
add("html2wt", "Header with space, plus and underscore as entity", "Id should not contain + for spaces\n\n== Space between Text ==\nsection 1\n\n== Space-Entity&#32;between&#32;Text ==\nsection 2\n\n== Plus+between+Text ==\nsection 3\n\n== Plus-Entity&#43;between&#43;Text ==\nsection 4\n\n== Underscore_between_Text ==\nsection 5\n\n== Underscore-Entity&#95;between&#95;Text ==\nsection 6\n\n[[#Space between Text]]\n[[#Space-Entity&#32;between&#32;Text]]\n[[#Plus+between+Text]]\n[[#Plus-Entity&#43;between&#43;Text]]\n[[#Underscore_between_Text]]\n[[#Underscore-Entity&#95;between&#95;Text]]");
add("html2wt", "div with single-quoted attribute", "<div id=\"rock\">HTML rocks</div>\n");
add("html2wt", "div with unquoted attribute", "<div id=\"rock\">HTML rocks</div>\n");
add("html2wt", "div with illegal double attributes", "<div id=\"b\">HTML rocks</div>\n");
add("html2wt", "HTML multiple attributes correction", "Awesome!\n");
add("html2wt", "Table multiple attributes correction", "{|\n! class=\"awesome\" |status\n|}\n");
add("html2wt", "DIV IN UPPERCASE", "<div id=\"x\">HTML ROCKS</div>\n");
add("html2wt", "text with character entity: eacute", "I always thought é was a cute letter.\n");
add("html2wt", "Character reference normalization in link text (T3938)", "[[wiki/Main Page|this&that]]\n");
add("html2wt", "(T21451) Links should refer to the normalized form.", "[[wiki/אַ|אַ]]\n[[wiki/אַ|אַ]]\n[[wiki/אַ|אַ]]\n[[wiki/אַ|אַ]]\n[[wiki/אַ|אַ]]\n");
add("html2wt", "Empty attribute crash test single-quotes (T4067)", "<font color=\"\">foo</font>\n");
add("html2wt", "Attribute test: unquoted but illegal value (hash)", "<font color=\"#x\">foo</font>\n");
add("html2wt", "T4095: link with pipe and three closing brackets, version 2", "[[Main Page|<nowiki>[http://example.com/]</nowiki>]]");
add("html2wt", "T4304: HTML attribute safety (unsafe breakout parameter; 2309)", "<div style=\"float: right;\"><script>alert(document.cookie)</script>\">Magic div</div>\n");
add("html2wt", "T4304: HTML attribute safety (unsafe breakout parameter 2; 2309)", "<div style=\"float: right;\"><script>alert(document.cookie)</script>\">Magic div</div>\n");
add("html2wt", "Table attribute legitimate extension", "{|\n! style=\"color:blue\" |status\n|}\n");
add("html2wt", "Table attribute safety", "{|\n! style=\"/* insecure input */\" |status\n|}\n");
add("html2wt", "CSS line continuation 1", "<div style=\"/* insecure input */\"></div>\n");
add("html2wt", "CSS line continuation 2", "<div style=\"/* invalid control char */\"></div>\n");
add("html2wt", "Expansion of multi-line templates in attribute values (T8255)", "<div style=\"background: #00FF00\">-</div>\n");
add("html2wt", "Expansion of multi-line templates in attribute values (T8255 sanity check 2)", "<div style=\"background: \n#00FF00\">-</div>\n");
add("html2wt", "Nested template calls", "(My parameter is: param)\n");
add("html2wt", "Sanitizer: Closing of open but not closed tags", "<s>foo</s>\n");
add("html2wt", "Sanitizer: Validating that <meta> and <link> work, but only for Microdata", "<div itemscope=\"\">\n\t<meta itemprop=\"hello\" content=\"world\" />\n\t<meta http-equiv=\"refresh\" content=\"5\">\n\t<meta itemprop=\"hello\" content=\"5\" />\n\t[http://example.org]\n\t<link rel=\"stylesheet\" href=\"http://example.org\">\n\t[http://example.org]\n\n</div>\n");
add("html2wt", "Self closed html pairs (T7487)", "<center><font id=\"bug\"></font>Centered text</center>\n<div><font id=\"bug2\"></font>In div text</div>");
add("html2wt", "Punctuation: nbsp before exclamation", "C'est grave !\n");
add("html2wt", "HTML nested bullet list, open tags (T7497)", "* One\n* Two:\n** Sub-one\n** Sub-two\n");
add("html2wt", "HTML nested ordered list, closed tags (T7497)", "# One\n# Two:\n## Sub-one\n## Sub-two\n");
add("html2wt", "HTML nested ordered list, open tags (T7497)", "# One\n# Two:\n## Sub-one\n## Sub-two\n");
add("html2wt", "HTML ordered list item with parameters oddity", "# One\n");
add("html2wt", "Fuzz testing: Parser13", "{|\n|\n|}\n");
add("html2wt", "Fuzz testing: Parser14", "== onmouseover= ==\nhttp://__TOC__");
add("html2wt", "Fuzz testing: Parser16", "{|\n!https://\n!\n!\n!\n|}");
add("html2wt", "Fuzz testing: Parser21", "{|\n!irc://{{ftp://a\" onmouseover=\"alert('hello world');\"\n|\n|}\n");
add("html2wt", "Fuzz testing: Parser22", "http://===r:::https://b\n\n{|\n|\n|}\n");
add("html2wt", "Parsing optional HTML elements (T8171)", "{| \n | Some tabular data\n | More tabular data ...\n | And yet som tabular data \n|}\n");
add("html2wt", "Correct handling of <td>, <tr> (T8171)", "{| \n | Some tabular data\n | More tabular data ...\n | And yet som tabular data \n|}\n");
add("html2wt", "Inline wiki vs wiki block nesting", "'''Bold paragraph'''\n\nNew wiki paragraph\n");
add("html2wt", "Inline HTML vs wiki block nesting", "'''Bold paragraph'''\n\nNew wiki paragraph\n");
add("html2wt", "Mixing markup for italics and bold", "'<nowiki/>''bold'<nowiki/>'''''bold''bolditalics'''''\n");
add("html2wt", "Special page transclusion", "* [[wiki/Xyzzyx|Xyzzyx]]\n");
add("html2wt", "Special page transclusion twice (T7021)", "* [[wiki/Xyzzyx|Xyzzyx]]\n\n* [[wiki/Xyzzyx|Xyzzyx]]\n");
add("html2wt", "Transclusion of default MediaWiki message", "Main Page\n");
add("html2wt", "Transclusion of nonexistent MediaWiki message", "[/index.php?title=MediaWiki:Mainpagexxx&action=edit&redlink=1 MediaWiki:Mainpagexxx]\n");
add("html2wt", "Transclusion of MediaWiki message with underscore", "History\n");
add("html2wt", "Transclusion of MediaWiki message with space", "History\n");
add("html2wt", "Handling of &#x0A; in URLs", "* irc://&#x0A;a");
add("html2wt", "Handling of %0A in URLs", "* irc://%0Aa");
add("html2wt", "Special:Search page linking.", "[[wiki/Special:Search|Special:Search]]\n");
add("html2wt", "Say the magic word", "* Parser test\n* Parser_test\n* Parser test\n* Parser_test\n* Parser test\n* Parser_test\n* Parser test\n* Parser_test\n* Parser test\n* Parser_test\n* Talk:Parser test\n* Talk:Parser_test\n* Parser test\n* Parser_test\n*\n*\n* 0\n* Talk\n* Talk\n*\n*\n* [/index.php?title=Template:Dynamic&action=edit&redlink=1 Template:Dynamic]\n");
add("html2wt", "Illegal character references (T106578)", "; Null\n: &amp;#00;\n; FF\n: &amp;#xC;\n; CR\n: &amp;#xD;\n; Control (low)\n: &amp;#8;\n; Control (high)\n: &amp;#x7F; &amp;#x9F;\n; Surrogate\n: &amp;#xD83D;&amp;#xDCA9;\n; This is an okay astral character\n: 💩");
add("html2wt", "ISBN code coverage", "ISBN 978-0-1234-56&#x20;789");
add("html2wt", "Parents of subpages, one level up", "[/index.php?title=Subpage_test/L1/L2&action=edit&redlink=1 L2]\n");
add("html2wt", "Parents of subpages, one level up, not named", "[/index.php?title=Subpage_test/L1/L2&action=edit&redlink=1 Subpage test/L1/L2]\n");
add("html2wt", "Parents of subpages, two levels up", "[/index.php?title=Subpage_test/L1&action=edit&redlink=1 L1]2\n\n[/index.php?title=Subpage_test/L1&action=edit&redlink=1 L1l]\n");
add("html2wt", "Parents of subpages, two levels up, with lots of extra trailing slashes.", "[/index.php?title=Subpage_test/L1&action=edit&redlink=1 Subpage test/L1]\n");
add("html2wt", "Transclusion of a sibling page (one level up)", "Sibling article\n");
add("html2wt", "Transclusion of a child page", "Sibling article\n");
add("html2wt", "Definition list code coverage", "; title \n: def\n; title \n: def\n; title\n: def");
add("html2wt", "Don't fall for the self-closing div", "<div>hello world</div>\n");
add("html2wt", "RAW magic word", "[/index.php?title=Template:QUERTY&action=edit&redlink=1 Template:QUERTY]\n");
add("html2wt", "Template caching", "This is a test template\nThis is a test template\n");
add("html2wt", "Inclusion of !userCanEdit() content", "== header ==\n");
add("html2wt", "Out-of-order TOC heading levels", "<div id=\"toc\" class=\"toc\"><input type=\"checkbox\" role=\"button\" id=\"toctogglecheckbox\" class=\"toctogglecheckbox\" style=\"display:none\" /><div class=\"toctitle\" lang=\"en\" dir=\"ltr\">\n== Contents ==\n<span class=\"toctogglespan\"><label class=\"toctogglelabel\" for=\"toctogglecheckbox\"></label></span></div>\n\n* [[#2|<span class=\"tocnumber\">1</span> <span class=\"toctext\">2</span>]]\n** [[#6|<span class=\"tocnumber\">1.1</span> <span class=\"toctext\">6</span>]]\n** [[#3|<span class=\"tocnumber\">1.2</span> <span class=\"toctext\">3</span>]]\n* [[#1|<span class=\"tocnumber\">2</span> <span class=\"toctext\">1</span>]]\n** [[#5|<span class=\"tocnumber\">2.1</span> <span class=\"toctext\">5</span>]]\n** [[#2_2|<span class=\"tocnumber\">2.2</span> <span class=\"toctext\">2</span>]]\n\n</div>\n\n== 2 ==\n\n====== 6 ======\n\n=== 3 ===\n\n= 1 =\n\n===== 5 =====\n\n== 2 ==\n");
add("html2wt", "anchorencode encodes like the TOC generator: (T20431)", "=== _ +:.3A%3A _ &&amp;]] x ===\n{{anchorencode: _ +:.3A%3A _ &&amp;]] x}}\n__NOEDITSECTION__\n");
add("html2wt", "T8200: blockquotes and paragraph formatting", "<blockquote>\nfoo\n\n</blockquote>\nbar\n\n baz\n");
add("html2wt", "T10293: Use of center tag ruins paragraph formatting", "<center>\nfoo\n\n</center>\nbar\n\n baz\n");
add("html2wt", "Parsing of overlapping (improperly nested) inline html tags", "<span><s>x</s></span>\n");
add("html2wt", "-{}- tags within headlines (within html for parserConvert())", "== -{Naslov}- ==\n\nNote that even an unprotected headline ID is not affected by language\nconversion:\n\n== Latinski ==\n");
add("html2wt", "T2529: Uncovered bullet", "* Foo\n* Bar\n");
add("html2wt", "T2529: Uncovered bullet in a deeply nested list", "******* Foo\n* Bar\n");
add("html2wt", "T2529: Uncovered table already at line-start", "x\n\n{|\n|1\n|2\n|-\n|3\n|4\n|}\ny\n");
add("html2wt", "T2529: Uncovered bullet in parser function result", "* Foo\n* bar\n");
add("html2wt", "T7678: Double-parsed template argument", "<nowiki>{{{1}}}</nowiki>\n");
add("html2wt", "T7678: Double-parsed template invocation", "<nowiki>{{paramtest | param = hello }}</nowiki>\n");
add("html2wt", "Case insensitivity of parser functions for non-ASCII characters (T10143)", "Ěščř\nĚščř\něščř\něščř\něščř\něščř\nĚŠČŘ\nĚŠČŘ\n");
add("html2wt", "Morwen/13: Unclosed link followed by heading", "[[link\n\n== heading ==\n");
add("html2wt", "HHP2.1: Heuristics for headings in preprocessor parenthetical structures", "<nowiki>{{foo|</nowiki>\n\n= heading =\n");
add("html2wt", "HHP2.2: Heuristics for headings in preprocessor parenthetical structures", "<nowiki>{{foo|</nowiki>\n\n== heading ==\n");
add("html2wt", "Paragraphs inside divs (no extra line breaks)", "<div>Line one\nLine two</div>\n");
add("html2wt", "Paragraphs inside divs (extra line break on close)", "<div>Line one\nLine two\n\n</div>\n");
add("html2wt", "Paragraphs inside divs (extra line break on open and close)", "<div>\nLine one\n\nLine two\n\n</div>\n");
add("html2wt", "T8200: paragraphs inside blockquotes (no extra line breaks)", "<blockquote>Line one\nLine two</blockquote>");
add("html2wt", "T8200: paragraphs inside blockquotes (extra line break on close)", "<blockquote>Line one\n\nLine two\n\n</blockquote>");
add("html2wt", "T8200: paragraphs inside blockquotes (extra line break on open and close)", "<blockquote>\nLine one\n\nLine two\n\n</blockquote>\n");
add("html2wt", "Paragraphs inside blockquotes/divs (no extra line breaks)", "<blockquote><div>Line one\nLine two</div></blockquote>\n");
add("html2wt", "Paragraphs inside blockquotes/divs (extra line break on close)", "<blockquote><div>Line one\nLine two\n\n</div></blockquote>\n");
add("html2wt", "Paragraphs inside blockquotes/divs (extra line break on open and close)", "<blockquote><div>\nLine one\n\nLine two\n\n</div></blockquote>\n");
add("html2wt", "formatdate parser function", "<span class=\"mw-formatted-date\" title=\"2009-03-24\">2009-03-24</span>\n");
add("html2wt", "formatdate parser function, with default format", "<span class=\"mw-formatted-date\" title=\"2009-03-24\">March 24, 2009</span>\n");
add("html2wt", "Spacing of numbers in formatted dates", "<span class=\"mw-formatted-date\" title=\"01-15\">January 15</span>\n");
add("html2wt", "formatdate parser function, with default format and on a page of which the content language is always English and different from the wiki content language", "<span class=\"mw-formatted-date\" title=\"2009-03-24\">24 March 2009</span>\n");
add("html2wt", "French spaces in wikitext", "foo ! bar ? bat 50 % is less than 75 %.\n\nHello : this ; is « something ‹ else › again »\n");
add("html2wt", "Corner case: french spaces in definition list", "; foo \n: bar");
add("html2wt", "Special characters in embedded file links (T29679)", "[[File:Contains_&_ampersand.jpg]]\n[[File:Does_not_exist.jpg|Title with & ampersand]]");
add("html2wt", "Confirm that 'apos' named character reference doesn't make it to output (not legal in HTML 4)", "Text's been normalized?\n");
add("html2wt", "T21052 U+3000 IDEOGRAPHIC SPACE should terminate bracketed external links", "[http://www.example.org/ ideograms]\n");
add("html2wt", "T33098 Template which includes system messages which includes the template", "<span class=\"error\">Template loop detected: [[wiki/Template:Identical|Template:Identical]]</span>\n<span class=\"error\">Template loop detected: [[wiki/Template:Identical|Template:Identical]]</span>\n");
add("html2wt", "T33490 Turkish: ucfirst 'blah'", "Blah\n");
add("html2wt", "T33490 Turkish: ucfirst 'ix'", "İx\n");
add("html2wt", "T33490 Turkish: lcfirst 'BLAH'", "bLAH\n");
add("html2wt", "T33490 Turkish: ucfırst (with a dotless i)", "[/index.php?title=%C5%9Eablon:Ucf%C4%B1rst:blah&action=edit&redlink=1 Şablon:Ucfırst:blah]\n");
add("html2wt", "T33490 ucfırst (with a dotless i) with English language", "[/index.php?title=Template:Ucf%C4%B1rst:blah&action=edit&redlink=1 Template:Ucfırst:blah]\n");
add("html2wt", "span tags with directionality in TOC", "__TOC__\n==<span dir=\"ltr\">C++</span>==\n\n== <span dir=\"rtl\">זבנג!</span> ==\n\n== <span style=\"font-style: italic\">The attributes on these span tags must be deleted from the TOC</span> ==\n\n== <span style=\"font-style: italic\" dir=\"ltr\">All attributes on these span tags must be deleted from the TOC</span> ==\n\n== <span dir=\"ltr\" style=\"font-style: italic\">Attributes after dir on these span tags must be deleted from the TOC</span> ==\n");
add("html2wt", "T34057: Title needed when expanding <h> nodes.", "== Headline text ==\n");
add("html2wt", "Strip marker in lc", "xy\n");
add("html2wt", "Strip marker in uc", "XY\n");
add("html2wt", "Strip marker in formatNum", "12\n12\n");
add("html2wt", "Check noCommafy in formatNum", "123 456,78\n123456.78\n");
add("html2wt", "Wrong option for formatNum (T58199)", "1,234.56\n1,234.56\n1,234.56\n");
add("html2wt", "Strip marker in grammar", "foobarista\n");
add("html2wt", "Strip marker in padleft", "xy\n");
add("html2wt", "Strip marker in padright", "xy\n");
add("html2wt", "nowiki inside link inside heading (T20295)", "== [[wiki/Foo|xyz]] ==\n");
add("html2wt", "new support for bdi element (T33817)", "ולדימיר לנין (ברוסית: <bdi lang=\"ru\">Владимир Ленин</bdi>, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.\n");
add("html2wt", "Ignore pipe between table row attributes", "{|\n|quux\n|- id=\"foo\" style=\"color: red\"\n|bar\n|}\n");
add("html2wt", "Language parser function", "العربية\n");
add("html2wt", "Special parser function", "Special:Random\nSpecial:Badtitle\nSpecial:Foobar\n");
add("html2wt", "Disable TOC", "Lead\n\n== Section 1 ==\n\n== Section 2 ==\n\n== Section 3 ==\n\n== Section 4 ==\n\n== Section 5 ==\n");
add("html2wt", "Empty LI and TR nodes should not be stripped from top-level content", "* a\n*\n* b\n\n{|\n|-\n|foo\n|}");
add("html2wt", "Lists: 4. No escapes needed", "* foo*bar\n\n* ''foo''*bar\n\n* [[Foo]]: bar\n\n* [[Foo]]*bar\n");
add("html2wt", "HRs: 1. Single line", "--------\n----=foo=\n----*foo");
add("html2wt", "3. Leading whitespace in indent-pre suppressing contexts should not be escaped", "<blockquote>\n\n a\n <span>b</span>\n c\n</blockquote>");
add("html2wt", "HTML tag with 'unnecessary' entity encoding in attributes", "<span title=\"&\">foo</span>\n");
add("html2wt", "Accept empty td cell attribute", "{|\n| align=\"center\" |foo\n|\n|}\n");
add("html2wt", "Non-empty attributes in th-cells", "{|\n!Foo\n! style=\"color: red\" |Bar\n|}\n");
add("html2wt", "Accept empty attributes in th-cells", "{|\n!foo\n!bar\n|}\n");
add("html2wt", "Empty table rows go away", "{|\n|Hello\n|there\n|}\n");
add("html2wt", "Trailing newlines in a deep dom-subtree that ends a wikitext line should be migrated out", "{|\n|<small>foo\n\nbar\n|}\n\n{|\n|<small>foo<small>\n|}");
add("html2wt", "Empty TD followed by TD with tpl-generated attribute", "{|\n|\n|foo\n|}\n");
add("html2wt", "Indented table with an empty td", "{|\n|\n|foo\n|}\n");
add("html2wt", "Indent and comment before table row", "{|\n <!--hi-->|-\n | there\n|}");
add("html2wt", "Empty TR followed by a template-generated TR", "{|\n{{echo|<tr><td>foo</td></tr>}}\n|}");
add("html2wt", "Empty TR followed by mixed-ws-comment line should RT correctly", "{|\n\n <!--c-->|-\n<!--c--> <!--d-->\n|}\n");
add("html2wt", "Improperly nested inline or quotes tags with whitespace in between", "<span> <s>x</s></span><s> </s>\n''' ''x'''''<nowiki/>'' ''\n");
add("html2wt", "T73074: More fostering fun", "[[Category:Two]]\n<table><td></td>{{echo|<tr>}}<!--c-->[[Category:Two]]");
add("html2wt", "Parsoid should not accept invalid interwiki shortcuts", "[[news:Foo|Foo]]\n[news:Foo Foo]\n[news:Foo Foo]");
add("html2wt", "Image: upright option (parsoid)", "[[File:Foobar.jpg|thumb|caption]]\n[[File:Foobar.jpg|thumb|caption]]\n[[File:Foobar.jpg|thumb|500x500px|caption]]\n");
add("html2wt", "Image: upright option is ignored on inline and frame images (parsoid)", "[[File:Foobar.jpg|500x500px|caption]]");
add("html2wt", "Wikitext lists can be nested inside HTML lists", "<ul>\n<li>a\n* b\n</li>\n</ul>\n\n<ul>\n<li>x\n** y\n</li>\n</ul>");
add("html2wt", "Empty LI (T49673)", "* a\n*\n*\n* b");
add("html2wt", "Decoding of HTML entities in headings and links for IDs and link fragments (T103714)", "== A&B&amp;C&amp;amp;D&amp;amp;amp;E ==\n[[#A&B&amp;C&amp;amp;D&amp;amp;amp;E]]");
add("html2wt", "HTML5 ids: fallback to legacy", "== Foo bar ==\n\n== foo Bar ==\n\n== Тест ==\n\n== Тест ==\n\n== тест ==\n\n== Hey < # \" > % : ' ==\n[[#Foo bar]] [[#foo Bar]] [[#Тест]] [[#тест]] [[#Hey < # \" > % : ']]\n\n{{anchorencode:💩}} <span id=\"{{anchorencode:💩}}\"></span>\n\n<!-- These two links should produce identical HTML -->\n[[#啤酒]] [[#%E5%95%A4%E9%85%92]]");
add("html2wt", "T90902: Normalize weird characters in section IDs", "== Foo&nbsp;bar ==\n[[#Foo&nbsp;bar]]");
add("html2wt", "Section wrapping for well-nested sections (no leading content)", "= 1 =\na\n\n= 2 =\nb\n\n== 2.1 ==\nc\n\n== 2.2 ==\nd\n\n=== 2.2.1 ===\ne\n\n= 3 =\nf\n");
add("html2wt", "Section wrapping for well-nested sections (with leading content)", "Para 1.\n\nPara 2 with a <div>nested in it</div>\n\nPara 3.\n\n= 1 =\na\n\n= 2 =\nb\n\n== 2.1 ==\nc\n");
add("html2wt", "Section wrapping with template-generated sections (good nesting 1)", "= 1 =\na\n\n{{echo|1=\n==1.1==\nb\n}}\n\n== 1.2 ==\nc\n\n= 2 =\nd");
add("html2wt", "Section wrapping with template-generated sections (bad nesting 2)", "= 1 =\na\n\n{{echo|1=\n=2=\nb\n==2.1==\nc\n}}\n\nd\n\n= 3 =\ne");
add("html2wt", "Section wrapping with uneditable lead section + div wrapping multiple sections", "foo\n\n<div style=\"border:1px solid red;\">\n= 1 =\na\n\n== 1.1 ==\nb\n\n= 2 =\nc\n</div>\n\n= 3 =\nd\n\n== 3.1 ==\ne\n");
add("html2wt", "Section wrapping with editable lead section + div overlapping multiple sections", "foo\n\n= 1 =\na\n<div style=\"border:1px solid red;\">\nb\n\n== 1.1 ==\nc\n\n= 2 =\nd\n</div>\ne\n\n= 3 =\nf\n\n== 3.1 ==\ng\n");
add("html2wt", "HTML header tags should not be wrapped in section tags", "foo\n\n<h1>a</h1>\n\n= b =\n\n<h1>c</h1>\n\n= d =\n");
add("html2wt", "Lead section containing only whitespace and comments.", "\n<!-- this is a comment, presumably significant to editors -->\n= 1 =\na\n\n= 2 =\nb");
// Blacklist for selser
add("selser", "Paragraphs with extra newline spacing [2,2,1,0,[2,0,2],4,3,4,2,0,4,0,2]", "1t4pc8b\n\na\n\nmzmf7w\n\nb (+2 nls)\n\nf6057g\n1qoub4r\nc (+3 nls)\n\n9tdij\n\nrntitb\n\n1od6qn7\n\nd (+4 nls)\n\nc5qflz\n\n3pd2e\n\n\n\ne (+5 nls)");
add("selser", "Paragraphs with extra newline spacing [3,0,0,2,3,0,4,2,3,0,0,0,1]", "\nb (+2 nls)\n\n1b0t6uz\n\n1ajz5vj\n\nr8ae0b\n\n\n\n\n\ne (+5 nls)");
add("selser", "Paragraphs with extra newline spacing [[3],4,2,3,[3,0,0],3,[0,3],0,2,2,2,4,1]", "\natfyec\n\n1kryict\n\nb (+2 nls)\n\n\n\nc (+3 nls)\n\n19wbnqo\n\nd (+4 nls)\n\nyzbqjt\n\n1qyf5s3\n\n\n\n\n1kfgiue\n\n\ne (+5 nls)");
add("selser", "Paragraphs with extra newline spacing [1,2,2,0,1,2,[0,1],3,2,0,3,0,2]", "a\n\n7vc2to\n\n1w94y59\n\nb (+2 nls)\n\n\nc (+3 nls)\n\n1cdstc5\n\n\n\ny5x3nn\n\nd (+4 nls)\n\n1nbh95t\n\n\n\ne (+5 nls)");
add("selser", "Paragraphs with extra newline spacing [[4],4,[4],4,[0,3,4],4,0,0,[4],4,1,0,[3,0,0]]", "ig00cj\n\ntexojj\n\n1m8256m\n\n1bnsxft\n\n139m36s\n\n1ob93o2\n\n\n\n\ng9l7i6\n\nay0qku\n\n\n\n\ne (+5 nls)");
add("selser", "Paragraphs with extra newline spacing [0,2,1,3,[0,0,3],2,0,0,4,4,4,3,2]", "a\n\nm8yeba\n\nb (+2 nls)\n\n\n\nn1usum\n\n\n\n\n1kzuzg7\n\n12iwau4\n\ndt80q8\n\n12is0gt\n\n\n\ne (+5 nls)");
add("selser", "Paragraphs with extra newline spacing [1,2,0,2,[0,4,0],0,0,0,[4],3,[3,0],2,[2,0,4]]", "a\n\n3zfgv8\n\nb (+2 nls)\n\n1fjqbu9\n\n4r7i6n\nc (+3 nls)\n\n\n\n\n2x64pq\n\n\n\n\n\n\n1mc151s\n\ngovjqb\n3uup4t");
add("selser", "Paragraphs with extra newline spacing [4,4,3,0,[2,2,0],0,4,4,[4],4,2,2,1]", "15gzgsp\n\n1obb3hr\n\n1csmm8r\n1c13roj\nc (+3 nls)\n\n1vpxiwo\n\n146h93f\n\n92dqh4\n\nmqrod6\n\ni1t9xh\n\n\n\n\n1yynyv3\n\n\ne (+5 nls)");
add("selser", "Paragraphs with extra newline spacing [3,0,4,3,[0,0,4],2,4,3,0,0,1,0,3]", "\n1v4dgwd\n\n\n\n\n1gdvs6o\n\nmpvvk3\n\njj4zx7\n\nd (+4 nls)\n\n\n");
add("selser", "Paragraphs with extra newline spacing [3,4,3,0,[0,0,3],3,0,3,2,0,3,4,[0,0,2]]", "1357731\n\n\n\n\n\n\n1474dpy\n\nd (+4 nls)\n\n1v0g2ru\n\n\n1t39btt\ne (+5 nls)");
add("selser", "Paragraphs with extra newline spacing [[2],0,1,0,2,0,[4,0],3,[3],0,3,3,[3,4,2]]", "d042ma\n\nb (+2 nls)\n\n161g3qj\n\n\n\nc (+3 nls)\n\nbye4qx\n\ndnk1cq5hscq5\ne (+5 nls)");
add("selser", "Paragraphs with newline spacing with comment lines in between [4,3,3,0,3,2,[0,4,0,0],0,0,0,[3,0,2,0,0,0,0],2,2,0,4,0,4,0,[2],0,2,0,[3],0,0,0,2,0,0,0,0,3,2,0,2,2,3,2,2,2,1,3,0]", "1h3m7jc\n\n1n3q66n\n\na\n1owmwff<!--More than 1 comment, still stripped-->\nb\n----\n<!--foo-->ylk2fs <!----> <!-- bar --> \nb\n\n1n98oc4\nzl603f\n----\nv21y30\n\n8k6pdj\n\n1gx4pu2b\n191rwx2\n----\n\n\n<!--foo-->1lppjjq\n\nb\n----\na\n\ngt27bw<!--foo-->\n\n68u0mk\n\n\n\nb\n\n6pmy2k\n\nom1jxu\n\n7ekj0d\n\na\n\n1t1a6pz\n\n\n<!--foo-->\nb\n----");
add("selser", "Paragraphs with newline spacing with comment lines in between [1,2,3,0,0,2,[3,3,0,0],2,0,0,[4,0,4,0,0,4,3],4,0,3,1,3,4,0,[3],0,0,2,2,3,0,0,[2],0,3,0,[3],2,0,0,2,0,0,4,3,0,4,2,0]", "----9a9aev\n\n----1uc5qnr\n<!--More than 1 comment, still stripped-->\nb\n\n8km2xe\n----\n1fq5glq<!--foo-->11pyys5<!----> d8hwvy\n\nwu34uu\n----a\n\nkjv7m4\n\n----1a5a54q\ni7rc91\n\na<!--foo-->\n\nl6dbytb\n\n3h0ipm\n<!--foo-->\n\n1uodods\n\n\n\nb\n----os3art\n1uvcbc1\n\nz1qam9\n----");
add("selser", "Paragraphs with newline spacing with comment lines in between [0,0,2,0,0,3,0,0,4,0,[4,0,2,0,0,0,3],0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,[2],0,2,0,3,0,0,4,2,3,3,2,0,4,2,0,2]", "----\nmkliel\n\na\n<!--foo-->\nb\n----a\n<!--foo--><!--More than 1 comment, still stripped-->\nb\n146tip9\n\nz6r3b8<!--foo-->1965vor <!----> <!-- bar -->\n----\na\n<!--foo-->\n\nrk7dq1\n\nb\n----\n\n\n<!--foo-->kc6bk1b\n1gqqbwl\n----\n\n<!--foo-->tll7t\n\n1wt5adc\n\n\n\nb\n\n11r7car\n\na\n\n19mw4f2\n\nz7iq4z\n\n\n\n<!--foo-->\nb\n1hmfplm\n----");
add("selser", "Paragraphs with newline spacing with comment lines in between [0,0,[2,2,3],0,3,3,0,0,2,4,[0,0,3,2,2,0,2],2,3,4,1,4,0,0,[3],0,2,4,2,2,4,4,0,0,0,0,2,0,2,2,1,3,1,3,4,2,2,0,0]", "----\ng36e94a\n11dlx4c<!--foo-->\n\na\n<!--foo--><!--More than 1 comment, still stripped-->\nb\nazrcj8\n----stwheu\n\na\n<nowiki> </nowiki><!--foo-->uftcuh<!---->bmic9y <!-- bar -->1xoedrl \nb\n\n9z7u4a\n\n1klsd4x\n\na\n\n1vfr7pj<!--foo-->\n\nvy443f\n----iem1wx\n\ngky8ue\n\na\n\n1qky2vm\n\n1604xi4\n\n1b5jc1i\n\nb\n----\n1a5ccsd\n\na\n\ngz9ue4<!--foo-->\n\n1k0x2qz\n\n\nb\n----ap04db\n\nzq3yy2\nvibe31\n\n\n\n<!--foo-->\nb\n----");
add("selser", "Paragraphs with newline spacing with comment lines in between [0,0,[3,0,2],0,0,0,[0,0,3,2],3,0,3,3,0,3,3,3,2,3,0,4,0,0,3,0,3,0,2,4,0,0,0,[3],0,3,3,2,3,0,0,[3],0,0,3,0]", "----\n<!--foo-->hbadtm\nb\n----\na\n<!--foo-->raybd5\nb\n----\n31ggly\n\n1aqhjxe\n----a<!--foo-->lypcj9\n\n1aauj1v\n----\n\n1jwnlhm\n\n\n\nb\n----\n\n\n\n<!--foo-->\nb\n----");
add("selser", "Paragraphs with newline spacing with comment lines in between [0,3,3,2,4,0,3,2,4,3,[0,3,4,0,0,2,0],4,0,0,1,0,0,2,2,3,0,3,0,0,3,0,4,3,2,2,4,4,4,0,3,2,0,0,4,0,0,0,1]", "----crkd8j\n13uxql\n\n1kfn663\n\n14zanon\n\na\n<nowiki> </nowiki>1fpk8j5<!----> 18tim14<!-- bar --> \nb\n\n10ldxlq\n----\na\n<!--foo-->\n1x0qdhg\n\n1mweey8\n\nb\n----a\n\nautc84\n\nrxotrp\n----1tvhhmq\n148jftd\n\n1z05ujh\n\n132jt8\n\n1q9sdxd\n----\n1jiylnb\n\n\n\n<!--foo-->\nb\n----");
add("selser", "Paragraphs with newline spacing with non-empty white-space lines in between [0,3,[4],3,0,3,0,3,2,0,2,3,0]", "----n8ia7e\n\nb\n----15u5eag\n\na\n<nowiki> </nowiki>1yxm4th\n\n\n \nb\n----");
add("selser", "Paragraphs with newline spacing with non-empty white-space lines in between [0,0,1,0,[4],2,0,0,4,0,1,2,2]", "----\na\n \n1lhzh12\n\njt2kbz\n----\n1tust5g\n\n \n \nb\n\neyiba0\nhwh9o2\n----");
add("selser", "Paragraphs with newline spacing with non-empty white-space lines in between [2,0,[4],4,1,3,0,4,0,4,0,0,2]", "191jdip\n----\npl9sl5\n\npydsv3\n\nb\n----2c5yhr\n\na\n\n1d12sb1\n\n\n \nb\n1yq3rr1\n----");
add("selser", "Paragraphs with newline spacing with non-empty white-space lines in between [3,2,4,4,0,0,0,4,[4],0,2,3,2]", "1o79fo3\n\n1gncotf\n\n1fa41nv\n\nb\n----moduv4\n\n1by1i1i\n<nowiki> </nowiki>1lanl4w\n\n\n \nb\n\n16z1yr2\n----");
add("selser", "Paragraphs with newline spacing with non-empty white-space lines in between [1,0,0,0,3,3,4,0,[4],0,[0,0,3],2,4]", "----\na\n \ne6b9h\n\n8l9gt5\n \n \n\n\n\nzrjbtl\n\na5ysj");
add("selser", "Paragraphs with newline spacing with non-empty mixed comment and white-space lines in between [0,3,[0,4,2],3,1,0,1,0,0,4,2,3,0,2,0,2,0,3,0,3,[3],2,2,0,3]", "----a\n<nowiki> </nowiki>yr5qjz28srt9\nb\n----\na\n <!--foo--><!--More than 1 comment doesn't disable stripping of this line!-->\nb\n----jmvx8c\n\nmjnkpc\n\na<!--foo-->g308yf\n <!--bar-->\nynd1v4\nb\n----\n\n13swl1v\n<nowiki> </nowiki>1g5ltxx\n\n\n <!--foo-->\n <!--bar-->\n \nb\n");
add("selser", "Paragraphs with newline spacing with non-empty mixed comment and white-space lines in between [0,0,2,0,0,3,4,0,0,0,1,3,0,0,3,3,[4],0,2,2,0,2,2,0,0]", "----\nf5rix6\n\na\n <!--foo-->\nb\n----uopqok\n----\na<!--foo-->\n \n139oexj\n1ecdyhq\n----keec8u\na\n\nkzh9u\n \n52bsx7\n\n\n <!--foo-->\n <!--bar-->\n \nb\n----");
add("selser", "Extra newlines: More paragraphs with indented comment [[4],3,[0,0,0,0,3]]", "7pgclg\n\n\n <!--boo-->\n");
add("selser", "Extra newlines: More paragraphs with indented comment [2,2,0]", "1gf4c1d\n\na\n\nq5xv6v\n\n\n <!--boo-->\n\nb");
add("selser", "Extra newlines followed by heading [3,0,2,4,3,4,2,4,[3,0],4,2]", "\n18dqugz\n\n\n\n\n1au1ohc\n\ncqz6qh\n\n144leth\n\n[[a]]\n\n1yqz0iy\n\n\n\nn3hesc\n\n1lsk5ug\n\n=b=");
add("selser", "Extra newlines followed by heading [1,4,0,2,4,0,[2],4,2,3,1]", "a\n\nhcchdp\n\n\n\n\n13fudb8\n\n1c5x84v\n\nme9m64[[a]]\n\n94lskk\n\nlvoll1\n\n\n\n=b=");
add("selser", "Extra newlines followed by heading [0,0,2,2,4,0,0,0,3,4,3]", "a\n\nv0jg8f\n\n\n\n\n7j86et\n\nxvwm3g\n\n[[a]]\n\nth2qtt");
add("selser", "Extra newlines followed by heading [[3],3,[0,4],2,1,0,0,2,2,2,2]", "\n65y7i3\n\n10lglx9\n\n=b=\n[[a]]\n\nu0819h\n\n184vkjr\n\n\n\n\n14zno1z\n\nabmiwz\n\n=b=");
add("selser", "Extra newlines followed by heading [4,0,2,0,3,0,4,0,2,2,0]", "1i39sbd\n\n1hbhfmd\n\n\n\n\ndlv0di\n\n7rps92\n\n\n\n\n1g7gq5n\n\n=b=");
add("selser", "Extra newlines followed by heading [0,0,[4,0],2,0,2,2,3,1,0,0]", "a\n\ncj7dsx\n\n1jgm0bv\n\n=b=\n7cea2o\n1l4jb61\n\n[[a]]\n\n\n\n=b=");
add("selser", "Extra newlines followed by heading [[4],2,2,4,[3],3,1,4,[2,0],3,2]", "dvytmq\n\n68s2l1\n\n14gmeu4\n\n\n\n\n1js6ooi\n\n=<nowiki/>=\n[[a]]\n\nceyb3u\n\n1i87sq6\n\ntjmhjd\n\n=b=");
add("selser", "Extra newlines followed by heading [[4],4,2,2,3,4,[[3]],0,3,3,[2]]", "8u0rrv\n\nofp4uh\n\n15eytcw\n\n\n\n\n1cwzpma\n\n1r8mavm\n\n[[a|<nowiki/>]]\n=1v2tdbhb=");
add("selser", "Extra newlines followed by heading [4,4,[0,3],3,[2],0,0,3,2,0,1]", "1dcli6x\n\n1k4ub3v\n\n=1xzavjgb=\n[[a]]\n\n1bh3cza\n\n\n\n=b=");
add("selser", "Extra newlines followed by heading [2,0,2,0,0,0,[[4]],2,[0,3],0,2]", "1g742p5\n\na\n\nmkx4u5\n\n\n\n=b=\n[[a|8527wl]]\n\nv5sv0o\n\n1fsgsfv\n\n=b=");
add("selser", "Extra newlines followed by heading [2,3,0,2,2,0,[4],3,[4,2],0,4]", "1op6yaw\n\na\n\n\n\n\niv2cjo\n\n1qzfkb2\n\n=b=\nph5ntp\n\nor84qgy3754w\niv8j30");
add("selser", "Extra newlines between heading and content are swallowed (Parsoid does not) [[4],4,0,0,[4]]", "=5vz55o=\n5ysrd5\n\n\n\n\n1r16ozp");
add("selser", "Extra newlines between heading and content are swallowed (Parsoid does not) [0,4,2,0,4]", "=b=\niplho9\n\nchn6bs\n\n\n\n\n6hw1lv");
add("selser", "Extra newlines between heading and content are swallowed (Parsoid does not) [0,0,[3,0],0,[[3]]]", "=b=\n\n\n\n\n[[a|<nowiki/>]]");
add("selser", "Extra new lines before and after lists are preserved [0,0,[3,0],0,[4],3,3]", "a\n\n\n\n\n* i5gpmh");
add("selser", "Extra new lines before and after lists are preserved [[3],4,[4,0],0,3,3,4]", "\niqom1p\n\n1b83i36\n\n1frutll");
add("selser", "Extra new lines before and after lists are preserved [1,0,[0,3],4,0,0,2]", "a\n\nhegt06\n\n*b\n\n7por6f\n\n\n\nc");
add("selser", "Extra new lines before and after lists are preserved [0,0,[4,1],3,4,4,0]", "a\n\nuwqbby\n\nswx0px\n\nz47jbr\n\n\n\nc");
add("selser", "Extra new lines before and after lists are preserved [[3],0,[3,0],0,[4],3,0]", "\n\n\n\n* ylz4o1\n\n\n\nc");
add("selser", "Extra new lines before and after lists are preserved [1,0,1,0,3,0,[4,4,0]]", "a\n\n\n\n\n\np875331pu3vsk\nc");
add("selser", "Extra new lines before and after lists are preserved [3,0,4,0,0,2,2]", "\n1v8rczn\n\n*b\n\n17m5f7l\n\njr84xz\n\n\n\nc");
add("selser", "Extra new lines before and after lists are preserved [[3],3,2,3,[4],0,[0,3,2]]", "\nt98t4z\n\n\n\n\n* vj0fpy\n\n16l3wr9\nc");
add("selser", "Extra new lines before and after lists are preserved [0,0,2,0,[1],0,[0,0,2]]", "a\n\ni63xq1\n\n\n\n*b\n\nw10opj\nc");
add("selser", "Extra new lines before and after lists are preserved [[3],0,[3,0],0,3,0,[0,0,4]]", "\n\n\n\n\n\n\nblmxw3");
add("selser", "Extra new lines before and after lists are preserved [0,2,0,3,4,0,1]", "a\n\nr1rcmh\n\n\n\n\n1kpap7t\n\n\nc");
add("selser", "Multiple newlines after tables are converted to p-br-p tags [2,0,[2,2],0,2,2,3]", "13iviia\n{|\n|x\n|}\nr2sd39\nw5b4gn\n2lgj9m\n\n\n\n\nmke54f\n");
add("selser", "Multiple newlines after tables are converted to p-br-p tags [3,4,2,4,[2,0],0,0]", "1rz92sj\n\n117yh66\n\n\n\n\n1rjq6ux\n\n1xuebix\n\n=b=");
add("selser", "Multiple newlines after tables are converted to p-br-p tags [0,0,3,2,2,0,0]", "{|\n|x\n|}\nwp8x7e\n\n76lsks\n\n\n\n=b=");
add("selser", "Multiple newlines after tables are converted to p-br-p tags [[0,[2,0]],3,0,3,[4,0],4,[3]]", "{|\n<!--btzowv-->|x\n|}\n\n\n3vn9f5\n\nowyryw\n\n=<nowiki/>=");
add("selser", "Multiple newlines after tables are converted to p-br-p tags [4,0,4,4,2,3,0]", "15hlrwq\n\n1l1eg9u\n\n2dby1y\n\n13qrlj2\n\n\n\n=b=");
add("selser", "Multiple newlines after tables are converted to p-br-p tags [[4,2],2,4,0,0,0,[3]]", "{|<!--adovf--><!--1nubjnn-->\n|x\n|}\n18qoiqq\n1ih0ep6\n\n\n\n=<nowiki/>=");
add("selser", "Multiple newlines after tables are converted to p-br-p tags [2,0,1,2,2,0,2]", "1r5nhyh\n{|\n|x\n|}\n\n\n\n\n\njt2t6\n\n15dj9y2\n\n\n\n1eaa62s\n\n=b=");
add("selser", "Multiple newlines after tables are converted to p-br-p tags [[0,[1,0]],4,[0,1],2,0,2,0]", "{|\n|x\n|}\nlahcjt\n\n\n\n13eda25\n\n\n\n\ny0d4ch\n\n=b=");
add("selser", "Multiple newlines after tables are converted to p-br-p tags [[3,[[4],0]],0,2,2,[4,2],4,3]", "{|\n|stjqon\n|}\n1vdw28g\n\n\n\n\n1i6elnc\n\nwd2gwsvr2xcq\n\ntinvx3");
add("selser", "Multiple newlines after tables are converted to p-br-p tags [3,0,0,2,0,0,0]", "\n\n\n\n1na38kh\n\n\n\n=b=");
add("selser", "Parsing an URL [[[2]],2,0]", "[[:fr:🍺|mwh6a1http://fr.wikipedia.org/wiki/🍺]]\n\nfj3cgh\n<!-- EasterEgg we love beer, better be able be able to link to it -->");
add("selser", "Italics and bold: 5-quote opening sequence: (5,6) [[[2]]]", "''f2isaa'''foo''''''");
add("selser", "Quote balancing context should be restricted to td/th cells on the same wikitext line [1]", "{| data-foobar=\"1hy2782\"\n!''a!!''b\n|''a||''b\n|}");
add("selser", "Quote balancing context should be restricted to td/th cells on the same wikitext line [2]", "1472tnt\n{|\n!''a!!''b\n|''a||''b\n|}");
add("selser", "Quote balancing context should be restricted to td/th cells on the same wikitext line [[0,[2,0]]]", "{|\n<!--ozg58-->!''a!!''b\n|''a||''b\n|}");
add("selser", "Quote balancing context should be restricted to td/th cells on the same wikitext line [[0,[[3,[2],3,[2],1],3]]]", "{|\n!p6mcdk''b\n|d0ix25''a|| data-foobar=\"4g8of5\" |''b\n|}");
add("selser", "Quote balancing context should be restricted to td/th cells on the same wikitext line [[4,[[[3],1,0,[[2]],0],0]]]", "{|<!--1w3puuv-->\n! !! data-foobar=\"1t3dkx\" |''b\n|''bnq9qla''||''b\n|}");
add("selser", "Quote balancing context should be restricted to td/th cells on the same wikitext line [[0,[[1,0,0,4,1],0]]]", "{|\n! data-foobar=\"s19poy\" |''a!!''b\n!vx4tlq\n| data-foobar=\"a1y3t4\" |''b''\n|}");
add("selser", "Quote balancing context should be restricted to td/th cells on the same wikitext line [[4,[[[3],4,0,0,[3]],3]]]", "{|<!--1ypcdkj-->\n!\n!xj9ho5\n|''a||\n|}");
add("selser", "Quote balancing context should be restricted to td/th cells on the same wikitext line [[4,1]]", "{|<!--1bnj6ev-->\n!''a!!''b\n|''a||''b\n|}");
add("selser", "Quote balancing context should be restricted to td/th cells on the same wikitext line [[0,1]]", "{|\n!''a!!''b\n|''a||''b\n|}");
add("selser", "Non-word characters don't terminate tag names [0,4,3,0,4,3,4,0,1,0,[3]]", "<blockquote|>a</blockquote>\n\nq69oou\n\n1kupo2f\n\n4ncue1\n\n<s.foo> doesn't terminate </s.foo>\n\n");
add("selser", "Non-word characters don't terminate tag names [2,4,3,4,2,0,4,4,1,0,0]", "1b567yn\n\n<blockquote|>a</blockquote>\n\nidyy6n\n\n103sn92\n\n1neni18\n\n<bä> doesn't terminate </bä>\n\n19vsvgj\n\n1bsug1l\n\n<s.foo> doesn't terminate </s.foo>\n\n<sub-ID#1>");
add("selser", "Non-word characters don't terminate tag names [0,0,[3],3,0,0,1,0,4,4,1]", "<blockquote|>a</blockquote>\n\n<bä> doesn't terminate </bä>\n\n<boo> doesn't terminate </boo>\n\nb277il\n\nnw1fua\n\n<sub-ID#1>");
add("selser", "Non-word characters don't terminate tag names [0,2,[2],2,0,2,[2],2,0,3,4]", "<blockquote|>a</blockquote>\n\n16ww6w\n\n1lxmafc<b→> doesn't terminate </b→>\n\nijbioa\n\n<bä> doesn't terminate </bä>\n\n77bf0k\n\n1tpy93q<boo> doesn't terminate </boo>\n\n5o8z89\n\n<s.foo> doesn't terminate </s.foo>\n\ns6izwz");
add("selser", "Non-word characters don't terminate tag names [0,3,0,3,3,3,1,2,0,2,0]", "<blockquote|>a</blockquote>\n\n<b→> doesn't terminate </b→>\n\n<boo> doesn't terminate </boo>\n\nyp4gad\n\n<s.foo> doesn't terminate </s.foo>\n\noqecd6\n\n<sub-ID#1>");
add("selser", "Non-word characters don't terminate tag names [0,0,0,4,1,0,[4],0,4,0,3]", "<blockquote|>a</blockquote>\n\n<b→> doesn't terminate </b→>\n\nuj9q6q\n\n<bä> doesn't terminate </bä>\n\nn70jry\n\nnozyv\n");
add("selser", "Non-word characters don't terminate tag names [0,0,[2],4,[3],0,[2],2,1,0,3]", "<blockquote|>a</blockquote>\n\n2atll3<b→> doesn't terminate </b→>\n\ng2ohcv\n\n5gs6v3<boo> doesn't terminate </boo>\n\nfjenc\n\n<s.foo> doesn't terminate </s.foo>\n");
add("selser", "Block tag on both lines (<div>) [[2],0,2,[4]]", "z0pyypa <div>foo</div>11h4nuv\n\n\n\nb <div>104u2c8</div>");
add("selser", "Block tag on both lines (<div>) [0,0,2,[4]]", "a <div>foo</div>le0fqd\n\n\n\nb <div>146eh3g</div>");
add("selser", "Block tag on both lines (<div>) [4,3,0,1]", "10u32ah\n\n\n\nb <div data-foobar=\"1s7dc0q\">foo</div>");
add("selser", "Block tag on both lines (<div>) [1,3,0,4]", "a \n\n\n\nb \n\n1iw4nz");
add("selser", "Block tag on both lines (<div>) [0,3,2,4]", "a \n\nnkdbte\n\n\n\nb \n\n1dbuavl");
add("selser", "Block tag on both lines (<blockquote>) [4,3,0,[4]]", "1im7zig\n\n\n\nb <blockquote>1i4q1ae</blockquote>");
add("selser", "Block tag on both lines (<blockquote>) [3,[[3]],2,4]", "<blockquote></blockquote>1fnt0pu\n\n\n\nb \n\n18shkak");
add("selser", "Block tag on both lines (<blockquote>) [3,[4],2,[[4]]]", "<blockquote>183mbn3</blockquote>1b4ji74\n\n\n\nb <blockquote>k9egbp</blockquote>");
add("selser", "Empty lines between lines with block tags [0,0,3,3,2,1,4,4,0,2,[3],0,4,2,3,2,3,2]", "<div></div>\njjklp2<div></div>a\n\ng8wdnu\n\npxagar\n1eyyaj8<div>a</div>\n\n190243a\n\n18irl8i\n\nd\n\nto4j2u\n\n\n\n\n1r99mhs<div>e</div>");
add("selser", "Empty lines between lines with block tags [0,0,0,4,0,4,0,4,2,4,2,0,0,3,3,0,0,4]", "<div></div>\n\n\n\n12z01x<div></div>ku0gkm\n\n9kuqwp\n\n7ha43h\n\nhpgub4\n\n1xhfwxa\n\nb\n\n<div>b</div>\n\nxoyi4a");
add("selser", "Empty lines between lines with block tags [0,2,[4,3],4,0,0,2,0,2,2,2,0,2,0,4,2,0,0]", "<div></div>5abbfd\n1q5cs0w\n\n1eki8l9<div></div>a\n\nizp2wc\n\nb\n\n86byuv\n5ve8gy<div>a</div>1flz15e\n\nb\n\n1nfn21n<div>b</div>d\n\n1t131ts\n\nzti1qo\n\n\n\n<div>e</div>");
add("selser", "Empty lines between lines with block tags [4,3,3,2,3,1,3,0,0,4,0,0,4,[3],3,2,0,0]", "1deaoe9\n\n1l6knvv\n\na\n\nb\n\n15oofy8\n\nb\n\n1lr92yk\n\n1ac6hkk\n\n\n\n<div>e</div>");
add("selser", "Empty lines between lines with block tags [2,0,2,0,0,3,2,3,2,[2],2,2,2,[3],4,[2,1],0,[4]]", "1ddqn1p<div></div>\ns3apet\n\n\n\n<div></div>wxjbnu\n\nlwlopa\n<div>1wiiiqza</div>rzmtrj\n\nb\n\np309qe\n\nzocynt<div>b</div>\n\nyzbydx\n\ne1sftr\n\n<div>1bzrsg9</div>");
add("selser", "Empty lines between lines with block tags [1,0,2,3,3,0,2,0,0,0,[4],3,1,[2],4,1,3,[4]]", "<div data-foobar=\"15ee2y8\"></div>\n7dgo72\n\n\n\n\na\n\nxgkgbi\n\nb\n<div>a</div>1oegiiz<div data-foobar=\"17hstk7\">b</div>x5n0did\n\n1vwivxs\n\n\n<div>1sifuia</div>");
add("selser", "Empty lines between lines with block tags [0,4,2,2,0,4,0,[2],0,[4],3,0,0,0,0,2,3,0]", "<div></div>vygiqc\n\nldw79x\n\n\n\n\n1g9ukkj\n<div></div>1j1f0la\n\n1qbabjmb\n<div>t9qray</div>\n\n<div>b</div>d\n1r0x9v4\n\n\n<div>e</div>");
add("selser", "Empty lines between lines with block tags [2,0,[0,1],3,2,0,0,4,2,2,1,3,[4],2,0,1,4,0]", "1g3pf14<div></div>\n\n\n\ni9vzpw<div></div>a\n\nz5ck51\n\n1wncur\n14s5ttb<div>a</div>b<div>16mf5el</div>1yk2uy9\n\nd\n\n\n\n\n\n1hwh6qc<div>e</div>");
add("selser", "Empty lines between lines with block tags [0,4,2,2,0,0,0,[3],4,3,0,0,0,2,2,1,4,2]", "<div></div>n23fa\n\n1t82bez\n\n\n\n\n15yhe4b\n<div></div>a\n\n1rdp6ou\n\nb\n\n<div>b</div>1xvd761\n\nd\n\nvlf4a8\n\n\n\n4xozs6\n\nnzhxyc<div>e</div>");
add("selser", "Avoid expanding multiline sol transparent template ranges unnecessarily [[2],0,[0,0,2,0,0],0,0]", "3spi4chi\n\n1af3ip4\n{{echo|<br/>\n}}\n\n[[Category:Ho]]");
add("selser", "Avoid expanding multiline sol transparent template ranges unnecessarily [4,0,1,0,0]", "1ifiv62\n\n\n\n{{echo|<br/>\n}}\n\n[[Category:Ho]]");
add("selser", "Avoid expanding multiline sol transparent template ranges unnecessarily [[2],0,[3,0,0,0,0],0,3]", "ig6ro7hi\n\n\n\n{{echo|<br/>\n}}\n");
add("selser", "Avoid expanding multiline sol transparent template ranges unnecessarily [3,4,1,0,4]", "11c84ga\n\n\n\n{{echo|<br/>\n}}\n\n1uy04ef");
add("selser", "Templates: Indent-Pre: 1f: Wrapping should be based on expanded content [0,4,0,0,0,0,0,3,0,0,0,4,0,0,[3]]", "{{echo| }}a1v0rsn1{{echo|\n }}a\n\n{{echo|\n b}}\n{{echo|a\n }}b\n1ikarr6{{echo|a\n}} ");
add("selser", "Templates: Indent-Pre: 1f: Wrapping should be based on expanded content [0,4,0,0,0,0,0,4,0,0,0,0,0,0,0]", "{{echo| }}a17f3ud6{{echo|\n }}a\n\n{{echo|\n b}}\n1kc5ntg{{echo|a\n }}b\n\n{{echo|a\n}} b");
add("selser", "Templates: Indent-Pre: 1f: Wrapping should be based on expanded content [0,3,0,0,0,0,0,4,0,0,0,0,0,0,[4]]", "{{echo| }}a{{echo|\n }}a\n\n{{echo|\n b}}\n1hhz1mf{{echo|a\n }}b\n\n{{echo|a\n}} 1aewpjv");
add("selser", "Templates: Indent-Pre: 1f: Wrapping should be based on expanded content [0,4,0,0,0,0,0,0,0,0,0,2,0,0,[3]]", "{{echo| }}a1y95ktj{{echo|\n }}a\n\n{{echo|\n b}}\n\n{{echo|a\n }}b\n1far117\n\n{{echo|a\n}} ");
add("selser", "Templates: Indent-Pre: 1f: Wrapping should be based on expanded content [0,3,0,0,0,0,0,0,0,0,0,2,0,0,[3]]", "{{echo| }}a{{echo|\n }}a\n\n{{echo|\n b}}\n\n{{echo|a\n }}b\n17080ek\n\n{{echo|a\n}} ");
add("selser", "Templates: Indent-Pre: 1f: Wrapping should be based on expanded content [0,3,0,0,0,0,0,3,0,0,0,4,0,0,0]", "{{echo| }}a{{echo|\n }}a\n\n{{echo|\n b}}\n{{echo|a\n }}b\n1rwm9sa{{echo|a\n}} b");
add("selser", "Templates: Indent-Pre: 1f: Wrapping should be based on expanded content [0,3,0,0,0,0,0,3,0,0,0,3,0,0,0]", "{{echo| }}a{{echo|\n }}a\n\n{{echo|\n b}}\n{{echo|a\n }}b\n{{echo|a\n}} b");
add("selser", "Templates: Indent-Pre: 1f: Wrapping should be based on expanded content [0,0,0,0,0,0,0,2,0,0,0,0,0,0,1]", "{{echo| }}a\n\n{{echo|\n }}a\n\n{{echo|\n b}}\nvovvem\n\n{{echo|a\n }}b\n\n{{echo|a\n}} b");
add("selser", "Templates: Indent-Pre: 1f: Wrapping should be based on expanded content [0,2,0,0,0,0,0,3,0,0,0,0,0,0,1]", "{{echo| }}a14hw18j\n\n{{echo|\n }}a\n\n{{echo|\n b}}\n{{echo|a\n }}b\n\n{{echo|a\n}} b");
add("selser", "Templates: Indent-Pre: 1f: Wrapping should be based on expanded content [0,0,0,0,0,0,0,0,0,0,0,4,0,0,0]", "{{echo| }}a\n\n{{echo|\n }}a\n\n{{echo|\n b}}\n\n{{echo|a\n }}b\nnavwn2{{echo|a\n}} b");
add("selser", "Templates: Indent-Pre: 1f: Wrapping should be based on expanded content [0,0,0,0,4,0,0,0,0,0,0,0,0,0,[2]]", "{{echo| }}a\n\n{{echo|\n }}a\n90lf8h{{echo|\n b}}\n\n{{echo|a\n }}b\n\n{{echo|a\n}} fhhbtwb");
add("selser", "Templates: Indent-Pre: 1f: Wrapping should be based on expanded content [0,0,0,0,0,0,0,0,0,0,0,0,0,0,[4]]", "{{echo| }}a\n\n{{echo|\n }}a\n\n{{echo|\n b}}\n\n{{echo|a\n }}b\n\n{{echo|a\n}} tq4wr0");
add("selser", "Less than in attribute position [0,2,[2]]", "<pre <pre>123</pre>1uq0wbh\n\n\n\n<div <div>tfpwo9123</div>");
add("selser", "Templates: Handle comments in the target [0,0,0,3,0,3,0,2,0]", "{{echo\n<!-- should be ignored -->\n|foo}}\n\n{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}{{echo<!-- should be ignored -->\n|foo}}{{echo<!-- should be ignored -->|foo}}\n\npm7iz2\n\n{{<!-- should be ignored -->echo|foo}}");
add("selser", "Templates: Handle comments in the target [0,0,0,3,0,0,0,0,0]", "{{echo\n<!-- should be ignored -->\n|foo}}\n\n{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}{{echo<!-- should be ignored -->\n|foo}}\n\n{{echo<!-- should be ignored -->|foo}}\n\n{{<!-- should be ignored -->echo|foo}}");
add("selser", "Templates: Handle comments in the target [0,0,0,3,0,0,0,2,0]", "{{echo\n<!-- should be ignored -->\n|foo}}\n\n{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}{{echo<!-- should be ignored -->\n|foo}}\n\n{{echo<!-- should be ignored -->|foo}}\n\nj1csr1\n\n{{<!-- should be ignored -->echo|foo}}");
add("selser", "Templates: Handle comments in the target [0,4,0,3,0,0,0,0,0]", "{{echo\n<!-- should be ignored -->\n|foo}}\n\n15yxofr\n\n{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}{{echo<!-- should be ignored -->\n|foo}}\n\n{{echo<!-- should be ignored -->|foo}}\n\n{{<!-- should be ignored -->echo|foo}}");
add("selser", "Templates: Handle comments in the target [0,0,0,0,0,2,0,0,0]", "{{echo\n<!-- should be ignored -->\n|foo}}\n\n{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}\n\n{{echo<!-- should be ignored -->\n|foo}}\n\njgyysa\n\n{{echo<!-- should be ignored -->|foo}}\n\n{{<!-- should be ignored -->echo|foo}}");
add("selser", "Templates: Handle comments in the target [0,0,0,3,0,0,0,4,0]", "{{echo\n<!-- should be ignored -->\n|foo}}\n\n{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}{{echo<!-- should be ignored -->\n|foo}}\n\n{{echo<!-- should be ignored -->|foo}}\n\nsgvcmd\n\n{{<!-- should be ignored -->echo|foo}}");
add("selser", "Templates: Handle comments in the target [0,2,0,3,0,0,0,0,0]", "{{echo\n<!-- should be ignored -->\n|foo}}\n\nzcgcjr\n\n{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}{{echo<!-- should be ignored -->\n|foo}}\n\n{{echo<!-- should be ignored -->|foo}}\n\n{{<!-- should be ignored -->echo|foo}}");
add("selser", "Templates: Handle comments in the target [0,0,0,0,0,0,0,3,0]", "{{echo\n<!-- should be ignored -->\n|foo}}\n\n{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}\n\n{{echo<!-- should be ignored -->\n|foo}}\n\n{{echo<!-- should be ignored -->|foo}}{{<!-- should be ignored -->echo|foo}}");
add("selser", "Templates: Handle comments in the target [0,0,0,2,0,0,0,0,0]", "{{echo\n<!-- should be ignored -->\n|foo}}\n\n{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}\n\nr8wbl5\n\n{{echo<!-- should be ignored -->\n|foo}}\n\n{{echo<!-- should be ignored -->|foo}}\n\n{{<!-- should be ignored -->echo|foo}}");
add("selser", "Templates: Handle comments in the target [0,2,0,0,0,4,0,0,0]", "{{echo\n<!-- should be ignored -->\n|foo}}\n\n1pmd7ph\n\n{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}\n\n{{echo<!-- should be ignored -->\n|foo}}\n\n1jcnmqf\n\n{{echo<!-- should be ignored -->|foo}}\n\n{{<!-- should be ignored -->echo|foo}}");
add("selser", "Templates: Handle comments in the target [0,0,0,0,0,0,0,4,0]", "{{echo\n<!-- should be ignored -->\n|foo}}\n\n{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}\n\n{{echo<!-- should be ignored -->\n|foo}}\n\n{{echo<!-- should be ignored -->|foo}}\n\n3qfb35\n\n{{<!-- should be ignored -->echo|foo}}");
add("selser", "Templates: Handle comments in the target [0,0,0,2,0,3,0,4,0]", "{{echo\n<!-- should be ignored -->\n|foo}}\n\n{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}\n\nvrcm62\n\n{{echo<!-- should be ignored -->\n|foo}}{{echo<!-- should be ignored -->|foo}}\n\n1yscfka\n\n{{<!-- should be ignored -->echo|foo}}");
add("selser", "Templates: Handle comments in the target [0,3,0,0,0,4,0,0,0]", "{{echo\n<!-- should be ignored -->\n|foo}}{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}\n\n{{echo<!-- should be ignored -->\n|foo}}\n\n1rq5hmx\n\n{{echo<!-- should be ignored -->|foo}}\n\n{{<!-- should be ignored -->echo|foo}}");
add("selser", "Templates: Handle comments in the target [0,2,0,2,0,3,0,0,0]", "{{echo\n<!-- should be ignored -->\n|foo}}\n\n1ts33ib\n\n{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}\n\ndiv5ig\n\n{{echo<!-- should be ignored -->\n|foo}}{{echo<!-- should be ignored -->|foo}}\n\n{{<!-- should be ignored -->echo|foo}}");
add("selser", "Templates: Handle comments in the target [0,0,0,0,0,4,0,0,0]", "{{echo\n<!-- should be ignored -->\n|foo}}\n\n{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}\n\n{{echo<!-- should be ignored -->\n|foo}}\n\nc9taiz\n\n{{echo<!-- should be ignored -->|foo}}\n\n{{<!-- should be ignored -->echo|foo}}");
add("selser", "Templates: Handle comments in the target [0,4,0,4,0,4,0,0,0]", "{{echo\n<!-- should be ignored -->\n|foo}}\n\n1ekhlra\n\n{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}\n\n1rwssbq\n\n{{echo<!-- should be ignored -->\n|foo}}\n\n1y3hrq6\n\n{{echo<!-- should be ignored -->|foo}}\n\n{{<!-- should be ignored -->echo|foo}}");
add("selser", "Templates: Handle comments in the target [0,3,0,0,0,2,0,0,0]", "{{echo\n<!-- should be ignored -->\n|foo}}{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}\n\n{{echo<!-- should be ignored -->\n|foo}}\n\n1efeuy2\n\n{{echo<!-- should be ignored -->|foo}}\n\n{{<!-- should be ignored -->echo|foo}}");
add("selser", "Templates: Handle comments in the target [0,3,0,3,0,0,0,2,0]", "{{echo\n<!-- should be ignored -->\n|foo}}{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}{{echo<!-- should be ignored -->\n|foo}}\n\n{{echo<!-- should be ignored -->|foo}}\n\n1st49h4\n\n{{<!-- should be ignored -->echo|foo}}");
add("selser", "Templates: Handle comments in the target [0,0,0,4,0,0,0,3,0]", "{{echo\n<!-- should be ignored -->\n|foo}}\n\n{{echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}\n\nyqfzta\n\n{{echo<!-- should be ignored -->\n|foo}}\n\n{{echo<!-- should be ignored -->|foo}}{{<!-- should be ignored -->echo|foo}}");
add("selser", "3a. Indent-Pre and block tags (single-line html) 5", "<nowiki> </nowiki>a <p> foo </p>\n b <div> foo </div>\n c <blockquote> foo </blockquote>\n <span> foo </span>\n");
add("selser", "3a. Indent-Pre and block tags (single-line html) [[4],2,2,0,[2],1,2,[2]]", "o0smsc\n\n1r3w4go<p> foo </p>10t1s68\n\n\n b <div> foo </div>1nt967l\n c <blockquote data-foobar=\"17zns2f\"> foo </blockquote>zd8vgh\n 1jlxwy8<span> foo </span>");
add("selser", "3a. Indent-Pre and block tags (single-line html) [0,[3],2,3,3,0,2,4]", "<nowiki> </nowiki>a <p></p>sxbnnw\n\n\n b <blockquote> foo </blockquote>4d4za2\nxhh6qd");
add("selser", "3a. Indent-Pre and block tags (single-line html) [4,[4],0,[3],2,3,0,[4]]", "1csvl35<p>1q96txm</p>\n b <div></div>5unnk0\n\n\n c \n nbk10z");
add("selser", "3a. Indent-Pre and block tags (single-line html) [[2],0,2,4,0,3,0,2]", "67hnn5 a <p> foo </p>1up1b58\n\n\n b \n\n1dwr5n4\n\n\n c \n\nk6hokz\n <span> foo </span>");
add("selser", "3a. Indent-Pre and block tags (single-line html) [[4],[2],0,3,4,[[3]],0,1]", "978a25<p>u00wsx foo </p>\n b \n\n1c50wkb<blockquote></blockquote>\n <span> foo </span>");
add("selser", "3a. Indent-Pre and block tags (single-line html) [0,0,0,4,0,2,0,1]", "<nowiki> </nowiki>a <p> foo </p>\n b \n\nv41wa2\n\n\n c \n\n8qjbnp<blockquote> foo </blockquote>\n <span> foo </span>");
add("selser", "3a. Indent-Pre and block tags (single-line html) [[3],2,4,[2],2,[3],0,0]", "\n7nuz6g<p> foo </p>79tihs<div>1scrgud foo </div>npmi0p\n\n\n c <blockquote></blockquote>\n <span> foo </span>");
add("selser", "3b. Indent-Pre and block tags (multi-line html) [0,4,4,0,[4]]", " a <span>foo</span>\nb6nk6z\n\nwj9je4\n\n<nowiki> </nowiki>b <div>iyjoxe</div>");
add("selser", "3b. Indent-Pre and block tags (multi-line html) [3,0,0,0,0]", "\n<!-- comment --><nowiki> </nowiki>b <div> foo </div>");
add("selser", "3b. Indent-Pre and block tags (multi-line html) [[2,0],2,0,0,0]", " ecf3lwa <span>foo</span>\n1nney6s\n<!-- comment --><nowiki> </nowiki>b <div> foo </div>");
add("selser", "5a. White-space in indent-pre [[0,0,4]]", " a<br />\n fforbc");
add("selser", "5a. White-space in indent-pre [1]", " a<br />\n \n \n b");
add("selser", "5a. White-space in indent-pre [[3,0,0]]", " <br />\n \n \n b");
add("selser", "5a. White-space in indent-pre [[3,2,0]]", " wjzi7e<br />\n \n \n b");
add("selser", "5a. White-space in indent-pre [[0,2,2]]", " a1qgred7<br />\n 1mr1ufg\n \n b");
add("selser", "5a. White-space in indent-pre [[0,0,2]]", " a<br />\n 17tnwzt\n \n b");
add("selser", "5a. White-space in indent-pre [[2,0,4]]", " puq9wka<br />\n fwh62r");
add("selser", "5a. White-space in indent-pre [[2,0,0]]", " ie5udka<br />\n \n \n b");
add("selser", "5a. White-space in indent-pre [[0,2,0]]", " a17lt6v3<br />\n \n \n b");
add("selser", "Definition lists: self-closed tag [2]", "1t68spe\n\n;one<br/>two :two-line fun");
add("selser", "Definition lists: self-closed tag [1]", ";one<br/>two :two-line fun");
add("selser", "Definition lists: self-closed tag [[[4,2,4,0],[2]]]", ";yedg8a2fds9m<br/>2hay3h :lwx5eqtwo-line fun");
add("selser", "Definition lists: self-closed tag [[[4,0,2,0],4]]", ";cqh580<br/>1cxv9dytwo \n: xelayq");
add("selser", "Definition lists: self-closed tag [[[2,2,0,3],[3]]]", ";1nuwfyaoneignte1<br/>two:");
add("selser", "Definition lists: self-closed tag [[[0,0,0,[3]],0]]", ";one<br/>two :two-line fun");
add("selser", "Definition lists: self-closed tag [[[0,0,0,1],0]]", ";one<br/>two :two-line fun");
add("selser", "Definition lists: self-closed tag [[[3,0,0,1],2]]", ";<br/>two \n: 1d1gzuu:two-line fun");
add("selser", "Definition lists: self-closed tag [[2,3]]", ": p5btax\n;one<br/>two ");
add("selser", "Definition lists: self-closed tag [[[0,0,2,[4]],3]]", ";one<br/>bj07h5two ");
add("selser", "Definition lists: self-closed tag [[1,0]]", ";one<br/>two :two-line fun");
add("selser", "Definition lists: ignore colons inside tags [[[3,[2,2,3,0,2],0]]]", ";<b>hpkdfptwo7k990h <i>fun:</i>yh7cjg:</b>:def");
add("selser", "Definition lists: ignore colons inside tags [[1]]", ";one <b>two : tag <i>fun:</i>:</b>:def");
add("selser", "Definition lists: ignore colons inside tags [[2]]", ": iuxzng\n;one <b>two : tag <i>fun:</i>:</b>:def");
add("selser", "Definition lists: ignore colons inside tags [2]", "1cpbmsz\n\n;one <b>two : tag <i>fun:</i>:</b>:def");
add("selser", "Definition lists: ignore colons inside tags [1]", ";one <b>two : tag <i>fun:</i>:</b>:def");
add("selser", "Definition lists: ignore colons inside tags [[[4,[4,1,4,2,0],0]]]", ";119n669<b>1ea1k5c 1y6e936u31y8e<i>fun:</i>:</b>:def");
add("selser", "Definition lists: ignore colons inside tags [[[0,[2,[4],2,3,0],0]]]", ";one <b>1pa1sdqtwo 1mkk2cc: tag :</b>:def");
add("selser", "Definition lists: ignore colons inside tags [[[2,[0,3,0,3,2],0]]]", ";1kxeineone <b>two: tag 603f0u:</b>:def");
add("selser", "Definition lists: ignore colons inside tags [[[0,[0,[4],4,[3],2],0]]]", ";one <b>two 18ih7yw<i></i>onwv27:</b>:def");
add("selser", "Definition lists: ignore colons inside tags [[[4,2,0]]]", ";tsk6sa1xx8ym6<b>two : tag <i>fun:</i>:</b>:def");
add("selser", "Definition lists: ignore colons inside tags [[[3,2,0]]]", ";fl1k07<b>two : tag <i>fun:</i>:</b>:def");
add("selser", "Definition lists: excess closed tags [1]", ";one</b>two :bad tag fun");
add("selser", "Definition lists: excess closed tags [2]", "1p36ay3\n\n;one</b>two :bad tag fun");
add("selser", "T13748: Literal closing tags [[0,4,3,[2],0,[3],3,0,0]]", "<dl>\n<dd>1m6oh4c</dd><dd>1twdvoftest test test test test</dd>\n<dt></dt>\n<dd>test test test test test</dd>\n</dl>");
add("selser", "Definition Lists: Hacky use to indent tables [2,0,0]", "1pj1vx9\n\n::{|\n|foo\n|bar\n|}\nthis text\nshould be left alone");
add("selser", "Definition Lists: Hacky use to indent tables [1,0,1]", "::{|\n|foo\n|bar\n|}\nthis text\nshould be left alone");
add("selser", "Definition Lists: Hacky use to indent tables [1,0,0]", "::{|\n|foo\n|bar\n|}\nthis text\nshould be left alone");
add("selser", "Definition Lists: Hacky use to indent tables [[[[2]]],0,0]", ":: hjb208\n::{|\n|foo\n|bar\n|}\nthis text\nshould be left alone");
add("selser", "Definition Lists: Hacky use to indent tables (WS-insensitive) [[[[4,3]]]]", ":{|<!--7zfywh-->\n|} ");
add("selser", "Definition Lists: Hacky use to indent tables (WS-insensitive) [[[[0,4]]]]", ":{|\n<!--f80c5i-->|} ");
add("selser", "Definition Lists: Hacky use to indent tables (WS-insensitive) [[1]]", ":{|\n|a\n|} ");
add("selser", "Definition Lists: Hacky use to indent tables (WS-insensitive) [[[[0,[[[4]],0]]]]]", ":{|\n|fajhy\n|} ");
add("selser", "Definition Lists: Hacky use to indent tables (WS-insensitive) [1]", ":{|\n|a\n|} ");
add("selser", "Definition Lists: Hacky use to indent tables (WS-insensitive) [[[[4,[4,2]]]]]", ":{|<!--1i8p0ex--><!--1jyvjes--><!--130s616-->\n|} ");
add("selser", "Definition Lists: Hacky use to indent tables (WS-insensitive) [[[[3,[0,2]]]]]", ":{|\n|a<!--tulzkn-->\n|} ");
add("selser", "Definition Lists: Hacky use to indent tables (WS-insensitive) [2]", "1rodnqb\n\n:{|\n|a\n|} ");
add("selser", "Definition Lists: Hacky use to indent tables (WS-insensitive) [[[[4,[[[2]],3]]]]]", ":{|<!--102j1dv-->\n|8yvcida\n|} ");
add("selser", "Definition Lists: Hacky use to indent tables (WS-insensitive) [[[[3,0]]]]", ":{|\n|a\n|} ");
add("selser", "Definition Lists: Hacky use to indent tables (WS-insensitive) [[[[3,[[3],0]]]]]", ":{|\n|} ");
add("selser", "Definition Lists: Hacky use to indent tables (WS-insensitive) [[2]]", ": 1fgg4qu\n:{|\n|a\n|} ");
add("selser", "Definition Lists: Hacky use to indent tables (WS-insensitive) [[[[0,2]]]]", ":{|\n<!--sa3lz6-->|a\n|} ");
add("selser", "Definition Lists: Hacky use to indent tables (WS-insensitive) [[[[0,1]]]]", ":{|\n|a\n|} ");
add("selser", "Table / list interaction: indented table with lists in table contents [[[2]]]", ":wwbalm {| |- |a *b |- |c *d |}");
add("selser", "Definition Lists: Mixed Lists: Test 13 [[[[2]]]]", "*# lbxphe\n*#*#;*;;foo : bar\n*#*#;boo : baz");
add("selser", "Definition Lists: Mixed Lists: Test 13 [2]", "19by5n1\n\n*#*#;*;;foo : bar\n*#*#;boo : baz");
add("selser", "Definition Lists: Mixed Lists: Test 13 [[[[[2]]]]]", "*#1c10ypy\n*#*#;*;;foo : bar\n*#*#;boo : baz");
add("selser", "Definition Lists: Mixed Lists: Test 13 [1]", "*#*#;*;;foo : bar\n*#*#;boo : baz");
add("selser", "Definition Lists: Mixed Lists: Test 13 [[2]]", "* 12pybks\n*#*#;*;;foo : bar\n*#*#;boo : baz");
add("selser", "Definition Lists: Mixed Lists: Test 13 [[[1]]]", "*#*#;*;;foo : bar\n*#*#;boo : baz");
add("selser", "Definition Lists: Mixed Lists: Test 13 [[[[[1]]]]]", "*#*#;*;;foo : bar\n*#*#;boo : baz");
add("selser", "Definition Lists: Mixed Lists: Test 13 [[[2]]]", "*q64qw0\n*#*#;*;;foo : bar\n*#*#;boo : baz");
add("selser", "Definition Lists: Mixed Lists: Test 13 [[1]]", "*#*#;*;;foo : bar\n*#*#;boo : baz");
add("selser", "Definition Lists: colons occurring in tags [[0,4,2,1,0,[[4]],0,3,3,[[3]],0,0,2,0,0,3,2,3]]", ";a\n: k4i8ju\n: 1frp7z5\n;'''a:b'''\n;<i>1xbcbjd</i>\n;<div></div>\n;<div>a\n: tdgkhy\n:b</div>\n: 7xvywx\n");
add("selser", "Definition Lists: colons occurring in tags [2]", "1g6rrb9\n\n;a:b\n;'''a:b'''\n;<i>a:b</i>\n;<span>a:b</span>\n;<div>a:b</div>\n;<div>a\n:b</div>\n;{{echo|a:b}}\n;{{echo|''a:b''}}\n;;;''a:b''");
add("selser", "Definition Lists: colons occurring in tags [[3,3,2,1,0,[[2]],2,[3],4,3,0,1,2,0,2,1,0,[0,4,[4]]]]", ": nzvnpe\n;'''a:b'''\n;<i>1jw5jcza:b</i>\n: 17s8ytm\n;\n: 1g5wqy9\n;<div>a\n: 1xd9cpp\n:b</div>\n: fwqnl\n;{{echo|a:b}}\n;{{echo|''a:b''}}h5gm3v\n;: vhbio0\n");
add("selser", "Definition Lists: colons occurring in tags [[1,1,3,[3],0,[3],0,1,4,[1],0,3,3,0,4,0,0,2]]", ";a:b\n;\n;\n;<span>a:b</span>\n: y09n62\n;<div data-foobar=\"1n7de7p\">a:b</div>\n:b</div>\n: 1kgtm03\n;{{echo|a:b}}\n: gqtlve\n;{{echo|''a:b''}}\n;;;''a:b''");
add("selser", "Definition Lists: colons occurring in tags [[3,[4],0,[[2]],4,0,4,[4],0,[[2]],2,[[4]],2,0,0,0,0,4]]", ":b1paz2\n;'''p58ldma:b'''\n: 17zzltx\n;<i>a:b</i>\n: 1bwlhk7\n;i7sb76\n;<div>2mikjga:b</div>\n: 1qgql3b\n;<div>1yrntbc\n: 2syw3k\n:b</div>\n;{{echo|a:b}}\n: zdm48w");
add("selser", "Definition Lists: colons occurring in tags [[0,0,4,[2],3,[4],0,[[3]],4,[[3]],0,2,3,0,0,0,0,[0,0,1]]]", ";a:b\n: xpkafq\n;xtr0w1'''a:b'''\n;vfwfi4\n;<span></span>\n: xrlfdd\n;<div></div>\n: qopt54\n;<div>a\n:b</div>\n;{{echo|a:b}}\n;{{echo|''a:b''}}\n;;;''a:b''");
add("selser", "Definition Lists: colons occurring in tags [1]", ";a:b\n;'''a:b'''\n;<i>a:b</i>\n;<span>a:b</span>\n;<div>a:b</div>\n;<div>a\n:b</div>\n;{{echo|a:b}}\n;{{echo|''a:b''}}\n;;;''a:b''");
add("selser", "T2289: \">\"-token in bracketed URL [1]", "[http://www.example.com/<hello> stuff]");
add("selser", "T2289: \">\"-token in bracketed URL [2]", "13x10lq\n\n[http://www.example.com/<hello> stuff]");
add("selser", "T2289: \">\"-token in bracketed URL [[2]]", "tgqujw[http://www.example.com/<hello> stuff]");
add("selser", "T2289: literal \">\"-token in bracketed URL [1]", "[http://www.example.com/<b>html</b> stuff]");
add("selser", "T2289: literal \">\"-token in bracketed URL [2]", "sgqdyx\n\n[http://www.example.com/<b>html</b> stuff]");
add("selser", "T2289: literal \">\"-token in bracketed URL [[2]]", "1k6kax7[http://www.example.com/<b>html</b> stuff]");
add("selser", "T2289: literal double quote in bracketed URL [2]", "1sts8fr\n\n[http://www.example.com/\"hello\" stuff]");
add("selser", "T2289: literal double quote in bracketed URL [1]", "[http://www.example.com/\"hello\" stuff]");
add("selser", "T2289: literal double quote in bracketed URL [[2]]", "1nc6wue[http://www.example.com/\"hello\" stuff]");
add("selser", "External links: multiple legal whitespace is fine, Magnus. Don't break it please. (T7081) [2]", "17fhfw0\n\n[http://www.example.com test]");
add("selser", "External links: multiple legal whitespace is fine, Magnus. Don't break it please. (T7081) [[2]]", "6srwd0[http://www.example.com test]");
add("selser", "External links: multiple legal whitespace is fine, Magnus. Don't break it please. (T7081) [1]", "[http://www.example.com test]");
add("selser", "T4702: Mismatched <i>, <b> and <a> tags are invalid [[[3],0,0,0,0,[0,[3,1]],0,[4,3,2],0,3]]", "''<nowiki/>''\n[http://example.com '''text]'''\n''Something [http://example.com ''<nowiki/>'']''\n''qkgn80o3zxsd'''\n");
add("selser", "T4702: Mismatched <i>, <b> and <a> tags are invalid [2]", "1m5psig\n\n''[http://example.com text'']\n[http://example.com '''text]'''\n''Something [http://example.com in italic'']\n''Something [http://example.com mixed''''', even bold]'''\n'''''Now [http://example.com both''''']");
add("selser", "T4702: Mismatched <i>, <b> and <a> tags are invalid [1]", "''[http://example.com text'']\n[http://example.com '''text]'''\n''Something [http://example.com in italic'']\n''Something [http://example.com mixed''''', even bold]'''\n'''''Now [http://example.com both''''']");
add("selser", "T4702: Mismatched <i>, <b> and <a> tags are invalid [[[[2,0]],3,[[2]],1,4,[0,3],0,[0,4,4],4,1]]", "''[http://example.com zyb9y3text'']''[http://example.com '''1qoymvgtext''']'''<nowiki/>'''bw748n''Something ''\n''Something adl0iw1pgmuwk''y4f27b'''''Now [http://example.com both''''']'''");
add("selser", "T4702: Mismatched <i>, <b> and <a> tags are invalid [[4,0,4,2,0,1,0,3,0,2]]", "1jjctz5\npqo6mlxj4zfi'''\n''Something [http://example.com in italic'']''\n\n1nkqnry'''''Now [http://example.com both''''']");
add("selser", "T4702: Mismatched <i>, <b> and <a> tags are invalid [[4,0,[2],3,3,1,2,3,0,[[0,[3,0]]]]]", "fq633s\n[http://example.com z6k6a5'''text]''Something [http://example.com in italic'']''1itz7sk\n\n'''''Now [http://example.com ''''']'''''");
add("selser", "T4702: Mismatched <i>, <b> and <a> tags are invalid [[[[2,0]],3,[[2]],3,0,4,4,3,0,2]]", "''[http://example.com 1fl7zurtext'']''[http://example.com '''g2czgytext''']\ntkxlfzewz40l\nb43mrw'''''Now [http://example.com both''''']");
add("selser", "T4702: Mismatched <i>, <b> and <a> tags are invalid [[2,0,[[2]],0,0,3,0,2,0,[[0,2]]]]", "1su8ozt''[http://example.com text'']\n[http://example.com '''1yotag2text''']'''\n\nkcfz7g''Something [http://example.com mixed''''', even bold]'''\n'''''Now medcd9[http://example.com both''''']'''''");
add("selser", "T4702: Mismatched <i>, <b> and <a> tags are invalid [[0,0,[2],1,3,[4,[3,0]],4,[0,[3,4],2],0,[1]]]", "''[http://example.com text'']\n[http://example.com 1k1dra5'''text]'''<nowiki/>'''''2sgkur[http://example.com '']''chob23''Something [http://example.com 8v224l]17aioqf'<nowiki/>''\n'''''Now [http://example.com both''''']'''''");
add("selser", "T4702: Mismatched <i>, <b> and <a> tags are invalid [[[[2,4]],3,[1],0,4,[0,[0,1]],3,2,0,[3]]]", "''[http://example.com 1fdmvh4text2yfn7v]''[http://example.com '''text''']'''10j1en2''Something [http://example.com in italic''<nowiki/>'']''16etdql''Something [http://example.com mixed''''', even bold]'''\n'''<nowiki/>'''");
add("selser", "T4702: Mismatched <i>, <b> and <a> tags are invalid [[[3],3,[3],1,4,[3,2],0,[0,[0,2],4],0,[4]]]", "''<nowiki/>''[http://example.com]'''<nowiki/>'''5vl9nm''4r1rc2[http://example.com in italic'']''\n''Something [http://example.com mixedxdfvtk''''', even bold]1enu0jj''\n'''1cffq00'''");
add("selser", "T4702: Mismatched <i>, <b> and <a> tags are invalid [[[[0,2]],2,[4],2,0,[4,[3,2]],3,[0,[0,3],0],0,[4]]]", "''[http://example.com texto8ckan'']''z9uyf8\n[http://example.com y33u36]y3ygwe'''\n''6qo38u[http://example.com cxfvtc'']Something [http://example.com mixed]'''\n'''fnt2s9'''");
add("selser", "T4702: Mismatched <i>, <b> and <a> tags are invalid [[1,2,2,0,2,[4,[0,4]],0,[0,[0,[[3]]],0],0,2]]", "''[http://example.com text'']''1dtvvhy\n1owq85s[http://example.com '''text]'''2ovole\n''1hkfcxq[http://example.com in italic4ylldq]''\n''Something [http://example.com mixed'''''<nowiki/>''''']'''\n1sxxa72'''''Now [http://example.com both''''']");
add("selser", "T4702: Mismatched <i>, <b> and <a> tags are invalid [[[1],0,[4],0,0,[0,4],4,[0,1,3],3,[[4,3]]]]", "''[http://example.com text'']''\n[http://example.com 18j7tcl]'''\n''Something d5uz25''1ceigdx''Something [http://example.com mixed''''', even bold]'''9akd2o'''''");
add("selser", "T4702: Mismatched <i>, <b> and <a> tags are invalid [[[3],0,1,0,0,[2,[3,0]],3,[3,2,4],2,[2]]]", "''<nowiki/>''\n[http://example.com '''text]'''\n''442ldxSomething [http://example.com '']a0udil[http://example.com mixed''''', even bold]pigbwn''pn85gv\n'''26be4p''Now [http://example.com both''''']'''");
add("selser", "T4702: Mismatched <i>, <b> and <a> tags are invalid [[4,2,3,2,3,[4,0],0,[0,2,0],0,0]]", "19v8d1luol8sn\n1g90nho'''''1smcwbl[http://example.com in italic'']''\n''Something 11ylls1[http://example.com mixed''''', even bold]'''\n'''''Now [http://example.com both''''']");
add("selser", "T4702: Mismatched <i>, <b> and <a> tags are invalid [[4,0,[3],4,0,4,2,3,0,2]]", "3dbdof\n[http://example.com]nssqhn\n147922y1mii58r\nuafhnx'''''Now [http://example.com both''''']");
add("selser", "External link containing double-single-quotes with no space separating the url from text in italics [[0,1,1]]", "[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].][[Museo Picasso (París)|Museo Picasso]]<span data-foobar=\"1rbr6np\">.</span>");
add("selser", "External link containing double-single-quotes with no space separating the url from text in italics [2]", "1ehf2a5\n\n[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].]");
add("selser", "External link containing double-single-quotes with no space separating the url from text in italics [1]", "[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].]");
add("selser", "External link containing double-single-quotes with no space separating the url from text in italics [[2,0,[2]]]", "7a8apf[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].]4wkxto.");
add("selser", "External link containing double-single-quotes with no space separating the url from text in italics [[[[4],4],2,0]]", "[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm ''t0j7dk''bc0354]692z0l");
add("selser", "External link containing double-single-quotes with no space separating the url from text in italics [[2,[3],[3]]]", "e6sxcx[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].][[Museo Picasso (París)|<nowiki/>]]");
add("selser", "External link containing double-single-quotes with no space separating the url from text in italics [[0,0,4]]", "[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].]<nowiki/>wn9za5");
add("selser", "External link containing double-single-quotes with no space separating the url from text in italics [[[4,0],0,2]]", "[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm 17uhaq0 (1901) en el sitio de ]1167r4g");
add("selser", "External link containing double-single-quotes with no space separating the url from text in italics [[[3,3],[4],0]]", "[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm][[Museo Picasso (París)|q6h2zv]]");
add("selser", "External link containing double-single-quotes with no space separating the url from text in italics [[[[2],0],2,0]]", "[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm ''7q2puaLa muerte de Casagemas'' (1901) en el sitio de ]1m5co9z");
add("selser", "External link containing double-single-quotes with no space separating the url from text in italics [[0,[3],2]]", "[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].][[Museo Picasso (París)|<nowiki/>]]<nowiki/>b4d1d6");
add("selser", "External link containing double-single-quotes with no space separating the url from text in italics [[3,[3],2]]", "[[Museo Picasso (París)|<nowiki/>]]65ww3e");
add("selser", "External link containing double-single-quotes with no space separating the url from text in italics [[1,3,0]]", "[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm ''La muerte de Casagemas'' (1901) en el sitio de ]");
add("selser", "External link containing double-single-quotes with no space separating the url from text in italics [[4,0,3]]", "1jnda7a");
add("selser", "External link containing double-single-quotes with no space separating the url from text in italics [[[1,2],2,4]]", "[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm ''La muerte de Casagemas''1svf0oe (1901) en el sitio de ]mqtmyg6n94l9");
add("selser", "mw:ExtLink linking to a interwiki URL can be round-tripped losslessly (T94723) [[[4]]]", "[[:en:European_Robin|1rmduf6]]");
add("selser", "mw:ExtLink linking to a interwiki URL can be round-tripped losslessly (T94723) [[[2]]]", "[[:en:European_Robin|134iwocEuropean Robin]]");
add("selser", "Unclosed and unmatched quotes [[[0,0,4]],2,3,3,[1],0,4,0,1,2,[[2]],3,3,3,2,0,3,4,1,2,2]", "'''''Bold italic text '''with bold deactivatedmik1b''\n\n194mnir\n\n'''Bold text..'''\n\n1vh6b8p\n\n'''Bold tag left open\n\n118iayy\n\n''hxqm6fItalic tag left open''\n\n8zfmbl<!-- Unmatching number of opening, closing tags: -->\n\nv7yj6u\n\n''Tom'''s car is bigger than '''''<nowiki/>'''Susan'''s.\n\n1suii2h\n\n1qt3jiw\n\nPlain ''italic'''s plain");
add("selser", "Unclosed and unmatched quotes [[1],0,[1],0,[3],0,[2,2],0,4,0,4,2,4,0,3,0,4,0,[[0,[4]],0,3],0,4]", "'''''Bold italic text '''with bold deactivated''' in between.'''''\n\n'''''Bold italic text ''with italic deactivated'' in between.'''''\n\n1vbvxxl..spanning two paragraphs (should not work).6tygj0'''\n\n750fcg\n\n1ke2xol\n\nqpzby4\n\n1fztsq9\n\n1qf0akm\n\n''Tom'''3ftppf'''''<nowiki/>'''Susan'''\n\namwrge");
add("selser", "Unclosed and unmatched quotes [[[3,0,[3]]],0,[1],0,2,2,3,0,[4],4,[4],0,0,3,0,4,[2,3,3,4,3,0],0,4,2,[0,3,4]]", "''with bold deactivated'''<nowiki/>'''''\n\n'''''Bold italic text ''with italic deactivated'' in between.'''''\n\n1o7p7gt\n\n'''Bold text..\n\nypestg\n\n9sn2o4\n\n1clpd1j\n\n1933mb7\n\nNormal text.<!-- Unmatching number of opening, closing tags: -->\n\nr7rcfr\n\n9vn9he'''This year''''1bex21s.\n\n23segf\n\n15xu7jn\n\nPlain 1038n5m");
add("selser", "Unclosed and unmatched quotes [4,0,3,0,2,0,0,2,4,0,[4],2,[4],2,4,0,[0,0,2,0,0,0],4,1,0,[0,2,0]]", "1dlqun5\n\n1i8pxk7\n\n'''Bold text..\n\n..spanning two paragraphs (should not work).'''\n\npzcqs\n\n1opojwd\n\n1lccvsd\n\n10rnb3g\n\nhwo4pr\n\n1nzcl3r\n\n1aa0n94\n\n'''This year'<nowiki/>'''s election phw2k7''should'' beat '''last year''''s.\n\nbg6ytl\n\n''Tom'''s car is bigger than '''''<nowiki/>'''Susan'''s.\n\nPlain muf30w''italic'''s plain");
add("selser", "Unclosed and unmatched quotes [[1],4,[2],3,3,3,1,2,2,0,2,0,2,3,4,2,[[2],3,3,0,[4],2],0,3,3,[0,4,0]]", "'''''Bold italic text '''with bold deactivated''' in between.'''''\n\n1f2u2s9\n\n1h4sgyp'''''Bold italic text ''with italic deactivated'' in between.'''''\n\n..spanning two paragraphs (should not work).'''\n\n10r6c97\n\n1g4ubk5\n\n'''Bold tag left open\n\nxni30r\n\n''Italic tag left open\n\n8iprbx\n\nNormal text.\n\n1qhnti8\n\ntfibsr\n\n'''1lug5iuThis year'''' beat '''17lidb7'''1arsznqs.\n\nPlain 16bbnhrs plain");
add("selser", "Unclosed and unmatched quotes [4,2,2,2,4,4,[0,1],0,1,2,2,0,3,0,0,0,[1,0,1,0,3,3],3,3,4,4]", "1l3cu15\n\n1o7t026\n\n1jk4d4p\n\n'''''Bold italic text ''with italic deactivated'' in between.'''''\n\n10q0gg\n\n1rl13k4\n\njsbpho\n\n..spanning two paragraphs (should not work).'''<nowiki/>'''\n\n'''Bold tag left open'''\n\n1ya2gu0\n\n1kcx5d2\n\n''Italic tag left open\n\n\n<!-- Unmatching number of opening, closing tags: -->'''This year''''s election ''should'' beat \n\nuh1zef\n\n4hr9nl");
add("selser", "Unclosed and unmatched quotes [[[0,4,[2]]],4,[[3,0,1]],0,3,2,0,0,[[3]],3,3,3,0,0,0,0,3,0,[3,[4],0],0,2]", "'''''Bold italic text '''v4msrm'''1k8j03x in between.'''''\n\n8hunuj\n\n'''with italic deactivated'' in between.'''''\n\n9rlkry\n\n..spanning two paragraphs (should not work).'''\n\n'''<nowiki/>'''\n\nNormal text.\n\n<!-- Unmatching number of opening, closing tags: -->\n'''i1gmy6'''s.\n\nfjxw35\n\nPlain ''italic'''s plain");
add("selser", "Unclosed and unmatched quotes [[[[4],0,0]],0,1,0,2,4,[0,1],0,2,4,4,2,0,0,0,0,[[3],3,0,0,[3],3],0,2,2,3]", "'''''vorhf2'''with bold deactivated''' in between.'''''\n\n'''''Bold italic text ''with italic deactivated'' in between.'''''\n\ni5kdfx\n\n'''Bold text..\n\ndjwh10\n\n..spanning two paragraphs (should not work).'''<nowiki/>'''\n\n1dwvgej\n\n'''Bold tag left open\n\n1hy1yls\n\n1qyd6on\n\n9j2kf8\n\nNormal text.\n\n<!-- Unmatching number of opening, closing tags: -->\n'''<nowiki/>'''''should'' beat '''<nowiki/>'''\n\nwvw7sb\n\n''Tom'''s car is bigger than ''Susan'''s.\n\nxeyd4d\n");
add("selser", "Unclosed and unmatched quotes [[1],2,3,3,0,0,2,0,[[2]],0,[3],0,3,3,0,0,1,0,[3,0,4],4,3]", "'''''Bold italic text '''with bold deactivated''' in between.'''''\n\n1bl3py2\n\n'''Bold text..\n\n12dfmgu\n\n..spanning two paragraphs (should not work).'''\n\n'''g53i9rBold tag left open'''\n\n\n<!-- Unmatching number of opening, closing tags: -->'''This year''''s election ''should'' beat '''last year''''s.\n\nSusan'''iohemb\n\n1etvtq3");
add("selser", "Unclosed and unmatched quotes [2,0,[[2,2,[3]]],3,1,3,3,0,3,4,[[4]],2,4,4,2,0,3,0,1,2,[3,4,3]]", "1f38mmi\n\n'''''Bold italic text '''with bold deactivated''' in between.'''''\n\n'''u8rwj5''Bold italic text ''ywfi2hwith italic deactivated''<nowiki/>'''''\n\n'''Bold text..\n\no2egqo\n\n''p7itsn''\n\ni6ynz7\n\n1pf5uyh\n\n1f7ibb6\n\ntv3z96<!-- Unmatching number of opening, closing tags: -->\n\n''Tom'''s car is bigger than '''''<nowiki/>'''Susan'''s.\n\n67uyx0\n\nag0pjn");
add("selser", "Unclosed and unmatched quotes [2,0,[1],0,[2],0,[3,0],0,0,2,3,4,[2],2,0,3,[2,3,4,0,[4],0],0,3,3,[3,1,0]]", "1xakauy\n\n'''''Bold italic text '''with bold deactivated''' in between.'''''\n\n'''''Bold italic text ''with italic deactivated'' in between.'''''\n\nhzlrck'''Bold text..\n\n'''\n\n'''Bold tag left open\n\n71jxcx\n\nebs4fl\n\nrhouppNormal text.\n\n1u3yozz\n\n<!-- Unmatching number of opening, closing tags: -->44pvot'''This year''''6gfb4w beat '''1cdwta1'''s.\n\n''italic'''s plain");
add("selser", "Unclosed and unmatched quotes [[2],0,4,3,[2],3,3,4,[[2]],0,0,2,3,4,0,0,4,2,[[3,[4]],2,0],3,2]", "9sywqh'''''Bold italic text '''with bold deactivated''' in between.'''''\n\n1127ewx\n\n18snsp4'''Bold text..\n\nkwdyl6\n\n'''cq1retBold tag left open'''\n\n''Italic tag left open\n\n1m173cz\n\n1uh0zvc<!-- Unmatching number of opening, closing tags: -->\n\n1o92frs\n\n111xp9u\n\n'''''15f4vm2'''''jdjuhi'''Susan'''s.\n\nzs90ic\n\nPlain ''italic'''s plain");
add("selser", "Unclosed and unmatched quotes [[[0,4,[4]]],4,[[[3],0,0]],3,4,2,[0,3],0,2,4,1,3,0,3,0,2,[3,2,[4],0,2,0],0,3,0,2]", "'''''Bold italic text '''e4eswx'''rin525'''''\n\nkycm0h\n\n'''''<nowiki/>''with italic deactivated'' in between.'''''\n\n18kp4eq\n\nafllf7\n\n..spanning two paragraphs (should not work).\n\nfbytaq\n\n'''Bold tag left open\n\nclvgvd\n\n''Italic tag left open''\n\nNormal text.<!-- Unmatching number of opening, closing tags: -->\n\n1wljmpn\n\n1yf7po2s election ''n3toxs'' beat 18vtfnx'''last year''''s.\n\n1kriell\n\nPlain ''italic'''s plain");
add("selser", "Unclosed and unmatched quotes [[[1,0,1]],3,[4],2,2,0,0,2,0,0,3,2,0,2,0,0,[[2],0,[3],3,0,4],0,[1,0,0],0,4]", "'''''Bold italic text '''with bold deactivated''' in between.'''''\n\n84mgbb\n\nzmk5su\n\n1prf6rc\n\n'''Bold text..\n\n..spanning two paragraphs (should not work).'''\n\n99j0fi\n\n'''Bold tag left open\n\ntf1r5b\n\nNormal text.\n\nko4tou\n\n<!-- Unmatching number of opening, closing tags: -->\n'''1bryg9wThis year'<nowiki/>'''s election ''<nowiki/>'''''last year'<nowiki/>'''5ugxe0\n\n''Tom'''s car is bigger than '''''<nowiki/>'''Susan'''s.\n\n16lxode");
add("selser", "Unclosed and unmatched quotes [[3],0,[1],0,3,2,1,4,4,4,4,3,[2],0,0,0,3,0,3,2,[4,3,3]]", "\n\n'''''Bold italic text ''with italic deactivated'' in between.'''''\n\n1t7tkil\n\n..spanning two paragraphs (should not work).'''\n\n1a7e2lc\n\ngp94tg\n\nt3eyyv\n\nj7oxi3\n\n1uck7bqNormal text.\n\n<!-- Unmatching number of opening, closing tags: -->\n1iiym73\n\n57eta6");
add("selser", "Unclosed and unmatched quotes [3,0,[2],0,[[2]],3,[3,0],0,4,4,0,0,3,2,0,3,[[4],2,4,0,3,0],2,3,3,[3,3,0]]", "\n1lkzwl3'''''Bold italic text ''with italic deactivated'' in between.'''''\n\n'''185d61gBold text..'''\n\n'''\n\n2zp9tr\n\n1d50xt4\n\n''Italic tag left open\n\n12nm7f\n\n<!-- Unmatching number of opening, closing tags: -->'''1tp4wkd'''163bqnss election um2tlp beat s.\n\nhoh73y\n\ns plain");
add("selser", "Unclosed and unmatched quotes [2,4,3,0,2,0,1,0,[3],0,[2],0,2,0,0,2,[2,2,4,0,1,0],2,4,3,4]", "1i1t83y\n\n'''''Bold italic text '''with bold deactivated''' in between.'''''\n\nmgs28i\n\n1ppsz13\n\n'''Bold text..\n\n..spanning two paragraphs (should not work).'''\n\n16xn80r''Italic tag left open\n\n14qu5k5\n\nNormal text.\n\n<!-- Unmatching number of opening, closing tags: -->y12s55\n\n1npevcq'''This year'<nowiki/>'''1jhux5gs election ky09ea beat '''last year''''s.\n\n1i6z1zp\n\n16e2uso\n\ner47o9");
add("selser", "Unclosed and unmatched quotes [[1],2,4,0,[4],0,[4,0],0,[[2]],3,2,0,2,0,0,2,[0,2,2,0,1,0],0,1,0,2]", "'''''Bold italic text '''with bold deactivated''' in between.'''''\n\nhv4igs\n\n18k1jal\n\nho45in\n\n19jl2b8'''<nowiki/>'''\n\n'''iffcibBold tag left open'''\n\n1cppahe\n\n''Italic tag left open\n\n1qvkr1q\n\nNormal text.\n\n<!-- Unmatching number of opening, closing tags: -->e0uqhq\n\n'''This year'<nowiki/>'''sesl44s election x1edqk''should'' beat '''last year''''s.\n\n''Tom'''s car is bigger than '''''<nowiki/>'''Susan'''s.\n\n1x5ab2x\n\nPlain ''italic'''s plain");
add("selser", "A table with captions with non-default spaced attributes and a table row [[3,2,3,[4],4,[2,4]]]", "{|<!--hspjc0-->\n|+style=\"color: red;\"|caption2\n|+ style=\"color: red;\"|cbsbv4<!--18yhrc2--><!--uk5rai-->\n|-\n|foo<!--1xdk3og-->\n|}");
add("selser", "A table with captions with non-default spaced attributes and a table row [[0,2,4,0,3,[4,0]]]", "{|\n<!--gn6w81-->|+style=\"color: red;\"|caption2<!--isdju7-->\n|+ style=\"color: red;\"|caption3<!--ogw8tz-->\n|}");
add("selser", "A table with captions with non-default spaced attributes and a table row [[2,0,2,3,3,3]]", "{|<!--ccnxjg-->\n|+style=\"color: red;\"|caption2<!--3gt3mj-->\n|}");
add("selser", "A table with captions with non-default spaced attributes and a table row [2]", "1c9grfl\n{|\n|+style=\"color: red;\"|caption2\n|+ style=\"color: red;\"|caption3\n|-\n|foo\n|}");
add("selser", "A table with captions with non-default spaced attributes and a table row [[4,[3],2,0,3,[[3,4],4]]]", "{|<!--wrcota-->\n|+style=\"color: red;\"|<!--i5iaap-->\n|+ style=\"color: red;\"|caption3\n|-\n|1qgj03j<!--1mzit1t-->\n|}");
add("selser", "A table with captions with non-default spaced attributes and a table row [[2,2,0,4,2,[0,4]]]", "{|<!--yyyv97-->\n<!--1fesh1v-->|+style=\"color: red;\"|caption2\n<!--15d1qjf--><!--muo5ac-->\n|-\n|foo<!--1eapk56-->\n|}");
add("selser", "A table with captions with non-default spaced attributes and a table row [[0,[2],0,0,0,[[0,2],0]]]", "{|\n|+style=\"color: red;\"|1iu6jlncaption2\n|+ style=\"color: red;\"|caption3\n|-\n|1pyfbkm\n|foo\n|}");
add("selser", "A table with captions with non-default spaced attributes and a table row [[2,0,3,[2],0,[2,0]]]", "{|<!--h7ysdr-->\n|+style=\"color: red;\"|caption2\n|+ style=\"color: red;\"|164mjh9caption3\n<!--1f50l6s-->|-\n|foo\n|}");
add("selser", "A table with captions with non-default spaced attributes and a table row [1]", "{| data-foobar=\"1bvlgsc\"\n|+style=\"color: red;\"|caption2\n|+ style=\"color: red;\"|caption3\n|-\n|foo\n|}");
add("selser", "A table with captions with non-default spaced attributes and a table row [[0,[2],0,2,3,[[2,0],0]]]", "{|\n|+style=\"color: red;\"|1rn3ocecaption2\n<!--1jl20xm-->|+ style=\"color: red;\"|caption3\n|-\n|zwy3vy\n|foo\n|}");
add("selser", "A table with captions with non-default spaced attributes and a table row [[3,4,3,0,0,1]]", "{|<!--1tq0bmd-->\n|+ style=\"color: red;\"|caption3\n|-\n|foo\n|}");
add("selser", "A table with captions with non-default spaced attributes and a table row [[2,3,0,[3],2,[[2,[3]],2]]]", "{|<!--1gvmoqz-->\n\n|+ style=\"color: red;\"|<!--190xj98-->\n|-\n|1qozus\n|<!--16h9zo0-->\n|}");
add("selser", "A table with captions with non-default spaced attributes and a table row [[0,0,0,1,4,3]]", "{|\n|+style=\"color: red;\"|caption2\n|+ style=\"color: red;\" data-foobar=\"96108f\" |caption3<!--hig06k-->\n|}");
add("selser", "A table with captions with non-default spaced attributes and a table row [[0,0,2,[3],3,[[0,4],0]]]", "{|\n|+style=\"color: red;\"|caption2<!--8c8urw-->\n|+ style=\"color: red;\" |\n|-\n|19jkrlo\n|}");
add("selser", "Table td-cell syntax variations [2]", "1jwii2y\n{|\n|foo bar foo|baz\n|foo bar foo||baz\n|style='color:red;'|baz\n|style='color:red;'||baz\n|}");
add("selser", "Table td-cell syntax variations [[4,[1,4]]]", "{|<!--4cgz4o-->\n|foo bar foo|baz\n|foo bar foo||baz\n|style='color:red;'|baz\n|style='color:red;'||baz<!--12mt387-->\n|}");
add("selser", "Table td-cell syntax variations [1]", "{| data-foobar=\"1iarw18\"\n|foo bar foo|baz\n|foo bar foo||baz\n|style='color:red;'|baz\n|style='color:red;'||baz\n|}");
add("selser", "Table td-cell syntax variations [[3,[2,0]]]", "{|<!--kjgs8a-->\n|foo bar foo|baz\n|foo bar foo||baz\n|style='color:red;'|baz\n|style='color:red;'||baz\n|}");
add("selser", "Table td-cell syntax variations [[4,[[2,0,2,[3],4,0,3,[3],1],2]]]", "{|<!--19byc9i-->\n|1rdjmx5\n|foo bar foo|baz\n|15gm5vi\n|foo bar foo||\n|1k8mu2s\n|style='color:red;'|baz\n| || data-foobar=\"15blb6e\" |baz<!--srur4b-->\n|}");
add("selser", "Table td-cell syntax variations [[0,[[4,0,0,1,0,0,0,4,4],0]]]", "{|\n|136i03d\n|foo bar foo|| data-foobar=\"1p5zg05\" |baz\n|style='color:red;'|baz\n|dnhd2o\n|szjqq8\n|}");
add("selser", "Table td-cell syntax variations [[0,[1,4]]]", "{|\n|foo bar foo|baz\n|foo bar foo||baz\n|style='color:red;'|baz\n|style='color:red;'||baz<!--1mu375u-->\n|}");
add("selser", "Table td-cell syntax variations [[0,[[1,4,0,2,2,0,4,0,0],3]]]", "{|\n| data-foobar=\"1vo6ycz\" foo bar |baz\n|19o3nfe\n|foo bar foo\n|7m6oo8||baz\n|18jq9io\n|style='color:red;'|baz\n|57uz8w\n|style='color:red;'||baz\n|}");
add("selser", "Table td-cell syntax variations [[0,2]]", "{|\n<!--1o8bwee-->|foo bar foo|baz\n|foo bar foo||baz\n|style='color:red;'|baz\n|style='color:red;'||baz\n|}");
add("selser", "Accept \"| !\" at start of line in tables (ignore !-attribute) [[4,1]]", "{|<!--iahavp-->\n|-\n|!style=\"color:red\"|bar\n|}");
add("selser", "Accept \"| !\" at start of line in tables (ignore !-attribute) [2]", "194wm64\n{|\n|-\n|!style=\"color:red\"|bar\n|}");
add("selser", "Accept \"| !\" at start of line in tables (ignore !-attribute) [[0,[1,4]]]", "{|\n|- data-foobar=\"1onas0u\"\n|!style=\"color:red\"|bar<!--lnxjat-->\n|}");
add("selser", "Accept \"| !\" at start of line in tables (ignore !-attribute) [1]", "{| data-foobar=\"1esn062\"\n|-\n|!style=\"color:red\"|bar\n|}");
add("selser", "Accept \"| !\" at start of line in tables (ignore !-attribute) [[0,[1,0]]]", "{|\n|- data-foobar=\"1djv4wn\"\n|!style=\"color:red\"|bar\n|}");
add("selser", "Accept \"| !\" at start of line in tables (ignore !-attribute) [[0,1]]", "{|\n|-\n|!style=\"color:red\"|bar\n|}");
add("selser", "Accept \"| !\" at start of line in tables (ignore !-attribute) [[0,[2,0]]]", "{|\n<!--1s7gz3l-->|-\n|!style=\"color:red\"|bar\n|}");
add("selser", "Accept \"| !\" at start of line in tables (ignore !-attribute) [[2,2]]", "{|<!--1s8mzg5-->\n<!--1rradqq-->|-\n|!style=\"color:red\"|bar\n|}");
add("selser", "Accept \"| !\" at start of line in tables (ignore !-attribute) [[4,[2,4]]]", "{|<!--1m6dz8p--><!--1q6udai-->\n|-\n|!style=\"color:red\"|bar<!--6x372r-->\n|}");
add("selser", "Accept \"| !\" at start of line in tables (ignore !-attribute) [[0,2]]", "{|\n<!--329kt4-->|-\n|!style=\"color:red\"|bar\n|}");
add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[4,[[0,0,4,3],4,[2,4,[2],[3],2,[3],[2],1],3,4,0]]]", "{|<!--thv0ap-->\n|-\n|style='color:red;'|+1\n|je9a5x<!--159s14c-->\n|-\n|1es89nf\n|lrqhh8||1vdyqyt2||\n|kmqcrp\n| ||13gkdkf+2|| data-foobar=\"zh3ts2\" |-3<!--1ojj34v-->\n|}");
add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [1]", "{| data-foobar=\"1gl68m8\"\n|-\n|style='color:red;'|+1\n|style='color:blue;'|-1\n|-\n|1||2||3\n|1||+2||-3\n|-\n| +1\n| -1\n|}");
add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [2]", "1e44vh7\n{|\n|-\n|style='color:red;'|+1\n|style='color:blue;'|-1\n|-\n|1||2||3\n|1||+2||-3\n|-\n| +1\n| -1\n|}");
add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[2,1]]", "{|<!--6sqzz-->\n|-\n| style=\"color:red;\" |+1\n| style=\"color:blue;\" |-1\n|-\n|1||2||3\n|1||+2||-3\n|-\n| +1\n| -1\n|}");
add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[0,[3,2,3,4,[4,2,4,1],3]]]", "{|\n<!--1bp045y-->\n<!--dhmabe-->|-\n|c2jpvx\n|yz5svz\n| +1\n|qfcae5\n| data-foobar=\"17jwauo\" | -1\n|}");
add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[0,1]]", "{|\n|-\n|style='color:red;'|+1\n|style='color:blue;'|-1\n|-\n|1||2||3\n|1||+2||-3\n|-\n| +1\n| -1\n|}");
add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[2,[[0,4,0,[4]],0,1,2,[0,2,4,[2]],0]]]", "{|<!--sv27jr-->\n|-\n|a8wi7q\n| style=\"color:blue;\" |1f9m22c\n|- data-foobar=\"3r29hf\"\n|1||2||3\n|1||+2||-3<!--dl3rx6-->\n|-\n|5d67fn\n| +1\n|htjcvv\n| 1aet3tv-1\n|}");
add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[0,2]]", "{|\n<!--1uamx13-->|-\n|style='color:red;'|+1\n|style='color:blue;'|-1\n|-\n|1||2||3\n|1||+2||-3\n|-\n| +1\n| -1\n|}");
add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[0,[3,2,[4,4,3,2,0,1,0,2],3,[4,0,4,0],0]]]", "{|\n<!--z5s6v3-->\n|-\n|16z60jx\n|x9ppxd\n|r51bry||3\n| data-foobar=\"1kz8mk6\" |1||+2\n|p5fw51||-3\n|-\n|1t94ye7\n| +1\n|125d88b\n| -1\n|}");
add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[3,[[3,1,0,[4]],3,4,2,[0,4,0,0],4]]]", "{|\n|-\n| style=\"color:red;\" data-foobar=\"p348lc\" |+1\n|style='color:blue;'|k4tdu0<!--1tg046q--><!--pt1fz0-->\n|-\n|hdvifu\n| -1<!--1fwsrhn-->\n|}");
add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[0,[[3,2,0,0],0,[2,0,1,[2],0,0,0,2],0,[0,[4],0,0],0]]]", "{|\n|-\n|miw69\n|style='color:red;'|+1\n|style='color:blue;'|-1\n|-\n|1l3081g\n|1|| data-foobar=\"4dp8jk\" |2||17cpoo03\n|1||+2\n|xy04h0||-3\n|-\n| 14bux0j\n| -1\n|}");
add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[2,[3,0,3,2,1,2]]]", "{|<!--luoz8q-->\n\n<!--140yw2k-->\n|- data-foobar=\"1s9g24y\"\n| +1\n| -1<!--gfnli5-->\n|}");
add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[2,[[3,[2],4,3],2,[4,2,0,0,2,3,4,2],0,2,0]]]", "{|<!--nyeajy-->\n|-\n| style=\"color:red;\" |1e1o29t+1\n|1bf63c3<!--5y6n0p-->\n|-\n|s8pkt\n|173pq5u\n|1||2||3\n|gncoa2\n|3ehrw7\n|12uqmez||-3\n<!--vh24zw-->|-\n| +1\n| -1\n|}");
add("selser", "Table rowspan [[3,2]]", "{| border=1<!--renghc-->\n|Cell 1, row 1\n|rowspan=2|Cell 2, row 1 (and 2)\n|Cell 3, row 1\n|-\n|Cell 1, row 2\n|Cell 3, row 2\n|}");
add("selser", "Table rowspan [[0,1]]", "{| border=1\n|Cell 1, row 1\n|rowspan=2|Cell 2, row 1 (and 2)\n|Cell 3, row 1\n|-\n|Cell 1, row 2\n|Cell 3, row 2\n|}");
add("selser", "Table rowspan [[2,[[2,0,3,0,4],0,[0,0,0,3],2]]]", "{| border=1<!--ydg6ad-->\n|8xt6hw\n|Cell 1, row 1\n|1hnzall\n|-\n|Cell 1, row 2\n<!--g8lme3-->\n|}");
add("selser", "Table rowspan [2]", "1tpwepb\n{| border=1\n|Cell 1, row 1\n|rowspan=2|Cell 2, row 1 (and 2)\n|Cell 3, row 1\n|-\n|Cell 1, row 2\n|Cell 3, row 2\n|}");
add("selser", "Table rowspan [1]", "{| border=\"1\" data-foobar=\"1u0zsbm\"\n|Cell 1, row 1\n|rowspan=2|Cell 2, row 1 (and 2)\n|Cell 3, row 1\n|-\n|Cell 1, row 2\n|Cell 3, row 2\n|}");
add("selser", "Table rowspan [[0,[1,0,2,0]]]", "{| border=1\n|Cell 1, row 1\n|rowspan=2|Cell 2, row 1 (and 2)\n|Cell 3, row 1\n<!--t7525d-->|-\n|Cell 1, row 2\n|Cell 3, row 2\n|}");
add("selser", "Table rowspan [[3,4]]", "{| border=1<!--8klp1m-->\n|}");
add("selser", "Table rowspan [[2,2]]", "{| border=1<!--o6xkyn-->\n<!--185kocl-->|Cell 1, row 1\n|rowspan=2|Cell 2, row 1 (and 2)\n|Cell 3, row 1\n|-\n|Cell 1, row 2\n|Cell 3, row 2\n|}");
add("selser", "Table rowspan [[3,3]]", "{| border=1\n|}");
add("selser", "Table rowspan [[0,[1,0,2,2]]]", "{| border=1\n|Cell 1, row 1\n|rowspan=2|Cell 2, row 1 (and 2)\n|Cell 3, row 1\n<!--tpnv4l-->|-\n|Cell 1, row 2\n|Cell 3, row 2<!--ywjyk7-->\n|}");
add("selser", "Table rowspan [[3,[1,0,[0,2,0,4],2]]]", "{| border=1\n|Cell 1, row 1\n|rowspan=2|Cell 2, row 1 (and 2)\n|Cell 3, row 1\n|-\n|x54ea5\n|Cell 1, row 2\n|nif00j<!--camaa6-->\n|}");
add("selser", "Table rowspan [[0,[[4,0,4,0,1],0,1,2]]]", "{| border=1\n|laz5jy\n|e00dac\n| data-foobar=\"1lnc803\" |Cell 3, row 1\n|- data-foobar=\"3dh7h3\"\n|Cell 1, row 2\n|Cell 3, row 2<!--1k13wan-->\n|}");
add("selser", "Table rowspan [[0,3]]", "{| border=1\n|}");
add("selser", "Table rowspan [[0,4]]", "{| border=1\n<!--2w2uxw-->|}");
add("selser", "Table rowspan [[4,1]]", "{| border=1<!--qh3w0u-->\n|Cell 1, row 1\n|rowspan=2|Cell 2, row 1 (and 2)\n|Cell 3, row 1\n|-\n|Cell 1, row 2\n|Cell 3, row 2\n|}");
add("selser", "Table rowspan [[0,[2,0,4,0]]]", "{| border=1\n<!--nmk7t4-->|Cell 1, row 1\n|rowspan=2|Cell 2, row 1 (and 2)\n|Cell 3, row 1\n<!--zfwgha-->\n|}");
add("selser", "Table rowspan [[2,1]]", "{| border=1<!--14qbjv1-->\n|Cell 1, row 1\n| rowspan=\"2\" |Cell 2, row 1 (and 2)\n|Cell 3, row 1\n|-\n|Cell 1, row 2\n|Cell 3, row 2\n|}");
add("selser", "Table rowspan [[3,[1,0,[0,1,0,2],4]]]", "{| border=1\n|Cell 1, row 1\n|rowspan=2|Cell 2, row 1 (and 2)\n|Cell 3, row 1\n|-\n| data-foobar=\"xi77y6\" |Cell 1, row 2\n|wc2ose\n|Cell 3, row 2<!--14jwgmk-->\n|}");
add("selser", "Nested table [[0,[1,4]]]", "{| border=1\n| &alpha;\n|\n{| bgcolor=#ABCDEF border=2\n|nested\n|-\n|table\n|}\n|the original table again<!--1lj2axn-->\n|}");
add("selser", "Nested table [[0,2]]", "{| border=1\n<!--4a15up-->| &alpha;\n|\n{| bgcolor=#ABCDEF border=2\n|nested\n|-\n|table\n|}\n|the original table again\n|}");
add("selser", "Nested table [2]", "1v9epga\n{| border=1\n| &alpha;\n|\n{| bgcolor=#ABCDEF border=2\n|nested\n|-\n|table\n|}\n|the original table again\n|}");
add("selser", "Nested table [[0,3]]", "{| border=1\n|}");
add("selser", "Nested table [[2,[4,2]]]", "{| border=1<!--q9xsl-->\n<!--qrxi94--><!--r50nmy-->\n|}");
add("selser", "Nested table [[2,3]]", "{| border=1<!--oxuram-->\n|}");
add("selser", "Nested table [[4,1]]", "{| border=1<!--415rzt-->\n| &alpha;\n|\n{| bgcolor=#ABCDEF border=2\n|nested\n|-\n|table\n|}\n|the original table again\n|}");
add("selser", "Nested table [1]", "{| border=\"1\" data-foobar=\"1x647n6\"\n| &alpha;\n|\n{| bgcolor=#ABCDEF border=2\n|nested\n|-\n|table\n|}\n|the original table again\n|}");
add("selser", "Nested table [[3,2]]", "{| border=1<!--a6wva0-->\n| &alpha;\n|\n{| bgcolor=#ABCDEF border=2\n|nested\n|-\n|table\n|}\n|the original table again\n|}");
add("selser", "Nested table [[2,1]]", "{| border=1<!--6890pa-->\n|&alpha;\n|\n{| bgcolor=\"#ABCDEF\" border=\"2\"\n|nested\n|-\n|table\n|}\n|the original table again\n|}");
add("selser", "Nested table [[3,[3,0]]]", "{| border=1\n|}");
add("selser", "Nested table [[0,[[0,4,[4,1],2,2],0]]]", "{| border=1\n| &alpha;\n|1aokhi5\n|14zv42q\n{| bgcolor=\"#ABCDEF\" border=\"2\" data-foobar=\"p6svuj\"\n|nested\n|-\n|table\n|}\n|yd3jrc\n|kfkyff\n|the original table again\n|}");
add("selser", "Nested table [[3,[1,4]]]", "{| border=1\n| &alpha;\n|\n{| bgcolor=#ABCDEF border=2\n|nested\n|-\n|table\n|}\n|the original table again<!--1ug56z6-->\n|}");
add("selser", "Nested table [[0,4]]", "{| border=1\n<!--3j9op3-->|}");
add("selser", "Nested table [[0,[[1,2,[3,4],0,4],2]]]", "{| border=1\n| data-foobar=\"1j0u5p5\" | &alpha;\n|yn4ogm\n|1auu2z2\n|1wca08l<!--1g3cfq9-->\n|}");
add("selser", "Nested table [[0,[1,2]]]", "{| border=1\n| &alpha;\n|\n{| bgcolor=#ABCDEF border=2\n|nested\n|-\n|table\n|}\n|the original table again<!--99zni7-->\n|}");
add("selser", "Nested table [[0,1]]", "{| border=1\n| &alpha;\n|\n{| bgcolor=#ABCDEF border=2\n|nested\n|-\n|table\n|}\n|the original table again\n|}");
add("selser", "Nested table [[0,[[2,0,[4,[0,[0,0,[0,3],2]]],0,0],4]]]", "{| border=1\n|4n52hy\n| &alpha;\n|1pd7ii1\n{| bgcolor=#ABCDEF border=2\n|nested\n|-\n<!--56kp43-->\n|}\n|the original table again<!--14gs8h-->\n|}");
add("selser", "Invalid attributes in table cell (T3830) [[4,2]]", "{|<!--notxkw--><!--s750wu-->\n|Cell:|broken\n|}");
add("selser", "Invalid attributes in table cell (T3830) [2]", "1i126sf\n{|\n|Cell:|broken\n|}");
add("selser", "Invalid attributes in table cell (T3830) [1]", "{| data-foobar=\"1yw7tah\"\n|Cell:|broken\n|}");
add("selser", "Invalid attributes in table cell (T3830) [[0,2]]", "{|\n<!--ray8td-->|Cell:|broken\n|}");
add("selser", "Invalid attributes in table cell (T3830) [[3,[2,3]]]", "{|<!--96g5z4-->\n|Cell:|broken\n|}");
add("selser", "Invalid attributes in table cell (T3830) [[0,[[[3]],4]]]", "{|\n|Cell:|<!--14x9lr4-->\n|}");
add("selser", "Invalid attributes in table cell (T3830) [[0,[1,4]]]", "{|\n|Cell:|broken<!--g4popb-->\n|}");
add("selser", "Invalid attributes in table cell (T3830) [[3,2]]", "{|<!--ep030l-->\n|Cell:|broken\n|}");
add("selser", "Table cell attributes: Pipes protected by nowikis should be treated as a plain character [2]", "11csz3v\n{|\n|title=\"foo\" |bar\n|title=\"foo<nowiki>|</nowiki>\" |bar\n|title=\"foo<nowiki>|</nowiki>\" bar\n|}");
add("selser", "Table cell attributes: Pipes protected by nowikis should be treated as a plain character [[0,[[1,0,[3],2,[0,[2],0]],0]]]", "{|\n| title=\"foo\" data-foobar=\"17c5azj\" |bar\n|title=\"foo<nowiki>|</nowiki>\" |\n|juzvv7\n|title=\"foo<nowiki>6cfczq|</nowiki>\" bar\n|}");
add("selser", "Table cell attributes: Pipes protected by nowikis should be treated as a plain character [[3,2]]", "{|<!--w315on-->\n|title=\"foo\" |bar\n|title=\"foo<nowiki>|</nowiki>\" |bar\n|title=\"foo<nowiki>|</nowiki>\" bar\n|}");
add("selser", "Table cell attributes: Pipes protected by nowikis should be treated as a plain character [1]", "{| data-foobar=\"1vn9sfk\"\n|title=\"foo\" |bar\n|title=\"foo<nowiki>|</nowiki>\" |bar\n|title=\"foo<nowiki>|</nowiki>\" bar\n|}");
add("selser", "Table cell attributes: Pipes protected by nowikis should be treated as a plain character [[0,2]]", "{|\n<!--xljuq-->|title=\"foo\" |bar\n|title=\"foo<nowiki>|</nowiki>\" |bar\n|title=\"foo<nowiki>|</nowiki>\" bar\n|}");
add("selser", "Table cell attributes: Pipes protected by nowikis should be treated as a plain character [[0,1]]", "{|\n|title=\"foo\" |bar\n|title=\"foo<nowiki>|</nowiki>\" |bar\n|title=\"foo<nowiki>|</nowiki>\" bar\n|}");
add("selser", "Table cell attributes: Pipes protected by nowikis should be treated as a plain character [[4,[[1,0,0,0,2],4]]]", "{|<!--10ovcu9-->\n| title=\"foo\" data-foobar=\"13jkt55\" |bar\n|title=\"foo<nowiki>|</nowiki>\" |bar\n|qhkatl\n|title=\"foo<nowiki>|</nowiki>\" bar<!--17s3p99-->\n|}");
add("selser", "Table cell attributes: Pipes protected by nowikis should be treated as a plain character [[3,[[1,0,2,4,[0,0,4]],4]]]", "{|\n| title=\"foo\" data-foobar=\"g9dptn\" |bar\n|binmoh\n|title=\"foo<nowiki>|</nowiki>\" |bar\n|1x3grsj\n|title=\"foo<nowiki>|</nowiki>14n2z9r<!--6ncssu-->\n|}");
add("selser", "Table cell attributes: Pipes protected by nowikis should be treated as a plain character [[0,[[4,0,[2],3,2],0]]]", "{|\n|112jznj\n|title=\"foo<nowiki>|</nowiki>\" |1avq90lbar\n|1brje4y\n|title=\"foo<nowiki>|</nowiki>\" bar\n|}");
add("selser", "Table cell attributes: Pipes protected by nowikis should be treated as a plain character [[3,[[[2],4,[3],3,1],0]]]", "{|\n|title=\"foo\" |1ks7hu2bar\n|6n8px6\n| title=\"foo<nowiki>|</nowiki>\" |\n| data-foobar=\"18ta8cl\" |title=\"foo<nowiki>|</nowiki>\" bar\n|}");
add("selser", "Element attributes with double ! should not be broken up by <th> [[3,[[[0,4,0]],0]]]", "{|\n!hi \nrgsfem\n ho\n|}");
add("selser", "Invalid text in table attributes should be preserved by selective serializer [[3,[[[2],2,[2]],4]]]", "{| <span>boo</span> style='border:1px solid black'\n| <span>boo</span> style='color:blue' | erkdht1\n|1pjart5\n| style=\"color:blue\" boo | 12g0bj42<!--10bq6ao-->\n|}");
add("selser", "Invalid text in table attributes should be preserved by selective serializer [[0,4]]", "{| <span>boo</span> style='border:1px solid black'\n<!--qbah7k-->|}");
add("selser", "Invalid text in table attributes should be preserved by selective serializer [1]", "{| style=\"border:1px solid black\" data-foobar=\"12li3bp\" boo\n| <span>boo</span> style='color:blue' | 1\n|<span>boo</span> style='color:blue'| 2\n|}");
add("selser", "Invalid text in table attributes should be preserved by selective serializer [[2,3]]", "{| <span>boo</span> style='border:1px solid black'<!--f5mmfl-->\n|}");
add("selser", "Invalid text in table attributes should be preserved by selective serializer [[4,[[1,0,[3]],2]]]", "{| <span>boo</span> style='border:1px solid black'<!--hj82pd-->\n| style=\"color:blue\" data-foobar=\"1tzva8q\" boo | 1\n|<span>boo</span> style='color:blue'| <!--1cqigek-->\n|}");
add("selser", "Invalid text in table attributes should be preserved by selective serializer [[2,[3,0]]]", "{| <span>boo</span> style='border:1px solid black'<!--y1gy1a-->\n\n|}");
add("selser", "Invalid text in table attributes should be preserved by selective serializer [[0,[1,0]]]", "{| <span>boo</span> style='border:1px solid black'\n| <span>boo</span> style='color:blue' | 1\n|<span>boo</span> style='color:blue'| 2\n|}");
add("selser", "Invalid text in table attributes should be preserved by selective serializer [[0,1]]", "{| <span>boo</span> style='border:1px solid black'\n| <span>boo</span> style='color:blue' | 1\n|<span>boo</span> style='color:blue'| 2\n|}");
add("selser", "Invalid text in table attributes should be preserved by selective serializer [2]", "1q63vep\n{| <span>boo</span> style='border:1px solid black'\n| <span>boo</span> style='color:blue' | 1\n|<span>boo</span> style='color:blue'| 2\n|}");
add("selser", "Invalid text in table attributes should be preserved by selective serializer [[2,[[3,0,2],0]]]", "{| <span>boo</span> style='border:1px solid black'<!--13g6mx9-->\n|12327is\n| style=\"color:blue\" boo | 2\n|}");
add("selser", "Invalid text in table attributes should be preserved by selective serializer [[0,3]]", "{| <span>boo</span> style='border:1px solid black'\n|}");
add("selser", "Invalid text in table attributes should be preserved by selective serializer [[4,4]]", "{| <span>boo</span> style='border:1px solid black'<!--113xtzc--><!--1nrttpq-->\n|}");
add("selser", "Invalid text in table attributes should be preserved by selective serializer [[4,3]]", "{| <span>boo</span> style='border:1px solid black'<!--104u18f-->\n|}");
add("selser", "Invalid text in table attributes should be preserved by selective serializer [[0,[1,4]]]", "{| <span>boo</span> style='border:1px solid black'\n| <span>boo</span> style='color:blue' | 1\n|<span>boo</span> style='color:blue'| 2<!--6yyxor-->\n|}");
add("selser", "Invalid text in table attributes should be preserved by selective serializer [[0,2]]", "{| <span>boo</span> style='border:1px solid black'\n<!--b2ndhe-->| <span>boo</span> style='color:blue' | 1\n|<span>boo</span> style='color:blue'| 2\n|}");
add("selser", "Invalid text in table attributes should be preserved by selective serializer [[0,[2,0]]]", "{| <span>boo</span> style='border:1px solid black'\n<!--1g1y7cp-->| <span>boo</span> style='color:blue' | 1\n|<span>boo</span> style='color:blue'| 2\n|}");
add("selser", "Invalid text in table attributes should be preserved by selective serializer [[3,4]]", "{| <span>boo</span> style='border:1px solid black'<!--1afrey0-->\n|}");
add("selser", "Invalid text in table attributes should be preserved by selective serializer [[0,[[3,0,0],0]]]", "{| <span>boo</span> style='border:1px solid black'\n\n|<span>boo</span> style='color:blue'| 2\n|}");
add("selser", "Build table with {{!}} [2]", "1qdcx7i\n{{{!}} class=\"wikitable\"\n!header\n!second header\n{{!}}- style=\"color:red;\"\n{{!}}data{{!}}{{!}} style=\"color:red;\" {{!}}second data\n{{!}}}");
add("selser", "Build table with {{!}} [1]", "{{{!}} class=\"wikitable\" data-foobar=\"19t9aza\"\n!header\n!second header\n{{!}}- style=\"color:red;\"\n{{!}}data{{!}}{{!}} style=\"color:red;\" {{!}}second data\n{{!}}}");
add("selser", "Build table with {{!}} [[0,2]]", "{{{!}} class=\"wikitable\"\n<!--xj13jp-->!header\n!second header\n{{!}}- style=\"color:red;\"\n{{!}}data{{!}}{{!}} style=\"color:red;\" {{!}}second data\n{{!}}}");
add("selser", "Build table with {{!}} [[4,[4,0,2,0]]]", "{{{!}} class=\"wikitable\"<!--10ycvqs--><!--9gia5n-->\n<!--1giwdnr-->{{!}}- style=\"color:red;\"\n{{!}}data{{!}}{{!}} style=\"color:red;\" {{!}}second data\n{{!}}}");
add("selser", "Build table with {{!}} [[4,2]]", "{{{!}} class=\"wikitable\"<!--1rp4y4q--><!--hcbeb0-->\n!header\n!second header\n{{!}}- style=\"color:red;\"\n{{!}}data{{!}}{{!}} style=\"color:red;\" {{!}}second data\n{{!}}}");
add("selser", "Build table with {{!}} [[2,2]]", "{{{!}} class=\"wikitable\"<!--y650rv-->\n<!--1uosyvo-->!header\n!second header\n{{!}}- style=\"color:red;\"\n{{!}}data{{!}}{{!}} style=\"color:red;\" {{!}}second data\n{{!}}}");
add("selser", "Build table with {{!}} [[4,1]]", "{{{!}} class=\"wikitable\"<!--1fkinqk-->\n!header\n!second header\n{{!}}- style=\"color:red;\"\n{{!}}data{{!}}{{!}} style=\"color:red;\" {{!}}second data\n{{!}}}");
add("selser", "Build table with {{!}} [[3,1]]", "{{{!}} class=\"wikitable\"\n!header\n!second header\n{{!}}- style=\"color:red;\"\n{{!}}data{{!}}{{!}} style=\"color:red;\" {{!}}second data\n{{!}}}");
add("selser", "Build table with pipe as data [[4,[[[3],4,[2]],4,1,3,1,0,[2,[3],0],3]]]", "{| class=\"wikitable\"<!--xg0u8a-->\n!\n!d7701x\n!1tbn79zsecond header<!--1m7bm59-->\n|- style=\"color:red;\" data-foobar=\"r8fxpk\"\n|data|| style=\"color:red;\" |second data\n|- data-foobar=\"uclhfr\"\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n|5k1hnz\n|| |||second data with |\n|}");
add("selser", "Build table with pipe as data [[4,2]]", "{| class=\"wikitable\"<!--scocw0--><!--1pczk3f-->\n!header\n!second header\n|- style=\"color:red;\"\n|data|| style=\"color:red;\" |second data\n|-\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n||data with | |||second data with |\n|}");
add("selser", "Build table with pipe as data [[3,2]]", "{| class=\"wikitable\"<!--vu7fc-->\n!header\n!second header\n|- style=\"color:red;\"\n|data|| style=\"color:red;\" |second data\n|-\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n||data with | |||second data with |\n|}");
add("selser", "Build table with pipe as data [2]", "16o0w77\n{| class=\"wikitable\"\n!header\n!second header\n|- style=\"color:red;\"\n|data|| style=\"color:red;\" |second data\n|-\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n||data with | |||second data with |\n|}");
add("selser", "Build table with pipe as data [1]", "{| class=\"wikitable\" data-foobar=\"160k0or\"\n!header\n!second header\n|- style=\"color:red;\"\n|data|| style=\"color:red;\" |second data\n|-\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n||data with | |||second data with |\n|}");
add("selser", "Build table with pipe as data [[4,[[[4],3,2],2,[0,[3],3],0,[0,1,[2]],4,2,0]]]", "{| class=\"wikitable\"<!--ijw0rv-->\n!s1bdux\n!1d2jp94\n!second header<!--1u387xw-->\n|- style=\"color:red;\"\n|\n|-\n| style=\"color:red;\" data-foobar=\"werz9z\" |<nowiki>data with |</nowiki> || style=\"color:red;\" | 1yfsrz1second data with |<!--bcsnts--><!--1aq02o8-->\n|-\n||data with | |||second data with |\n|}");
add("selser", "Build table with pipe as data [[2,1]]", "{| class=\"wikitable\"<!--44tc8a-->\n!header\n!second header\n|- style=\"color:red;\"\n|data|| style=\"color:red;\" |second data\n|-\n| style=\"color:red;\" |<nowiki>data with |</nowiki> || style=\"color:red;\" | second data with |\n|-\n||<nowiki>data with |</nowiki> |||second data with |\n|}");
add("selser", "Build table with pipe as data [[4,[2,0,4,0,4,0,[0,[4],4],4]]]", "{| class=\"wikitable\"<!--1spe0md--><!--woshny-->\n!header\n!second header\n<!--zpcp2-->\n<!--ti0z2p-->\n|-\n||1vrbapm \n|1whjuqk<!--ja5l6j-->\n|}");
add("selser", "Build table with pipe as data [[0,1]]", "{| class=\"wikitable\"\n!header\n!second header\n|- style=\"color:red;\"\n|data|| style=\"color:red;\" |second data\n|-\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n||data with | |||second data with |\n|}");
add("selser", "Build table with pipe as data [[3,[1,0,3,0,1,0,[3,3,3],3]]]", "{| class=\"wikitable\"\n!header\n!second header\n\n|- data-foobar=\"1eivn9x\"\n| style=\"color:red;\" |<nowiki>data with |</nowiki> || style=\"color:red;\" | second data with |\n|-\n|}");
add("selser", "Build table with pipe as data [[2,[[0,0,[3]],2,2,0,[3,[2],[2]],4,2,3]]]", "{| class=\"wikitable\"<!--z94wcg-->\n!header\n!<!--8mmnby-->\n<!--1pd3df2-->|- style=\"color:red;\"\n|data|| style=\"color:red;\" |second data\n|-\n| style=\"color:red;\" |<nowiki>20jas6data with |</nowiki> || style=\"color:red;\" | 64yvosecond data with |<!--j7r3on--><!--k4pr3o-->\n|-\n||<nowiki>data with |</nowiki> |||second data with |\n|}");
add("selser", "Build table with pipe as data [[0,[[3,0,4],0,[3,2,4],0,0,3,[3,3,4],0]]]", "{| class=\"wikitable\"\n|gbqns6\n|- style=\"color:red;\"\n|1yui9cn\n|data\n|qqjnv4\n|-\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n|16m5q2m\n|}");
add("selser", "Build table with pipe as data [[2,2]]", "{| class=\"wikitable\"<!--zawjqo-->\n<!--1on9zub-->!header\n!second header\n|- style=\"color:red;\"\n|data|| style=\"color:red;\" |second data\n|-\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n||data with | |||second data with |\n|}");
add("selser", "Build table with pipe as data [[3,[3,2,[0,[3],[3]],2,[2,3,1],0,4,0]]]", "{| class=\"wikitable\"<!--4cox6k-->\n|- style=\"color:red;\"\n| || style=\"color:red;\" |<!--l4r1o3-->\n|-\n|1huv435\n| style=\"color:red;\" data-foobar=\"uevssc\" | <nowiki>second data with |</nowiki>\n<!--q9kda-->\n|}");
add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [[3,[[3,1,[2],0],0]]]", "{|\n! data-foobar=\"qjh2wc\" |bar\n<!-- foo --> ||hgce9qbaz||quux\n|}");
add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [[0,[[4,[4,0],1,4],0]]]", "{|\n!jmy11b||17f73xv<!-- foo --> \n| data-foobar=\"nedggi\"|baz\n|nkvny7\n|}");
add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [1]", "{| data-foobar=\"1iuvx2g\"\n!foo||bar\n<!-- foo --> ||baz||quux\n|}");
add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [[3,2]]", "{|<!--pbb7f5-->\n!foo||bar\n<!-- foo --> ||baz||quux\n|}");
add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [[0,1]]", "{|\n!foo||bar\n<!-- foo --> ||baz||quux\n|}");
add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [[0,[1,0]]]", "{|\n!foo||bar\n<!-- foo --> ||baz||quux\n|}");
add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [2]", "17kr78f\n{|\n!foo||bar\n<!-- foo --> ||baz||quux\n|}");
add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [[0,2]]", "{|\n<!--hboi9w-->!foo||bar\n<!-- foo --> ||baz||quux\n|}");
add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [[3,1]]", "{|\n!foo||bar\n<!-- foo --> ||baz||quux\n|}");
add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [[2,1]]", "{|<!--z7hct2-->\n!foo||bar\n<!-- foo --> ||baz||quux\n|}");
add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [[0,[[0,1,2,3],4]]]", "{|\n!foo|| data-foobar=\"1nbkew9\" |bar\n<!-- foo --> !43ep4z\n||baz<!--1ghfich-->\n|}");
add("selser", "Table with missing opening <tr> tag [[2,[[4,3],3]]]", "<table><!--1tf32as-->\n<td>1pozjc1</td></tr>\n</table>");
add("selser", "Table with missing opening <tr> tag [[2,[0,3]]]", "<table><!--1ch5rmb-->\n<td>foo</td>\n</tr>\n</table>");
add("selser", "Piped link with multiple pipe characters in link text [1]", "[[Main Page||The|Main|Page|]]");
add("selser", "Piped link with multiple pipe characters in link text [2]", "zoince\n\n[[Main Page||The|Main|Page|]]");
add("selser", "Piped link with multiple pipe characters in link text [[2]]", "3b7j8e[[Main Page||The|Main|Page|]]");
add("selser", "<nowiki> inside a link [[0,2,0,[0,1]]]", "[[Mainxsq4rf<nowiki> Page</nowiki>]] [[Main Page|the main page <nowiki>[it's not very good]</nowiki>]]");
add("selser", "<nowiki> inside a link [[0,2,0,3]]", "[[Main1rvhx46<nowiki> Page</nowiki>]] ");
add("selser", "<nowiki> inside a link [1]", "[[Main<nowiki> Page</nowiki>]] [[Main Page|the main page <nowiki>[it's not very good]</nowiki>]]");
add("selser", "<nowiki> inside a link [[0,0,0,1]]", "[[Main<nowiki> Page</nowiki>]] [[Main Page|the main page <nowiki>[it's not very good]</nowiki>]]");
add("selser", "<nowiki> inside a link [2]", "1kg3djm\n\n[[Main<nowiki> Page</nowiki>]] [[Main Page|the main page <nowiki>[it's not very good]</nowiki>]]");
add("selser", "<nowiki> inside a link [[0,2,0,1]]", "[[Mainepwrl2<nowiki> Page</nowiki>]] [[Main Page|the main page <nowiki>[it's not very good]</nowiki>]]");
add("selser", "<nowiki> inside a link [[2,2,0,[0,4]]]", "u5qm6t[[Mainp758n<nowiki> Page</nowiki>]] [[Main Page|the main page 1v6pedl]]");
add("selser", "<nowiki> inside a link [[0,1,0,3]]", "[[Main<nowiki> Page</nowiki>]] ");
add("selser", "2. Interaction of linktrail and template encapsulation [1]", "{{echo|Some [[Fool]]}}");
add("selser", "Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved [3,2,[[4,2]],3,4,3,2]", "175ks3d\n\n[[Foo|173exoy148kdsg''bar'']]\n\n6xbp9z\n\npyd6c8\n\n[http://wp.org ''foo'']");
add("selser", "Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved [0,3,1,0,1,0,1]", "[[Foo| bar]]\n\n[[Foo| ''bar'']]\n\n[http://wp.org foo]\n\n[http://wp.org ''foo'']");
add("selser", "Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved [[[2]],0,[[2,3]],3,4,4,0]", "[[Foo|tv7jco bar]]\n\n[[Foo|vr2v1d ]]\n\n7oogb6\n\n1yp7ufe\n\n[http://wp.org ''foo'']");
add("selser", "Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved [[[3]],4,2,2,2,4,0]", "[[Foo|<nowiki/>]]\n\npdshi7\n\n1r9qk0i\n\n[[Foo| ''bar'']]\n\nk6mkmq\n\n1yhdkfq\n\n[http://wp.org foo]\n\n1tdly6y\n\n[http://wp.org ''foo'']");
add("selser", "Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved [2,4,[2],4,2,0,4]", "1fzcpcf\n\n[[Foo| bar]]\n\nmq4rz4\n\n1nzfla4[[Foo| ''bar''