Arlolra has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/315644

Change subject: [WIP] rm html5 treebuilder
......................................................................

[WIP] rm html5 treebuilder

Change-Id: I45ffb07723a6842be6a39d52ab0165676536be0a
---
M lib/wt2html/HTML5TreeBuilder.js
M package.json
M tests/parserTests-blacklist.js
3 files changed, 118 insertions(+), 48 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/44/315644/1

diff --git a/lib/wt2html/HTML5TreeBuilder.js b/lib/wt2html/HTML5TreeBuilder.js
index 9be9bf4..5399982 100644
--- a/lib/wt2html/HTML5TreeBuilder.js
+++ b/lib/wt2html/HTML5TreeBuilder.js
@@ -7,8 +7,7 @@
 
 var events = require('events');
 var util = require('util');
-var DOMTreeBuilder = require('html5').DOMTreeBuilder;
-var domino = require('domino');
+var HTMLParser = require('domino').HTMLParser;
 var defines = require('./parser.defines.js');
 var Util = require('../utils/Util.js').Util;
 var SanitizerConstants = require('./tt/Sanitizer.js').SanitizerConstants;
@@ -81,24 +80,41 @@
        // We only need one for every run of strings and newline tokens.
        this.haveTransclusionShadow = false;
 
-       if (!this._treeBuilder) {
-               // Set up a new tree builder.  Note that when adding attributes 
to
-               // elements, this will call the public DOM method 
`setAttributeNS`
-               // with all its checks that aren't part of the HTML5 parsing 
spec.
-               this._treeBuilder = new DOMTreeBuilder(domino);
-               this.addListener('token',
-                       this._treeBuilder.processToken.bind(this._treeBuilder));
-       }
-
-       // Reset the tree builder
-       this._treeBuilder.startTokenization(this);
-
-       // At this point, domino has already created a document element for us 
but
-       // the html5 library would like to use its own (keeps an internal state 
of
-       // open elements). Remove it and process a body token to trigger 
rebuilding.
-       this.doc = this._treeBuilder.document;
-       this.doc.removeChild(this.doc.lastChild);
+       this.parser = new HTMLParser();
        this.processToken(new TagTk('body'));
+};
+
+var types = new Map(Object.entries({
+       EOF: -1,
+       Characters: 1,
+       StartTag: 2,
+       EndTag: 3,
+       Comment: 4,
+       // DOCTYPE: 5,
+}));
+
+TreeBuilder.prototype.insertToken = function(tok) {
+       var t = types.get(tok.type);
+       var value, arg3;
+       switch (tok.type) {
+               case 'StartTag':
+               case 'EndTag':
+                       value = tok.name;
+                       if (tok.data) {
+                               arg3 = tok.data.map(function(a) {
+                                       return [a.nodeName, a.nodeValue];
+                               });
+                       }
+                       break;
+               case 'Characters':
+               case 'Comment':
+               case 'EOF':
+                       value = tok.data;
+                       break;
+               default:
+                       console.assert(false);
+       }
+       this.parser.insertToken(t, value, arg3);
 };
 
 TreeBuilder.prototype.onChunk = function(tokens) {
@@ -116,7 +132,7 @@
        if (this.lastToken && this.lastToken.constructor !== EOFTk) {
                this.env.log("error", "EOFTk was lost in page", 
this.env.page.name);
        }
-       this.emit('document', this.doc);
+       this.emit('document', this.parser.document());
        this.emit('end');
        this.resetState();
 };
@@ -176,7 +192,7 @@
                                // treebuilder will eat one.
                                data = '\n' + data;
                        }
-                       this.emit('token', { type: 'Characters', data: data });
+                       this.insertToken({ type: 'Characters', data: data });
                        // NlTks are only fostered when accompanied by
                        // non-whitespace. Safe to ignore.
                        if (this.inTransclusion && this.tableDepth > 0 &&
@@ -185,7 +201,7 @@
                                // after every text node so that we can detect
                                // fostered content that came from a 
transclusion.
                                this.env.log("debug/html", this.pipelineId, 
"Inserting shadow transclusion meta");
-                               this.emit('token', {
+                               this.insertToken({
                                        type: 'StartTag',
                                        name: 'meta',
                                        data: [{ nodeName: "typeof", nodeValue: 
"mw:TransclusionShadow" }],
@@ -203,22 +219,21 @@
                                // like the navbox
                                if (!this.inTransclusion) {
                                        this.env.log("debug/html", 
this.pipelineId, "Inserting foster box meta");
-                                       this.emit('token', {
+                                       this.insertToken({
                                                type: 'StartTag',
                                                name: 'table',
-                                               self_closing: true,
                                                data: [{ nodeName: "typeof", 
nodeValue: "mw:FosterBox" }],
                                        });
                                }
                        }
-                       this.emit('token', {type: 'StartTag', name: tName, 
data: this._att(attribs)});
+                       this.insertToken({ type: 'StartTag', name: tName, data: 
this._att(attribs) });
                        this.env.log("debug/html", this.pipelineId, "Inserting 
shadow meta for", tName);
                        attrs = [
                                { nodeName: "typeof", nodeValue: "mw:StartTag" 
},
                                { nodeName: "data-stag", nodeValue: tName + ":" 
+ dataAttribs.tmp.tagId },
                                { nodeName: "data-parsoid", nodeValue: 
JSON.stringify(dataAttribs) },
                        ];
-                       this.emit('token', {
+                       this.insertToken({
                                type: 'Comment',
                                data: JSON.stringify({
                                        "@type": "mw:shadow",
@@ -280,7 +295,7 @@
                                        if (tTypeOf.match(/^mw:Transclusion/)) {
                                                this.inTransclusion = 
/^mw:Transclusion$/.test(tTypeOf);
                                        }
-                                       this.emit('token', {
+                                       this.insertToken({
                                                type: 'Comment',
                                                data: JSON.stringify({
                                                        '@type': tTypeOf,
@@ -292,11 +307,11 @@
                        }
 
                        var newAttrs = this._att(attribs);
-                       this.emit('token', { type: 'StartTag', name: tName, 
data: newAttrs });
+                       this.insertToken({ type: 'StartTag', name: tName, data: 
newAttrs });
                        if (!Util.isVoidElement(tName)) {
                                // VOID_ELEMENTS are automagically treated as 
self-closing by
                                // the tree builder
-                               this.emit('token', { type: 'EndTag', name: 
tName, data: newAttrs });
+                               this.insertToken({ type: 'EndTag', name: tName, 
data: newAttrs });
                        }
                        break;
                case EndTagTk:
@@ -304,7 +319,7 @@
                        if (tName === 'table' && this.tableDepth > 0) {
                                this.tableDepth--;
                        }
-                       this.emit('token', {type: 'EndTag', name: tName});
+                       this.insertToken({ type: 'EndTag', name: tName });
                        if (dataAttribs && !dataAttribs.autoInsertedEnd) {
                                attrs = this._att(attribs).concat([
                                        { nodeName: "typeof", nodeValue: 
"mw:EndTag" },
@@ -312,7 +327,7 @@
                                        { nodeName: "data-parsoid", nodeValue: 
JSON.stringify(dataAttribs) },
                                ]);
                                this.env.log("debug/html", this.pipelineId, 
"Inserting shadow meta for", tName);
-                               this.emit('token', {
+                               this.insertToken({
                                        type: 'Comment',
                                        data: JSON.stringify({
                                                "@type": "mw:shadow",
@@ -322,10 +337,10 @@
                        }
                        break;
                case CommentTk:
-                       this.emit('token', { type: 'Comment', data: token.value 
});
+                       this.insertToken({ type: 'Comment', data: token.value 
});
                        break;
                case EOFTk:
-                       this.emit('token', { type: 'EOF' });
+                       this.insertToken({ type: 'EOF' });
                        break;
                default:
                        var errors = [
diff --git a/package.json b/package.json
index e7fe3f9..cf2bce6 100644
--- a/package.json
+++ b/package.json
@@ -12,13 +12,12 @@
     "content-type": "git+https://github.com/wikimedia/content-type#master";,
     "core-js": "^2.4.1",
     "diff": "^1.0.7",
-    "domino": "^1.0.25",
+    "domino": "git+https://github.com/arlolra/domino#tree";,
     "entities": "^1.1.1",
     "express": "^4.14.0",
     "express-handlebars": "^3.0.0",
     "finalhandler": "^0.5.0",
     "gelf-stream": "^0.2.4",
-    "html5": "^1.0.5",
     "js-yaml": "^3.6.1",
     "mediawiki-title": "^0.5.6",
     "negotiator": 
"git+https://github.com/arlolra/negotiator#full-parse-access";,
diff --git a/tests/parserTests-blacklist.js b/tests/parserTests-blacklist.js
index 17c577e..18a7d35 100644
--- a/tests/parserTests-blacklist.js
+++ b/tests/parserTests-blacklist.js
@@ -45,13 +45,21 @@
 add("wt2html", "Comment on its own line post-expand with non-significant 
whitespace", "<p data-parsoid='{\"dsr\":[0,23,0,0]}'>a\n <span about=\"#mwt1\" 
typeof=\"mw:Transclusion\" 
data-parsoid='{\"dsr\":[3,12,null,null],\"pi\":[[]]}' 
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"blank\",\"href\":\"./Template:Blank\"},\"params\":{},\"i\":0}}]}'></span>
 <!----> \nb</p>");
 add("wt2html", "Block tag on one line (<blockquote>)", "<p 
data-parsoid='{\"dsr\":[0,2,0,0]}'>a </p><blockquote 
data-parsoid='{\"stx\":\"html\",\"dsr\":[2,30,12,13]}'>foo</blockquote>\n\n<p 
data-parsoid='{\"dsr\":[32,33,0,0]}'>b</p>");
 add("wt2html", "Block tag on both lines (<blockquote>)", "<p 
data-parsoid='{\"dsr\":[0,2,0,0]}'>a </p><blockquote 
data-parsoid='{\"stx\":\"html\",\"dsr\":[2,30,12,13]}'>foo</blockquote>\n\n<p 
data-parsoid='{\"dsr\":[32,34,0,0]}'>b </p><blockquote 
data-parsoid='{\"stx\":\"html\",\"dsr\":[34,62,12,13]}'>foo</blockquote>");
-add("wt2html", "<pre> with <nowiki> inside (compatibility with 1.6 and 
earlier)", "<pre data-parsoid='{\"stx\":\"html\",\"dsr\":[0,45,5,6]}'><span 
typeof=\"mw:Nowiki\" 
data-parsoid='{\"dsr\":[5,39,8,9]}'>\n&lt;b>\n&lt;cite>\n&lt;em>\n</span></pre>");
+add("wt2html", "<pre> with <nowiki> inside (compatibility with 1.6 and 
earlier)", "<pre data-parsoid='{\"stx\":\"html\",\"dsr\":[0,45,5,6]}'><span 
typeof=\"mw:Nowiki\" 
data-parsoid='{\"dsr\":[5,39,8,9]}'>\n\n&lt;b>\n&lt;cite>\n&lt;em>\n</span></pre>");
 add("wt2html", "Bug 52763: 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='{\"autoInsertedEnd\":true,\"autoInsertedStart\":true,\"dsr\":[22,57,0,0]}'><td
 data-parsoid='{\"autoInsertedEnd\":true,\"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", "Bug 15491: <ins>/<del> in blockquote (2)", "<blockquote 
data-parsoid='{\"stx\":\"html\",\"dsr\":[0,64,12,13]}'>Foo <del 
data-parsoid='{\"stx\":\"html\",\"dsr\":[16,30,5,6]}'>bar</del> <ins 
data-parsoid='{\"stx\":\"html\",\"dsr\":[31,45,5,6]}'>baz</ins> 
quux\n</blockquote>");
+add("wt2html", "<nowiki> inside <pre> (bug 13238)", "<pre 
data-parsoid='{\"stx\":\"html\",\"strippedNL\":true,\"dsr\":[0,21,5,6]}'>\n\n&lt;nowiki>\n</pre>\n<pre
 
data-parsoid='{\"stx\":\"html\",\"strippedNL\":true,\"dsr\":[22,52,5,6]}'>\n\n<span
 typeof=\"mw:Nowiki\" 
data-parsoid='{\"dsr\":[28,45,8,9]}'></span>\n</pre>\n<pre 
data-parsoid='{\"stx\":\"html\",\"dsr\":[53,118,5,6]}'><span 
typeof=\"mw:Nowiki\" 
data-parsoid='{\"dsr\":[58,83,8,9]}'>&lt;nowiki></span>Foo<span 
typeof=\"mw:Nowiki\" 
data-parsoid='{\"dsr\":[86,103,8,9]}'></span>&lt;/nowiki></pre>");
+add("wt2html", "<nowiki> and <pre> preference (first one wins)", "<pre 
data-parsoid='{\"stx\":\"html\",\"strippedNL\":true,\"dsr\":[0,21,5,6]}'>\n\n&lt;nowiki>\n</pre>\n<p
 data-parsoid='{\"dsr\":[22,38,0,0]}'><span typeof=\"mw:Placeholder\" 
data-parsoid='{\"src\":\"&lt;/nowiki>\",\"dsr\":[22,31,null,0]}'>&lt;/nowiki></span>\n&lt;/pre></p>\n\n<p
 data-parsoid='{\"dsr\":[40,87,0,0]}'><span typeof=\"mw:Nowiki\" 
data-parsoid='{\"dsr\":[40,80,8,9]}'>\n&lt;pre>\n&lt;nowiki>\n&lt;/pre>\n</span>\n&lt;/pre></p>\n");
+add("wt2html", "Empty pre; pre inside other HTML tags (bug 54946)", "<p 
data-parsoid='{\"dsr\":[0,1,0,0]}'>a</p>\n\n<div 
data-parsoid='{\"stx\":\"html\",\"dsr\":[3,30,5,6]}'><pre 
data-parsoid='{\"stx\":\"html\",\"strippedNL\":true,\"dsr\":[8,24,5,6]}'>\n\nfoo\n</pre></div>\n<pre
 data-parsoid='{\"stx\":\"html\",\"dsr\":[31,42,5,6]}'></pre>");
 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,100,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\":[102,114,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 (bug 67657)", "<p 
about=\"#mwt1\" typeof=\"mw:Transclusion\" 
data-parsoid='{\"dsr\":[0,18,0,0],\"pi\":[[{\"k\":\"&#39;&#39;1&#39;&#39;\",\"named\":true}]]}'
 
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"&#39;&#39;1&#39;&#39;\":{\"wt\":\"foo\"}},\"i\":0}}]}'>foo</p>");
+add("wt2html", "3c. Indent-Pre and block tags (pre-content on separate line)", 
"<p data-parsoid='{\"stx\":\"html\",\"dsr\":[0,13,3,4]}'>\n foo\n</p>\n\n<div 
data-parsoid='{\"stx\":\"html\",\"dsr\":[15,32,5,6]}'>\n<pre 
data-parsoid='{\"dsr\":[21,25,1,0]}'>foo</pre>\n</div>\n\n<center 
data-parsoid='{\"stx\":\"html\",\"dsr\":[34,57,8,9]}'>\n<pre 
data-parsoid='{\"dsr\":[43,47,1,0]}'>foo</pre>\n</center>\n\n<blockquote 
data-parsoid='{\"stx\":\"html\",\"dsr\":[59,90,12,13]}'>\n<p 
data-parsoid='{\"dsr\":[72,76,0,0]}'> foo</p>\n</blockquote>\n\n<blockquote 
data-parsoid='{\"stx\":\"html\",\"dsr\":[92,135,12,13]}'>\n<pre 
data-parsoid='{\"stx\":\"html\",\"strippedNL\":true,\"dsr\":[105,121,5,6]}'>\n\nfoo\n</pre>\n</blockquote>\n\n<table
 data-parsoid='{\"stx\":\"html\",\"dsr\":[137,176,7,8]}'><tbody 
data-parsoid='{\"dsr\":[144,168,0,0]}'><tr 
data-parsoid='{\"stx\":\"html\",\"dsr\":[144,168,4,5]}'><td 
data-parsoid='{\"stx\":\"html\",\"dsr\":[148,163,4,5]}'>\n<pre 
data-parsoid='{\"dsr\":[153,157,1,0]}'>foo</pre>\n</td></tr></tbody></table>\n\n<ul
 data-parsoid='{\"stx\":\"html\",\"dsr\":[178,203,4,5]}'><li 
data-parsoid='{\"stx\":\"html\",\"dsr\":[182,198,4,5]}'>\n  foo\n</li></ul>\n");
 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", "HTML-pre: 1. embedded newlines", "<pre 
data-parsoid='{\"stx\":\"html\",\"dsr\":[0,14,5,6]}'>foo</pre>\n\n<pre 
data-parsoid='{\"stx\":\"html\",\"strippedNL\":true,\"dsr\":[16,32,5,6]}'>\n\nfoo\n</pre>\n\n<pre
 
data-parsoid='{\"stx\":\"html\",\"strippedNL\":true,\"dsr\":[34,51,5,6]}'>\n\n\nfoo\n</pre>\n\n<pre
 
data-parsoid='{\"stx\":\"html\",\"strippedNL\":true,\"dsr\":[53,71,5,6]}'>\n\n\n\nfoo\n</pre>");
+add("wt2html", "HTML-pre: big spaces", "<pre 
data-parsoid='{\"stx\":\"html\",\"strippedNL\":true,\"dsr\":[0,34,5,6]}'>\n\n\n\n\n\nhaha\n\n\n\n\nhaha\n\n\n\n\n</pre>");
+add("wt2html", "HTML-pre: 2: indented text", "<pre 
data-parsoid='{\"stx\":\"html\",\"strippedNL\":true,\"dsr\":[0,17,5,6]}'>\n\n 
foo\n</pre>");
+add("wt2html", "HTML-pre: 3: other wikitext", "<pre 
data-parsoid='{\"stx\":\"html\",\"strippedNL\":true,\"dsr\":[0,62,5,6]}'>\n\n* 
foo\n# bar\n= no-h =\n'' no-italic ''\n[[ NoLink ]]\n</pre>");
 add("wt2html", "Definition Lists: colons and tables 1", "<dl 
data-parsoid='{\"dsr\":[0,21,0,0]}'><dd 
data-parsoid='{\"dsr\":[0,10,1,0]}'><table 
data-parsoid='{\"dsr\":[1,10,2,2]}'>\n<tbody 
data-parsoid='{\"dsr\":[4,8,0,0]}'><tr 
data-parsoid='{\"autoInsertedEnd\":true,\"autoInsertedStart\":true,\"dsr\":[4,7,0,0]}'><td
 data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[4,7,1,0]}'> 
x</td></tr>\n</tbody></table></dd>\n<dd 
data-parsoid='{\"dsr\":[11,21,1,0]}'><table 
data-parsoid='{\"dsr\":[12,21,2,2]}'>\n<tbody 
data-parsoid='{\"dsr\":[15,19,0,0]}'><tr 
data-parsoid='{\"autoInsertedEnd\":true,\"autoInsertedStart\":true,\"dsr\":[15,18,0,0]}'><td
 data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[15,18,1,0]}'> 
y</td></tr>\n</tbody></table></dd></dl>");
 add("wt2html", "Bug 2702: 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\" 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\" 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\" 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\" 
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\" 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 (bug 4598 sanity check)", "<p data-parsoid='{\"dsr\":[0,60,0,0]}'><i 
data-parsoid='{\"dsr\":[0,60,2,2]}'>Some <a rel=\"mw:ExtLink\" 
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>");
@@ -280,11 +288,18 @@
 add("wt2wt", "Parsoid only: Quote balancing context should be restricted to 
td/th cells on the same wikitext line\n(Requires tidy for PHP parser output to 
be fixed up)", "{|\n!''a''!!''b''\n|''a''||''b''\n|}");
 add("wt2wt", "Non-word characters don't terminate tag names (bug 17663, 40670, 
52022)", "<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("wt2wt", "Non-word characters don't terminate tag names + tidy", 
"<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("wt2wt", "<nowiki> inside <pre> (bug 13238)", 
"<pre>\n<nowiki>\n</pre>\n<pre>\n<nowiki></nowiki>\n</pre>\n<pre><nowiki>&lt;nowiki&gt;</nowiki>Foo<nowiki></nowiki></nowiki></pre>");
-add("wt2wt", "<nowiki> and <pre> preference (first one wins)", 
"<pre>\n<nowiki>\n</pre>\n</nowiki>\n</pre>\n\n<nowiki>\n<pre>\n&lt;nowiki&gt;\n</pre>\n</nowiki>\n</pre>\n");
+add("wt2wt", "<pre> with <nowiki> inside (compatibility with 1.6 and 
earlier)", "<pre><nowiki>\n\n<b>\n<cite>\n<em>\n</nowiki></pre>");
+add("wt2wt", "<nowiki> inside <pre> (bug 13238)", 
"<pre>\n\n<nowiki>\n</pre>\n<pre>\n\n<nowiki></nowiki>\n</pre>\n<pre><nowiki>&lt;nowiki&gt;</nowiki>Foo<nowiki></nowiki></nowiki></pre>");
+add("wt2wt", "<nowiki> and <pre> preference (first one wins)", 
"<pre>\n\n<nowiki>\n</pre>\n</nowiki>\n</pre>\n\n<nowiki>\n<pre>\n&lt;nowiki&gt;\n</pre>\n</nowiki>\n</pre>\n");
+add("wt2wt", "Empty pre; pre inside other HTML tags (bug 54946)", 
"a\n\n<div><pre>\n\nfoo\n</pre></div>\n<pre></pre>");
 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<!-- should be ignored 
-->\n|foo}}\n\n{{echo<!-- should be ignored -->|foo}}\n\n{{echo|foo}}");
+add("wt2wt", "3c. Indent-Pre and block tags (pre-content on separate line)", 
"<p>\n foo\n</p>\n\n<div>\n foo\n</div>\n\n<center>\n 
foo\n</center>\n\n<blockquote>\n 
foo\n</blockquote>\n\n<blockquote>\n<pre>\n\nfoo\n</pre>\n</blockquote>\n\n<table><tr><td>\n
 foo\n</td></tr></table>\n\n<ul><li>\n  foo\n</li></ul>\n");
 add("wt2wt", "4. Indent-Pre and extension tags", "<nowiki> </nowiki>a <tag 
/>");
+add("wt2wt", "HTML-pre: 1. embedded newlines", 
"<pre>foo</pre>\n\n<pre>\n\nfoo\n</pre>\n\n<pre>\n\n\nfoo\n</pre>\n\n<pre>\n\n\n\nfoo\n</pre>");
+add("wt2wt", "HTML-pre: big spaces", 
"<pre>\n\n\n\n\n\nhaha\n\n\n\n\nhaha\n\n\n\n\n</pre>");
+add("wt2wt", "HTML-pre: 2: indented text", "<pre>\n\n foo\n</pre>");
+add("wt2wt", "HTML-pre: 3: other wikitext", "<pre>\n\n* foo\n# bar\n= no-h 
=\n'' no-italic ''\n[[ NoLink ]]\n</pre>");
 add("wt2wt", "Definition lists: self-closed tag", ";one<br />two : two-line 
fun");
 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", "BUG 289: \">\"-token in bracketed URL", 
"[http://www.example.com/ <hello> stuff]\n");
@@ -396,7 +411,7 @@
 add("html2html", "<pre> with forbidden attribute (bug 3202)", "<pre 
data-parsoid='{\"dsr\":[0,22,1,0]}'>Narrow screen goodies</pre>\n");
 add("html2html", "<pre> with forbidden attribute values (bug 3202)", "<pre 
data-parsoid='{\"dsr\":[0,22,1,0]}'>Narrow screen goodies</pre>\n");
 add("html2html", "<nowiki> inside <pre> (bug 13238)", "<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\n
 <p data-parsoid='{\"dsr\":[18,18,0,0]}'><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", "<nowiki> and <pre> preference (first one wins)", "<pre 
data-parsoid='{\"stx\":\"html\",\"strippedNL\":true,\"dsr\":[0,21,5,6]}'>&lt;nowiki>\n</pre>\n<p
 data-parsoid='{\"dsr\":[22,38,0,0]}'><span typeof=\"mw:Placeholder\" 
data-parsoid='{\"src\":\"&lt;/nowiki>\",\"dsr\":[22,31,null,0]}'>&lt;/nowiki></span>\n&lt;/pre></p>\n\n<p
 data-parsoid='{\"dsr\":[40,93,0,0]}'><span typeof=\"mw:Nowiki\" 
data-parsoid='{\"dsr\":[40,86,8,9]}'>\n&lt;pre>\n<span typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;lt;\",\"srcContent\":\"&lt;\",\"dsr\":[55,59,null,null]}'>&lt;</span>nowiki<span
 typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;gt;\",\"srcContent\":\">\",\"dsr\":[65,69,null,null]}'>></span>\n&lt;/pre>\n</span>\n&lt;/pre></p>\n");
+add("html2html", "<nowiki> and <pre> preference (first one wins)", "<pre 
data-parsoid='{\"stx\":\"html\",\"strippedNL\":true,\"dsr\":[0,21,5,6]}'>\n\n&lt;nowiki>\n</pre>\n<p
 data-parsoid='{\"dsr\":[22,38,0,0]}'><span typeof=\"mw:Placeholder\" 
data-parsoid='{\"src\":\"&lt;/nowiki>\",\"dsr\":[22,31,null,0]}'>&lt;/nowiki></span>\n&lt;/pre></p>\n\n<p
 data-parsoid='{\"dsr\":[40,93,0,0]}'><span typeof=\"mw:Nowiki\" 
data-parsoid='{\"dsr\":[40,86,8,9]}'>\n&lt;pre>\n<span typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;lt;\",\"srcContent\":\"&lt;\",\"dsr\":[55,59,null,null]}'>&lt;</span>nowiki<span
 typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;gt;\",\"srcContent\":\">\",\"dsr\":[65,69,null,null]}'>></span>\n&lt;/pre>\n</span>\n&lt;/pre></p>\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 &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,79,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=\"#mwt3\" typeof=\"mw:Transclusion\" 
data-parsoid='{\"dsr\":[81,119,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\":[121,133,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: Handle comments in parameter names (bug 67657)", 
"<p about=\"#mwt1\" typeof=\"mw:Transclusion\" 
data-parsoid='{\"dsr\":[0,41,0,0],\"pi\":[[{\"k\":\"1\",\"named\":true}]]}' 
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo\",\"key\":{\"wt\":\"1
 &lt;!-- should be ignored -->\"}}},\"i\":0}}]}'>foo</p>\n\n<p about=\"#mwt2\" 
typeof=\"mw:Transclusion\" 
data-parsoid='{\"dsr\":[43,84,0,0],\"pi\":[[{\"k\":\"1\",\"named\":true}]]}' 
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo\",\"key\":{\"wt\":\"&lt;!--
 should be ignored --> 1\"}}},\"i\":0}}]}'>foo</p>\n\n<p about=\"#mwt3\" 
typeof=\"mw:Transclusion\" 
data-parsoid='{\"dsr\":[86,126,0,0],\"pi\":[[{\"k\":\"1\",\"named\":true}]]}' 
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo\",\"key\":{\"wt\":\"1&lt;!--
 should be ignored -->\"}}},\"i\":0}}]}'>foo</p>\n\n<p about=\"#mwt4\" 
typeof=\"mw:Transclusion\" 
data-parsoid='{\"dsr\":[128,168,0,0],\"pi\":[[{\"k\":\"1\",\"named\":true}]]}' 
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"foo\",\"key\":{\"wt\":\"&lt;!--
 should be ignored -->1\"}}},\"i\":0}}]}'>foo</p>");
 add("html2html", "Templates: Other wikitext in parameter names (bug 67657)", 
"<p about=\"#mwt1\" typeof=\"mw:Transclusion\" 
data-parsoid='{\"dsr\":[0,18,0,0],\"pi\":[[{\"k\":\"&#39;&#39;1&#39;&#39;\",\"named\":true}]]}'
 
data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"&#39;&#39;1&#39;&#39;\":{\"wt\":\"foo\"}},\"i\":0}}]}'>foo</p>");
@@ -404,6 +419,9 @@
 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='{\"autoInsertedEnd\":true,\"autoInsertedStart\":true,\"dsr\":[137,143,0,0]}'><td
 data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[137,143,1,0]}'>\n<pre 
data-parsoid='{\"dsr\":[139,143,1,0]}'>foo</pre></td></tr>\n</tbody></table>\n<ul
 data-parsoid='{\"dsr\":[147,153,0,0]}'><li 
data-parsoid='{\"dsr\":[147,153,1,0]}'>  foo</li></ul>\n");
 add("html2html", "4. Indent-Pre and extension tags", "<span 
typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[0,18,8,9]}'> </span>a <pre 
typeof=\"mw:Extension/tag\" about=\"#mwt2\" 
data-parsoid='{\"dsr\":[20,27,2,2]}' 
data-mw='{\"name\":\"tag\",\"attrs\":{},\"body\":null}'></pre>");
 add("html2html", "5a. White-space in indent-pre", "<pre 
data-parsoid='{\"dsr\":[0,13,1,0]}'>a<br 
data-parsoid='{\"stx\":\"html\",\"noClose\":true,\"dsr\":[2,8,4,null]}'/>\n\n\nb</pre>\n");
+add("html2html", "HTML-pre: 1. embedded newlines", "<pre 
data-parsoid='{\"stx\":\"html\",\"dsr\":[0,14,5,6]}'>foo</pre>\n\n<pre 
data-parsoid='{\"stx\":\"html\",\"strippedNL\":true,\"dsr\":[16,32,5,6]}'>\n\nfoo\n</pre>\n\n<pre
 
data-parsoid='{\"stx\":\"html\",\"strippedNL\":true,\"dsr\":[34,51,5,6]}'>\n\n\nfoo\n</pre>\n\n<pre
 
data-parsoid='{\"stx\":\"html\",\"strippedNL\":true,\"dsr\":[53,71,5,6]}'>\n\n\n\nfoo\n</pre>");
+add("html2html", "HTML-pre: big spaces", "<pre 
data-parsoid='{\"stx\":\"html\",\"strippedNL\":true,\"dsr\":[0,34,5,6]}'>\n\n\n\n\n\nhaha\n\n\n\n\nhaha\n\n\n\n\n</pre>");
+add("html2html", "HTML-pre: 3: other wikitext", "<pre 
data-parsoid='{\"stx\":\"html\",\"strippedNL\":true,\"dsr\":[0,62,5,6]}'>\n\n* 
foo\n# bar\n= no-h =\n'' no-italic ''\n[[ NoLink ]]\n</pre>");
 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", "Definition Lists: colons and tables 1", "<dl 
data-parsoid='{\"dsr\":[0,24,0,0]}'><dd data-parsoid='{\"dsr\":[0,11,1,0]}'> 
<table data-parsoid='{\"dsr\":[2,11,2,2]}'>\n<tbody 
data-parsoid='{\"dsr\":[5,9,0,0]}'><tr 
data-parsoid='{\"autoInsertedEnd\":true,\"autoInsertedStart\":true,\"dsr\":[5,8,0,0]}'><td
 data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[5,8,1,0]}'> 
x</td></tr>\n</tbody></table></dd>\n\n<dd data-parsoid='{\"dsr\":[13,24,1,0]}'> 
<table data-parsoid='{\"dsr\":[15,24,2,2]}'>\n<tbody 
data-parsoid='{\"dsr\":[18,22,0,0]}'><tr 
data-parsoid='{\"autoInsertedEnd\":true,\"autoInsertedStart\":true,\"dsr\":[18,21,0,0]}'><td
 data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[18,21,1,0]}'> 
y</td></tr>\n</tbody></table></dd></dl>\n");
@@ -1316,21 +1334,38 @@
 add("selser", "Non-word characters don't terminate tag names + tidy 5", 
"<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("selser", "Empty lines between lines with block tags 
[0,0,0,0,4,[4],0,4,2,4,2,0,0,3,3,0,0,[4]]", 
"<div></div>\n\n\n0jr2knw69qode7b9\n\nak4f0xoun9bv5cdi\n\n4us29365j9f9lik9\n\n3sh6psvknz3hm2t9\n\n8z2ywhrg9wl8fr\n\nz7s9at3qyq2xogvi\n\nb\n\n<div>b</div>\n<div>h2r4miiukcoez5mi</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>g72sdt9b9996bt9\n\nau765cdgwcsg7gb9\n\n\n\nqhrfek8hsgkz9f6r\n<div></div>rw83ofcbk55vzpvi\n\nvky2au8c7nmnp14ib\n<div>eu25mfmjxi0sh5mi</div>\n\n<div>b</div>d\n\nvxxu49npeng66r\n\n<div>e</div>");
+add("selser", "<pre> with <nowiki> inside (compatibility with 1.6 and earlier) 
[2]", "r3xn3dz7p5txogvi<pre><nowiki>\n<b>\n<cite>\n<em>\n</nowiki></pre>");
+add("selser", "<pre> with <nowiki> inside (compatibility with 1.6 and earlier) 
[1]", "<pre 
data-foobar=\"lck8am4inw64j9k9\"><nowiki>\n<b>\n<cite>\n<em>\n</nowiki></pre>");
+add("selser", "<pre> with <nowiki> inside (compatibility with 1.6 and earlier) 
[[2]]", "<pre>rc803srpbilzncdi<nowiki>\n<b>\n<cite>\n<em>\n</nowiki></pre>");
 add("selser", "<nowiki> inside <pre> (bug 13238) [4,2,2,0,0]", 
"ptjux9vq9zarlik9\n\ny7rebotz1jo1dcxr\nnb7mtl9jj0jm7vi<pre>\n<nowiki></nowiki>\n</pre>\n<pre><nowiki><nowiki></nowiki>Foo<nowiki></nowiki></nowiki></pre>");
 add("selser", "<nowiki> inside <pre> (bug 13238) [0,3,1,0,3]", 
"<pre>\n<nowiki>\n</pre><pre 
data-foobar=\"d4vv2qk2d3wel8fr\">\n\n<nowiki></nowiki>\n</pre>\n");
+add("selser", "<nowiki> inside <pre> (bug 13238) [0,0,4,0,[[4],0,2,4]]", 
"<pre>\n<nowiki>\n</pre>\n4bu012lyu5l8fr\n<pre><nowiki>3iwsls5l4dzhbyb9</nowiki>Foo00gbujqrtr93haor<nowiki></nowiki>etxm6lmu5ndbo6r</pre>");
 add("selser", "<nowiki> inside <pre> (bug 13238) [3,0,3,3,2]", 
"\np32i6amoddb9y66r<pre><nowiki><nowiki></nowiki>Foo<nowiki></nowiki></nowiki></pre>");
+add("selser", "<nowiki> inside <pre> (bug 13238) [2,0,4,0,[[2],0,2,4]]", 
"vvbx6ubcy2kgwrk9<pre>\n<nowiki>\n</pre>\ne1fh5r5jehveu3di\n<pre><nowiki>f97q3ld1zr02uik9&lt;nowiki&gt;</nowiki>Foojn87smzoxgm8to6r<nowiki></nowiki>x6egolvnexijatt9</pre>");
+add("selser", "<nowiki> inside <pre> (bug 13238) [0,0,3,0,[[2],2,0,0]]", 
"<pre>\n<nowiki>\n</pre>\n\n<pre><nowiki>4tyjeuboxraoflxr&lt;nowiki&gt;</nowiki>9eqtvo67q0mdvx6rFoo<nowiki></nowiki></nowiki></pre>");
+add("selser", "<nowiki> inside <pre> (bug 13238) [0,4,[0,0,3],4,3]", 
"<pre>\n<nowiki>\n</pre>hn5q4u2x5qiio1or<pre>\n\n<nowiki></nowiki></pre>8wy3o72mveoecdi\n");
 add("selser", "<nowiki> inside <pre> (bug 13238) [0,3,3,0,2]", 
"<pre>\n<nowiki>\n</pre>\nf1s3by12sbw97ldi<pre><nowiki><nowiki></nowiki>Foo<nowiki></nowiki></nowiki></pre>");
-add("selser", "<nowiki> inside <pre> (bug 13238) [[3],0,[0,3],3,[4,0,1,2]]", 
"<pre></pre>\n<pre>\n\n<nowiki></nowiki></pre><pre>8snncrntp84ims4iFoo<nowiki></nowiki>vdl3ymz68paurf6r</nowiki></pre>");
-add("selser", "<nowiki> inside <pre> (bug 13238) [4,0,0,0,2]", 
"lfad62yj247psyvi\n<pre>\n<nowiki></nowiki>\n</pre>\ns668bavo8x4rt3xr<pre><nowiki><nowiki></nowiki>Foo<nowiki></nowiki></nowiki></pre>");
-add("selser", "<nowiki> inside <pre> (bug 13238) [0,0,[1,3],4,2]", 
"<pre>\n<nowiki>\n</pre>\n<pre>\n\n<nowiki></nowiki></pre>h5z9mczgkhzx5hfr\n\n4x2g6badu0udi<pre><nowiki><nowiki></nowiki>Foo<nowiki></nowiki></nowiki></pre>");
-add("selser", "<nowiki> inside <pre> (bug 13238) [[3],0,[0,4],2,[3,0,0,2]]", 
"<pre></pre>\n<pre>\n\n<nowiki></nowiki>al0hy3rs2h11c3di</pre>h5p8fkiwu373c8fr\n<pre>Foo<nowiki></nowiki>zicqb9fw1mkotj4i</nowiki></pre>");
+add("selser", "<nowiki> inside <pre> (bug 13238) [3,0,0,0,3]", 
"\n<pre>\n<nowiki></nowiki>\n</pre>\n");
+add("selser", "<nowiki> inside <pre> (bug 13238) [4,0,0,2,4]", 
"lfad62yj247psyvi\n<pre>\n<nowiki></nowiki>\n</pre>s668bavo8x4rt3xr\ne9gk6atjy808uxr\n");
+add("selser", "<nowiki> inside <pre> (bug 13238) [0,0,[2,2,4],2,4]", 
"<pre>\n<nowiki>\n</pre>\n<pre>\n3tbk4n0efaoo5hfr\nh5z9mczgkhzx5hfr<nowiki></nowiki>4x2g6badu0udi</pre>3xdmib0jp8sq0k9\n2wpi93zyufwuq5mi\n");
+add("selser", "<nowiki> inside <pre> (bug 13238) [1,2,0,3,4]", "<pre 
data-foobar=\"p2u0d9qqxhxxyldi\">\n\n<nowiki>\n</pre>0h6wfuf5at2wqaor\n<pre>\n<nowiki></nowiki>\n</pre>q06xyf7mhofj38fr\n");
+add("selser", "<nowiki> inside <pre> (bug 13238) [2,2,[2,0,3],0,[0,3,0,0]]", 
"pheb7wncog1ll3di<pre>\n<nowiki>\n</pre>cx6h0arhmsz41jor\n<pre>\nywnrib86wthb0529\n<nowiki></nowiki></pre>\n<pre><nowiki>&lt;nowiki&gt;</nowiki><nowiki></nowiki></nowiki></pre>");
 add("selser", "<nowiki> and <pre> preference (first one wins) [3,0,2,0,1,2]", 
"\nuuvq56wkejc3di\n\n</nowiki>\n</pre>\n\n<nowiki>\n<pre>\n<nowiki>\n</pre>\n</nowiki>\n</pre>\n\n00flm86bxtzhyqfr\n");
 add("selser", "<nowiki> and <pre> preference (first one wins) 
[[4],0,3,0,0,0]", 
"<pre>\nhtov4vvjzewdygb9</pre>\n\n<nowiki>\n<pre>\n<nowiki>\n</pre>\n</nowiki>\n</pre>\n");
+add("selser", "<nowiki> and <pre> preference (first one wins) 
[0,0,[[2],3],0,3,2]", 
"<pre>\n<nowiki>\n</pre>\n</nowiki>\n\nvdd6k1gco4h4obt9\n");
 add("selser", "<nowiki> and <pre> preference (first one wins) [3,4,3,0,2,0]", 
"u20jle5jk0hvkj4i\n\nn067pn35sxjsv2t9\n\n<nowiki>\n<pre>\n<nowiki>\n</pre>\n</nowiki>\n</pre>\n");
-add("selser", "<nowiki> and <pre> preference (first one wins) 
[[2],0,1,0,2,4]", 
"<pre>\n8ko393dqfxxvquxr<nowiki>\n</pre>\n</nowiki>\n</pre>\n\nmgac8wudaavy4x6r\n\n<nowiki>\n<pre>\n<nowiki>\n</pre>\n</nowiki>\n</pre>\n\n1js1f9r56vl5wmi\n");
+add("selser", "<nowiki> and <pre> preference (first one wins) 
[[2],0,1,0,2,4]", 
"<pre>\n8ko393dqfxxvquxr\n<nowiki>\n</pre>\n</nowiki>\n</pre>\n\nmgac8wudaavy4x6r\n\n<nowiki>\n<pre>\n<nowiki>\n</pre>\n</nowiki>\n</pre>\n\n1js1f9r56vl5wmi\n");
 add("selser", "<nowiki> and <pre> preference (first one wins) 
[[4],0,1,3,1,0]", 
"<pre>\nbv7gok2svqntgldi</pre>\n</nowiki>\n</pre>\n\n<nowiki>\n<pre>\n<nowiki>\n</pre>\n</nowiki>\n</pre>\n");
 add("selser", "<nowiki> and <pre> preference (first one wins) 
[4,0,2,0,[0,4],4]", 
"tdqftxhs7bsxlxr\n\nup3ot7cx78sq0k9\n\n</nowiki>\n</pre>\n\n<nowiki>\n<pre>\n<nowiki>\n</pre>\n</nowiki>57nnl6navsmaq0k9\n\nops9m7gl3ee1att9\n");
 add("selser", "<nowiki> and <pre> preference (first one wins) 
[0,0,[2,2],0,2,0]", 
"<pre>\n<nowiki>\n</pre>\nayl0rt9j2rvvlsor</nowiki>ku5wz6d4oixjemi\n</pre>\n\naoia6vijp7722o6r\n\n<nowiki>\n<pre>\n<nowiki>\n</pre>\n</nowiki>\n</pre>\n");
+add("selser", "<nowiki> and <pre> preference (first one wins) [2,0,0,4,4,2]", 
"y8vpa6w0zqynl8fr<pre>\n<nowiki>\n</pre>\n</nowiki>\n</pre>\n\ncmlrx73di37bvs4i\n\ndljqhg05gz74lsor\n\nfmq2iv96aasdzpvi\n");
+add("selser", "<nowiki> and <pre> preference (first one wins) 
[2,4,[2,0],4,[[3],0],0]", 
"kg5ysu07a5uerk9<pre>\n<nowiki>\n</pre>bs9yk9e1o4r3haor\n\nxjgfdio1kqu59udi</nowiki>\n</pre>\n\nv3i2tp3j1431sjor\n\n<nowiki></nowiki>\n</pre>\n");
+add("selser", "Empty pre; pre inside other HTML tags (bug 54946) [1,0,2,3,0]", 
"a\n\n2j0b5uc25ht9y66r<div><pre>\nfoo\n</pre></div><pre></pre>");
+add("selser", "Empty pre; pre inside other HTML tags (bug 54946) [0,3,1,0,0]", 
"a<div data-foobar=\"4l02b5tzgxw53ik9\"><pre>\nfoo\n</pre></div>\n<pre></pre>");
+add("selser", "Empty pre; pre inside other HTML tags (bug 54946) 
[[2],0,2,2,4]", 
"8ekwtn8px229y66ra\n\n6zwsai8gdk46ajor<div><pre>\nfoo\n</pre></div>izz6fn7q607ctyb9\n126o15068kbg9zfr\n");
+add("selser", "Empty pre; pre inside other HTML tags (bug 54946) [0,0,1,4,0]", 
"a\n\n<div 
data-foobar=\"5edwkkpet6sz6w29\"><pre>\nfoo\n</pre></div>5nemphqh6hag7gb9<pre></pre>");
+add("selser", "Empty pre; pre inside other HTML tags (bug 54946) [0,2,0,0,2]", 
"a\n\n9vxsiiday8wa5rk9\n\n<div><pre>\nfoo\n</pre></div>\na5p13gy1mx5bqpvi<pre></pre>");
+add("selser", "Empty pre; pre inside other HTML tags (bug 54946) 
[[2],0,1,2,3]", "gcwimrwikq9i19k9a\n\n<div 
data-foobar=\"mk7scuhatjzto6r\"><pre>\nfoo\n</pre></div>kwu32l1leliejyvi\n");
 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| 
}}axyuf8omjvhxv42t9{{echo|\n }}a\n\n{{echo|\n b}}\n{{echo|a\n 
}}b\nrnjrx8un9rvsra4i{{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| }}am07scp5u1omq85mi{{echo|\n 
}}a\n\n{{echo|\n b}}\nsjwwihyngffxbt9{{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}}\nr44i0xvr0xzs38fr{{echo|a\n }}b\n\n{{echo|a\n}} 
niup05a8topyzaor");
@@ -1362,12 +1397,14 @@
 add("selser", "Templates: Handle comments in the target [0,0,0,4,0,0,0]", 
"{{echo\n<!-- should be ignored -->\n|foo}}\n\n{{echo<!-- should be ignored 
-->\n|foo}}\n\npk398lfm3w1rwwmi\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]", 
"{{echo\n<!-- should be ignored -->\n|foo}}{{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]", 
"{{echo\n<!-- should be ignored -->\n|foo}}\n\n{{echo<!-- should be ignored 
-->\n|foo}}\n\n{{echo<!-- should be ignored 
-->|foo}}\n\nhlr2vnanjhflayvi\n\n{{<!-- should be ignored -->echo|foo}}");
+add("selser", "3c. Indent-Pre and block tags (pre-content on separate line) 
[2,3,4,0,[2,4,4],0,0,3,[2,2,4],2,2,3,[1],0]", "p0gk6sc1g7zj8aor<p>\n 
foo\n</p>fx4yd1d7oqiwwmi\n\n<center>ulemstfl588pk3xr\nisfrx1f7wvasv2t9\n\noxiupbnt3n8z1tt9</center>\n\n<blockquote>\n
 
foo\n</blockquote><blockquote>tsl4imggmjux47vi\ngpso5293wk3uwhfr<pre>\nfoo\n</pre>irp4haaqbwpl23xr</blockquote>85se6ve20muz0k9\n\nn2vek3umkmv1v2t9<table><tr><td>\n
 foo\n</td></tr></table><ul><li data-foobar=\"o306j343vgy9o1or\">\n  
foo\n</li></ul>\n");
+add("selser", "3c. Indent-Pre and block tags (pre-content on separate line) 
[0,3,1,0,[3,0,4],0,2,4,2,2,3,4,[4],0]", "<p>\n foo\n</p><div 
data-foobar=\"5kgowulg8f72e29\">\n foo\n</div>\n\n<center>\n 
foo\nhl5m78y8fthp8pvi</center>\n\nfpb45us9t6yo80k9<blockquote>\n 
foo\n</blockquote>487d2tbdlh4a38fr\n\ninp282e6odo647vi<blockquote>\n<pre>\nfoo\n</pre>\n</blockquote>jte638569qode7b9\n\nsez3onfkoodbcsor<ul><li>6lmiinunkbievcxr</li></ul>\n");
+add("selser", "3c. Indent-Pre and block tags (pre-content on separate line) 
[3,0,4,0,3,3,0,0,2,2,[[[[3,3,3]]]],2,[2],2]", 
"\nuqrbb9r705fry66r\n\n<blockquote>\n 
foo\n</blockquote>\n\nonqmd8x10utvgqfr<blockquote>\n<pre>\nfoo\n</pre>\n</blockquote>70vm1lajg2nbfbt9\n\n<table><tr><td></td></tr></table>x5tuheoetztcsor\n\n<ul><li>lltynxzfhitchaor</li><li>\n
  foo\n</li></ul>srkw7e09fhs8xgvi\n");
+add("selser", "3c. Indent-Pre and block tags (pre-content on separate line) 
[2,3,[3,4,0],0,3,0,4,2,0,2,4,4,4,3]", "sg8jvbj11gjk0529<p>\n 
foo\n</p><div>\nagzr3t06riorbe29\n</div>\n\nmvg77l02crfwdn29\n\nfhspakbhx91kyb9\n\n<blockquote>\n<pre>\nfoo\n</pre>\n</blockquote>douarqmn82u4bo6r\n\nljx5r3ie8csxajor\n\nn3bne7jpfym34n29\n\nhfk8egr0snka9k9\n");
+add("selser", "3c. Indent-Pre and block tags (pre-content on separate line) 
[0,0,4,0,0,3,[2,3,3],0,1,2,4,2,2,0]", "<p>\n 
foo\n</p>\n\ncalpq132v4gc766r\n\n<center>\n 
foo\n</center><blockquote>8clhwul57z3kgldi\n</blockquote>\n\n<blockquote 
data-foobar=\"cqx725e9tz30izfr\">\n<pre>\nfoo\n</pre>\n</blockquote>oc00k1iy2pt4kj4i\n\ngc9ujf8fl9d7k3xr\n\n3zpmd262uxiggb9\n\npyqumlktqb3p7gb9<ul><li>\n
  foo\n</li></ul>\n");
+add("selser", "3c. Indent-Pre and block tags (pre-content on separate line) 
[1,3,[2,[3],0],0,[2,3,0],0,[4,2,4],4,2,4,[4],0,[2],0]", "<p 
data-foobar=\"sjy1vo18iqode7b9\">\n foo\n</p><div>42i4tbskzfamj9k9\n 
\n</div>\n\n<center>m4a48xnndi2uik9\n\n</center>\n\n<blockquote>e3liv9bd7ey4lsor4kgqppkuy1oflxr\n
 
foo\n3z54okt8nl3gcik9</blockquote>vg1l0hi0zbu1h5mi\n\na03sl3iaalg3z0k9<blockquote>\n<pre>\nfoo\n</pre>\n</blockquote>eg1b27c9konu3di<table><!--ab8u5c9bmp00ms4i--></table>\n\n<ul><li>xbcqrviko1es714i</li><li>\n
  foo\n</li></ul>\n");
 add("selser", "4. Indent-Pre and extension tags 5", "<nowiki> </nowiki>a <tag 
/>");
 add("selser", "4. Indent-Pre and extension tags [2,0]", "z2q1uxsvdja9vn29\n\n 
a <tag />");
-add("selser", "Render paragraphs when indent-pre is suppressed in blocklevels 
[[1,3,0,0]]", "<blockquote> foo\n\n bar\n</blockquote>");
-add("selser", "Render paragraphs when indent-pre is suppressed in blocklevels 
[[1,0,0,0]]", "<blockquote> foo\n\n bar\n</blockquote>");
-add("selser", "Render paragraphs when indent-pre is suppressed in blocklevels 
[[1,0,[4],3]]", "<blockquote> foo\n\ngn7ylzy40ftj4i\n</blockquote>");
-add("selser", "Render paragraphs when indent-pre is suppressed in blocklevels 
[[2,4,2,0]]", "<blockquote>400w4vubqf0nqaor\n\n 
foo\ngzulwh9x29xgk3xrmyw8xai0kyg8ehfr\n bar\n</blockquote>");
 add("selser", "5a. White-space in indent-pre [[0,0,4]]", " a<br />\n 
7tmueg6dyhqia4i");
 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");
@@ -1377,6 +1414,25 @@
 add("selser", "5a. White-space in indent-pre [[2,0,4]]", " d3ppdqvqzdxi529a<br 
/>\n 82567nb6q9hbmx6r");
 add("selser", "5a. White-space in indent-pre [[2,0,0]]", " 9blj98gpz0py14ia<br 
/>\n \n \n b");
 add("selser", "5a. White-space in indent-pre [[0,2,0]]", " 
am3m3vd8oxzu84cxr<br />\n \n \n b");
+add("selser", "HTML-pre: 1. embedded newlines [0,0,0,0,2,4,[4]]", 
"<pre>foo</pre>\n\n<pre>\nfoo\n</pre>\n\n0j7m5dwvy5t81tt9<pre>\n\nfoo\n</pre>gznvus2wm2ikke29<pre>\n3kx0qbxm4do39pb9</pre>");
+add("selser", "HTML-pre: 1. embedded newlines [0,2,[4],0,[4],3,2]", 
"<pre>foo</pre>7ysmnukvidpctyb9\n\n<pre>\n9g47a95uexywrk9</pre>\n\n<pre>\nfrywx1s1mtervn29</pre>bk0krhbpq3nb3xr<pre>\n\n\nfoo\n</pre>");
+add("selser", "HTML-pre: 1. embedded newlines [1,0,[3],2,0,4,0]", "<pre 
data-foobar=\"kvsknufiw5r0be29\">foo</pre>\n\n<pre></pre>7p6kn1agspz4zpvi\n\n<pre>\n\nfoo\n</pre>2twixsqcqcdz33di<pre>\n\n\nfoo\n</pre>");
+add("selser", "HTML-pre: 1. embedded newlines [3,4,0,2,[2],2,0]", 
"nim3za9ozlbrcnmi<pre>\nfoo\n</pre>koxtspk32wy4lsor\n\n<pre>\nynbta1tvwb2ihpvi\n\nfoo\n</pre>p5swahop2odvaemi\n\n<pre>\n\n\nfoo\n</pre>");
+add("selser", "HTML-pre: 1. embedded newlines [3,3,[4],0,2,0,0]", 
"<pre>\np0m4t3dnzfy4aemi</pre>\n\nmsu9dui46ci60f6r<pre>\n\nfoo\n</pre>\n\n<pre>\n\n\nfoo\n</pre>");
+add("selser", "HTML-pre: 1. embedded newlines [3,0,[4],0,0,4,1]", 
"\n<pre>\ns5ra0cvipxupu8fr</pre>\n\n<pre>\n\nfoo\n</pre>iwz2oe53lrkvs4i<pre 
data-foobar=\"huyxanakkkai3sor\">\n\n\n\nfoo\n</pre>");
+add("selser", "HTML-pre: 1. embedded newlines [[3],0,4,4,0,3,0]", 
"<pre></pre>\n\n2i7gv3l5160tfbt9\n\nmslng73m18h3erk9<pre>\n\nfoo\n</pre><pre>\n\n\nfoo\n</pre>");
+add("selser", "HTML-pre: 1. embedded newlines [1,3,[4],0,0,4,0]", "<pre 
data-foobar=\"sj99wm8a06swcdi\">foo</pre><pre>\n1we472nofuu40a4i</pre>\n\n<pre>\n\nfoo\n</pre>svvaorx28q7low29<pre>\n\n\nfoo\n</pre>");
+add("selser", "HTML-pre: 1. embedded newlines [3,3,2,3,0,0,4]", 
"loo7vldvy5zmpldi<pre>\nfoo\n</pre><pre>\n\nfoo\n</pre>\n\nom1yxjr2i6v18aor\n");
+add("selser", "HTML-pre: 1. embedded newlines [0,0,0,0,0,3,0]", 
"<pre>foo</pre>\n\n<pre>\nfoo\n</pre>\n\n<pre>\n\nfoo\n</pre><pre>\n\n\nfoo\n</pre>");
+add("selser", "HTML-pre: 1. embedded newlines [[3],2,0,3,1,0,[2]]", 
"<pre></pre>5ybgleb22vhg2e29\n\n<pre>\nfoo\n</pre><pre 
data-foobar=\"9rnpnxw85n17zaor\">\n\n\nfoo\n</pre>\n\n<pre>\nqz3itjpijx2prpb9\n\n\nfoo\n</pre>");
+add("selser", "HTML-pre: 1. embedded newlines [2,0,3,0,[4],0,0]", 
"xvvz4gdwxw8nnrk9<pre>foo</pre>\n\n<pre>\nacu3bk7ah3o0qkt9</pre>\n\n<pre>\n\n\nfoo\n</pre>");
+add("selser", "HTML-pre: 1. embedded newlines [[4],2,0,2,2,4,0]", 
"<pre>c613gzfv9dfe0zfr</pre>lhlr94vff88e61or\n\n<pre>\nfoo\n</pre>mfsobz59io83erk9\n\no2f5l4qjshwoecdi<pre>\n\nfoo\n</pre>rjbnuw3teafqd7vi<pre>\n\n\nfoo\n</pre>");
+add("selser", "HTML-pre: 1. embedded newlines [0,4,0,2,0,0,1]", 
"<pre>foo</pre>bvrbszgeukgldi<pre>\nfoo\n</pre>39mozh6gsfh41jor\n\n<pre>\n\nfoo\n</pre>\n\n<pre
 data-foobar=\"4id8x594m1xxbt9\">\n\n\n\nfoo\n</pre>");
+add("selser", "HTML-pre: 1. embedded newlines [0,0,[2],3,0,4,4]", 
"<pre>foo</pre>\n\n<pre>\ne0n9rheg4wapp66r\nfoo\n</pre><pre>\n\nfoo\n</pre>u55s78otyh4fs9k9\n\n1kdsfhrjln1urf6r\n");
+add("selser", "HTML-pre: 1. embedded newlines [0,3,[4],3,0,3,[2]]", 
"<pre>foo</pre><pre>\n83p20wqg5ddt2o6r</pre><pre>\n\nfoo\n</pre><pre>\nsmpset4n6tzhyqfr\n\n\nfoo\n</pre>");
+add("selser", "HTML-pre: big spaces [2]", 
"pr1fskewynak0529<pre>\n\n\n\n\nhaha\n\n\n\n\nhaha\n\n\n\n\n</pre>");
+add("selser", "HTML-pre: 2: indented text [2]", "ydtzgmk7fmie8kt9<pre>\n 
foo\n</pre>");
+add("selser", "HTML-pre: 3: other wikitext [2]", "xdd7unxnjwk7f1or<pre>\n* 
foo\n# bar\n= no-h =\n'' no-italic ''\n[[ NoLink ]]\n</pre>");
 add("selser", "Definition lists: self-closed tag [2]", 
"x14l42v2vh392j4i\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]]]", 
";hfmudey4je6u5wmi18aco6b1yahy3nmi<br/>199ekjza5e7phkt9 :b3ubf9dln2x7ds4i 
two-line fun");

-- 
To view, visit https://gerrit.wikimedia.org/r/315644
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I45ffb07723a6842be6a39d52ab0165676536be0a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <abrea...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to