Folding for tests.js
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Sun, 19 Jun 2011 10:15:13 -0600
changeset 288 f4f42eeb6c35
parent 287 cd35d1aab6a5
child 289 ab23b599b7f1
Folding for tests.js

I hope if anyone takes over maintenance of this stuff from me, they're
using something compatible with vim.
tests.js
--- a/tests.js	Sun Jun 19 10:04:04 2011 -0600
+++ b/tests.js	Sun Jun 19 10:15:13 2011 -0600
@@ -1,5 +1,6 @@
 // Alert the reader of egregious Opera bug that will make the specced
 // implementation horribly buggy
+//@{
 (function() {
 	var div = document.createElement("div");
 	div.appendChild(document.createElement("br"));
@@ -17,8 +18,10 @@
 	}
 	div.parentNode.removeChild(div);
 })();
+//@}
 
 // Insert the toolbar thingie as soon as the script file is loaded
+//@{
 (function() {
 	var toolbarDiv = document.createElement("div");
 	toolbarDiv.id = "toolbar";
@@ -29,12 +32,14 @@
 
 	document.body.appendChild(toolbarDiv);
 })();
+//@}
 
 // Confusingly, we're storing a string here, not a boolean.
 document.querySelector("#alert-checkbox").checked = localStorage["display-alerts"] != "false";
 document.querySelector("#browser-checkbox").checked = localStorage["display-browser-tests"] != "false";
 
 function updateAlertRowStyle() {
+//@{
 	var checked = document.querySelector("#alert-checkbox").checked;
 	var style = document.querySelector("#alerts");
 	if (checked && !/^\/\*/.test(style.textContent)) {
@@ -44,12 +49,14 @@
 	}
 	localStorage["display-alerts"] = checked;
 }
+//@}
 updateAlertRowStyle();
 
 // Feature-test whether the browser wraps at <wbr> or not, and set word-wrap:
 // break-word where necessary if not.  (IE and Opera don't wrap, Gecko and
 // WebKit do.)  word-wrap: break-word will break anywhere at all, so it looks
 // significantly uglier.
+//@{
 (function() {
 	var wordWrapTestDiv = document.createElement("div");
 	wordWrapTestDiv.style.width = "5em";
@@ -63,10 +70,12 @@
 		document.body.className += " wbr-workaround";
 	}
 })();
+//@}
 
 // Now for the meat of the file.
 var tests = {
 	backcolor: [
+	//@{
 		'foo[]bar',
 		'<span>foo</span>{}<span>bar</span>',
 		'<span>foo[</span><span>]bar</span>',
@@ -86,7 +95,9 @@
 		'<p>[foo</p><p>bar]</p>',
 		'<p>foo[bar<i>baz]qoz</i>quz',
 	],
+	//@}
 	bold: [
+	//@{
 		'foo[]bar',
 		'<span>foo</span>{}<span>bar</span>',
 		'<span>foo[</span><span>]bar</span>',
@@ -194,7 +205,9 @@
 
 		'<p style="font-weight: bold">foo[bar]baz</p>',
 	],
+	//@}
 	createlink: [
+	//@{
 		'foo[]bar',
 		'<span>foo</span>{}<span>bar</span>',
 		'<span>foo[</span><span>]bar</span>',
@@ -243,10 +256,12 @@
 		'<a name=abc>foo[bar]baz</a>',
 		'<a name=abc><b>foo[bar]baz</b></a>',
 	],
+	//@}
 	// Opera requires this to be quoted, contrary to ES5 11.1.5 which allows
 	// PropertyName to be any IdentifierName, and see 7.6 which defines
 	// IdentifierName to include ReservedWord; Identifier excludes it.
 	"delete": [
+	//@{
 		// Collapsed selection
 		//
 		// These three commented-out test call Firefox 5.0a2 to blow up, not
@@ -464,7 +479,9 @@
 		'<dl><dt>foo[<dt>]bar<dd>baz</dl>',
 		'<dl><dt>foo<dd>bar[<dd>]baz</dl>',
 	],
+	//@}
 	fontname: [
+	//@{
 		'foo[]bar',
 		'<span>foo</span>{}<span>bar</span>',
 		'<span>foo[</span><span>]bar</span>',
@@ -519,7 +536,9 @@
 		'foo<span style="font-family: monospace">[bar]</span>baz',
 		'foo<span style="font-family: monospace">b[a]r</span>baz',
 	],
+	//@}
 	fontsize: [
+	//@{
 		'foo[]bar',
 		'<span>foo</span>{}<span>bar</span>',
 		'<span>foo[</span><span>]bar</span>',
@@ -597,7 +616,9 @@
 		["3", 'foo<small>[bar]</small>baz'],
 		["3", 'foo<small>b[a]r</small>baz'],
 	],
+	//@}
 	forecolor: [
+	//@{
 		'foo[]bar',
 		'<span>foo</span>{}<span>bar</span>',
 		'<span>foo[</span><span>]bar</span>',
@@ -647,7 +668,9 @@
 		'foo<span id=purple>ba[r</span>ba]z',
 		'<span style="color: rgb(255, 0, 0)">foo<span id=purple>b[a]r</span>baz</span>',
 	],
+	//@}
 	formatblock: [
+	//@{
 		'foo[]bar<p>extra',
 		'<span>foo</span>{}<span>bar</span><p>extra',
 		'<span>foo[</span><span>]bar</span><p>extra',
@@ -870,7 +893,9 @@
 		['<p>', '<xmp>[foo]</xmp>'],
 		['<div>', '<xmp>[foo]</xmp>'],
 	],
+	//@}
 	forwarddelete: [
+	//@{
 		// Collapsed selection
 		'foo[]',
 		'<span>foo[]</span>',
@@ -1069,7 +1094,9 @@
 		'<dl><dt>foo[<dt>]bar<dd>baz</dl>',
 		'<dl><dt>foo<dd>bar[<dd>]baz</dl>',
 	],
+	//@}
 	hilitecolor: [
+	//@{
 		'foo[]bar',
 		'<span>foo</span>{}<span>bar</span>',
 		'<span>foo[</span><span>]bar</span>',
@@ -1097,7 +1124,9 @@
 		'<div style="background-color: #ff8888"><p style="background-color: aqua">b[ar]</p></div>',
 		'<span style="display: block; background-color: #ff8888"><span style="display: block; background-color: aqua">b[ar]</span></span>',
 	],
+	//@}
 	indent: [
+	//@{
 		// All these have a trailing unselected paragraph, because otherwise
 		// Gecko is unhappy: it throws exceptions in non-CSS mode, and in CSS
 		// mode it adds the indentation invisibly to the wrapper div in many
@@ -1243,7 +1272,9 @@
 		'<ol><li>foo<ol><li>bar</ol>[baz]</ol>',
 		'<ol><li>[foo<ol><li>bar]</ol>baz</ol>',
 	],
+	//@}
 	inserthorizontalrule: [
+	//@{
 		'foo[]bar',
 		'<span>foo</span>{}<span>bar</span>',
 		'<span>foo[</span><span>]bar</span>',
@@ -1342,7 +1373,9 @@
 
 		'<quasit>foo[bar]baz</quasit>',
 	],
+	//@}
 	inserthtml: [
+	//@{
 		'foo[]bar',
 		'foo[bar]baz',
 		['<b>', 'foo[bar]baz'],
@@ -1389,7 +1422,9 @@
 		['<nobr>abc</nobr>', '<nobr>f[o]o</nobr>'],
 		['<nobr>abc</nobr>', 'f[o]o'],
 	],
+	//@}
 	insertimage: [
+	//@{
 		'foo[]bar',
 		'<span>foo</span>{}<span>bar</span>',
 		'<span>foo[</span><span>]bar</span>',
@@ -1437,303 +1472,9 @@
 		'<div><p>foo</p>bar[</div>]baz',
 		'<div>foo<p>bar[</p></div>]baz',
 	],
+	//@}
 	insertorderedlist: [
-		'foo[]bar',
-		'<span>foo</span>{}<span>bar</span>',
-		'<span>foo[</span><span>]bar</span>',
-		'foo[bar]baz',
-		'foo]bar[baz',
-		'{<p><p> <p>foo</p>}',
-		'foo[bar<b>baz]qoz</b>quz',
-		'foo<br>[bar]',
-		'f[oo<br>b]ar<br>baz',
-		'<p>[foo]<br>bar</p>',
-		'[foo<ol><li>bar]</ol>baz',
-		'foo<ol><li>[bar</ol>baz]',
-		'[foo<ul><li>bar]</ul>baz',
-		'foo<ul><li>[bar</ul>baz]',
-		'foo<ul><li>[bar</ul><ol><li>baz]</ol>quz',
-		'foo<ol><li>[bar</ol><ul><li>baz]</ul>quz',
-
-		'<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>',
-		'<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>',
-		'<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>',
-		'<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>',
-		'<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>',
-		'{<table><tr><td>foo<td>bar<td>baz</table>}',
-
-		'<p>foo<p>[bar]<p>baz',
-		'<p>foo<blockquote>[bar]</blockquote><p>baz',
-		'<dl><dt>foo<dd>[bar]<dt>baz<dd>quz</dl>',
-		'<dl><dt>foo<dd>bar<dt>[baz]<dd>quz</dl>',
-
-		'<p>foo<p>b[a]r<p>baz',
-		'<p>foo<blockquote>b[a]r</blockquote><p>baz',
-		'<dl><dt>foo<dd>b[a]r<dt>baz<dd>quz</dl>',
-		'<dl><dt>foo<dd>bar<dt>b[a]z<dd>quz</dl>',
-
-		'<p>[foo<p>bar]<p>baz',
-		'<p>[foo<blockquote>bar]</blockquote><p>baz',
-		'<dl><dt>[foo<dd>bar]<dt>baz<dd>quz</dl>',
-		'<dl><dt>foo<dd>[bar<dt>baz]<dd>quz</dl>',
-
-		'<p>[foo<blockquote><p>bar]<p>baz</blockquote>',
-
-
-		// Various <ol> stuff
-		'<ol><li>foo<li>[bar]<li>baz</ol>',
-		'<ol data-start=1 data-end=2><li>foo<li>bar<li>baz</ol>',
-		'<ol><li>foo</ol>[bar]',
-		'[foo]<ol><li>bar</ol>',
-		'<ol><li>foo</ol>[bar]<ol><li>baz</ol>',
-		'<ol><ol><li>[foo]</ol></ol>',
-		'<ol><li>[foo]<br>bar<li>baz</ol>',
-		'<ol><li>foo<br>[bar]<li>baz</ol>',
-		'<ol><li><div>[foo]</div>bar<li>baz</ol>',
-		'<ol><li>foo<ol><li>[bar]<li>baz</ol><li>quz</ol>',
-		'<ol><li>foo<ol><li>bar<li>[baz]</ol><li>quz</ol>',
-		'<ol><li>foo</li><ol><li>[bar]<li>baz</ol><li>quz</ol>',
-		'<ol><li>foo</li><ol data-start=0 data-end=1><li>bar<li>baz</ol><li>quz</ol>',
-		'<ol><li>foo</li><ol><li>bar<li>[baz]</ol><li>quz</ol>',
-		'<ol><li>foo</li><ol data-start=1 data-end=2><li>bar<li>baz</ol><li>quz</ol>',
-		'<ol><li>foo<ol><li>b[a]r</ol><li>baz</ol>',
-		'<ol><li>foo</li><ol><li>b[a]r</ol><li>baz</ol>',
-		'<ol><li>foo{<ol><li>bar</ol>}<li>baz</ol>',
-		'<ol><li>foo</li>{<ol><li>bar</ol>}<li>baz</ol>',
-		'<ol><li>[foo]<ol><li>bar</ol><li>baz</ol>',
-		'<ol><li>[foo]</li><ol><li>bar</ol><li>baz</ol>',
-		'<ol><li>foo<li>[bar]<ol><li>baz</ol><li>quz</ol>',
-		'<ol><li>foo<li>[bar]</li><ol><li>baz</ol><li>quz</ol>',
-		'<ol><li>foo<ol><li>bar<li>baz</ol><li>[quz]</ol>',
-		'<ol><li>foo</li><ol><li>bar<li>baz</ol><li>[quz]</ol>',
-
-		// Multiple items at once.
-		'<ol><li>foo<li>b[ar<li>baz]</ol>',
-		'<ol><li>[foo<ol><li>bar]</ol><li>baz</ol>',
-		'<ol><li>[foo</li><ol><li>bar]</ol><li>baz</ol>',
-		'<ol><li>foo<ol><li>b[ar</ol><li>b]az</ol>',
-		'<ol><li>foo</li><ol><li>b[ar</ol><li>b]az</ol>',
-		'<ol><li>[foo<ol><li>bar</ol><li>baz]</ol><p>extra',
-		'<ol><li>[foo</li><ol><li>bar</ol><li>baz]</ol><p>extra',
-		'<ol><li>foo<li>[bar</li><ol><li>baz</ol><li>quz]</ol>',
-
-		// We probably can't actually get this DOM . . .
-		'<ol><li>[foo]<ol><li>bar</ol>baz</ol>',
-		'<ol><li>foo<ol><li>[bar]</ol>baz</ol>',
-		'<ol><li>foo<ol><li>bar</ol>[baz]</ol>',
-		'<ol><li>[foo<ol><li>bar]</ol>baz</ol>',
-
-
-		// Same stuff but with <ul>
-		'<ul><li>foo<li>[bar]<li>baz</ul>',
-		'<ol data-start=1 data-end=2><li>foo<li>bar<li>baz</ul>',
-		'<ul><li>foo</ul>[bar]',
-		'[foo]<ul><li>bar</ul>',
-		'<ul><li>foo</ul>[bar]<ul><li>baz</ul>',
-		'<ul><ul><li>[foo]</ul></ul>',
-		'<ul><li>[foo]<br>bar<li>baz</ul>',
-		'<ul><li>foo<br>[bar]<li>baz</ul>',
-		'<ul><li><div>[foo]</div>bar<li>baz</ul>',
-		'<ul><li>foo<ul><li>[bar]<li>baz</ul><li>quz</ul>',
-		'<ul><li>foo<ul><li>bar<li>[baz]</ul><li>quz</ul>',
-		'<ul><li>foo</li><ul><li>[bar]<li>baz</ul><li>quz</ul>',
-		'<ul><li>foo</li><ul data-start=0 data-end=1><li>bar<li>baz</ul><li>quz</ul>',
-		'<ul><li>foo</li><ul><li>bar<li>[baz]</ul><li>quz</ul>',
-		'<ul><li>foo</li><ul data-start=1 data-end=2><li>bar<li>baz</ul><li>quz</ul>',
-		'<ul><li>foo<ul><li>b[a]r</ul><li>baz</ul>',
-		'<ul><li>foo</li><ul><li>b[a]r</ul><li>baz</ul>',
-		'<ul><li>foo{<ul><li>bar</ul>}<li>baz</ul>',
-		'<ul><li>foo</li>{<ul><li>bar</ul>}<li>baz</ul>',
-		'<ul><li>[foo]<ul><li>bar</ul><li>baz</ul>',
-		'<ul><li>[foo]</li><ul><li>bar</ul><li>baz</ul>',
-		'<ul><li>foo<li>[bar]<ul><li>baz</ul><li>quz</ul>',
-		'<ul><li>foo<li>[bar]</li><ul><li>baz</ul><li>quz</ul>',
-		'<ul><li>foo<ul><li>bar<li>baz</ul><li>[quz]</ul>',
-		'<ul><li>foo</li><ul><li>bar<li>baz</ul><li>[quz]</ul>',
-
-		// Multiple items at once.
-		'<ul><li>foo<li>b[ar<li>baz]</ul>',
-		'<ul><li>[foo<ul><li>bar]</ul><li>baz</ul>',
-		'<ul><li>[foo</li><ul><li>bar]</ul><li>baz</ul>',
-		'<ul><li>foo<ul><li>b[ar</ul><li>b]az</ul>',
-		'<ul><li>foo</li><ul><li>b[ar</ul><li>b]az</ul>',
-		'<ul><li>[foo<ul><li>bar</ul><li>baz]</ul><p>extra',
-		'<ul><li>[foo</li><ul><li>bar</ul><li>baz]</ul><p>extra',
-		'<ul><li>foo<li>[bar</li><ul><li>baz</ul><li>quz]</ul>',
-
-		// We probably can't actually get this DOM . . .
-		'<ul><li>[foo]<ul><li>bar</ul>baz</ul>',
-		'<ul><li>foo<ul><li>[bar]</ul>baz</ul>',
-		'<ul><li>foo<ul><li>bar</ul>[baz]</ul>',
-		'<ul><li>[foo<ul><li>bar]</ul>baz</ul>',
-
-
-		// Mix of <ol> and <ul>
-		'foo<ol><li>bar</ol><ul><li>[baz]</ul>quz',
-		'foo<ol><li>bar</ol><ul><li>[baz</ul>quz]',
-		'foo<ul><li>[bar]</ul><ol><li>baz</ol>quz',
-		'[foo<ul><li>bar]</ul><ol><li>baz</ol>quz',
-		'<ol><li>foo</li><ul><li>[bar]</ul><li>baz</ol>',
-		'<ul><li>foo</li><ol><li>[bar]</ol><li>baz</ul>',
-
-		// Interaction with indentation
-		'[foo]<blockquote>bar</blockquote>baz',
-		'foo<blockquote>[bar]</blockquote>baz',
-		'[foo<blockquote>bar]</blockquote>baz',
-		'<ol><li>foo</ol><blockquote>[bar]</blockquote>baz',
-		'[foo]<blockquote><ol><li>bar</ol></blockquote>baz',
-		'foo<blockquote>[bar]<br>baz</blockquote>',
-		'[foo<blockquote>bar]<br>baz</blockquote>',
-		'<ol><li>foo</ol><blockquote>[bar]<br>baz</blockquote>',
-
-		'<p>[foo]<blockquote><p>bar</blockquote><p>baz',
-		'<p>foo<blockquote><p>[bar]</blockquote><p>baz',
-		'<p>[foo<blockquote><p>bar]</blockquote><p>baz',
-		'<ol><li>foo</ol><blockquote><p>[bar]</blockquote><p>baz',
-		'<p>[foo]<blockquote><ol><li><p>bar</ol></blockquote><p>baz',
-		'<p>foo<blockquote><p>[bar]<p>baz</blockquote>',
-		'<p>[foo<blockquote><p>bar]<p>baz</blockquote>',
-		'<ol><li>foo</ol><blockquote><p>[bar]<p>baz</blockquote>',
-
-		'[foo]<div style="margin: 0 40px">bar</div>baz',
-		'foo<div style="margin: 0 40px">[bar]</div>baz',
-		'[foo<div style="margin: 0 40px">bar]</div>baz',
-		'<ol><li>foo</ol><div style="margin: 0 40px">[bar]</div>baz',
-		'[foo]<div style="margin: 0 40px"><ol><li>bar</ol></div>baz',
-		'foo<div style="margin: 0 40px">[bar]<br>baz</div>',
-		'[foo<div style="margin: 0 40px">bar]<br>baz</div>',
-		'<ol><li>foo</ol><div style="margin: 0 40px">[bar]<br>baz</div>',
-
-		'<p>[foo]<div style="margin: 0 40px"><p>bar</div><p>baz',
-		'<p>foo<div style="margin: 0 40px"><p>[bar]</div><p>baz',
-		'<p>[foo<div style="margin: 0 40px"><p>bar]</div><p>baz',
-		'<ol><li>foo</ol><div style="margin: 0 40px"><p>[bar]</div><p>baz',
-		'<p>[foo]<div style="margin: 0 40px"><ol><li><p>bar</ol></div><p>baz',
-		'<p>foo<div style="margin: 0 40px"><p>[bar]<p>baz</div>',
-		'<p>[foo<div style="margin: 0 40px"><p>bar]<p>baz</div>',
-		'<ol><li>foo</ol><div style="margin: 0 40px"><p>[bar]<p>baz</div>',
-
-		// Attributes
-		'<ul id=abc><li>foo<li>[bar]<li>baz</ul>',
-		'<ul style=color:red><li>foo<li>[bar]<li>baz</ul>',
-		'<ul style=text-indent:1em><li>foo<li>[bar]<li>baz</ul>',
-		'<ul id=abc><li>[foo]<li>bar<li>baz</ul>',
-		'<ul style=color:red><li>[foo]<li>bar<li>baz</ul>',
-		'<ul style=text-indent:1em><li>[foo]<li>bar<li>baz</ul>',
-		'<ul id=abc><li>foo<li>bar<li>[baz]</ul>',
-		'<ul style=color:red><li>foo<li>bar<li>[baz]</ul>',
-		'<ul style=text-indent:1em><li>foo<li>bar<li>[baz]</ul>',
-	],
-	insertparagraph: [
-		'foo[bar]baz',
-		'fo[o<table><tr><td>b]ar</table>',
-		'<table><tr><td>[foo<td>bar]<tr><td>baz<td>quz</table>',
-		'<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<tr><td>baz<td>quz</table>',
-		'<table><tr><td>fo[o</table>b]ar',
-		'<table><tr><td>fo[o<td>b]ar<td>baz</table>',
-		'{<table><tr><td>foo</table>}',
-		'<table><tr><td>[foo]</table>',
-		'<ol><li>[foo]<li>bar</ol>',
-		'<ol><li>f[o]o<li>bar</ol>',
-
-		'[]foo',
-		'foo[]',
-		'foo[]<br>',
-		'foo[]bar',
-		'<address>[]foo</address>',
-		'<address>foo[]</address>',
-		'<address>foo[]<br></address>',
-		'<address>foo[]bar</address>',
-		'<div>[]foo</div>',
-		'<div>foo[]</div>',
-		'<div>foo[]<br></div>',
-		'<div>foo[]bar</div>',
-		'<dl><dt>[]foo<dd>bar</dl>',
-		'<dl><dt>foo[]<dd>bar</dl>',
-		'<dl><dt>foo[]<br><dd>bar</dl>',
-		'<dl><dt>foo[]bar<dd>baz</dl>',
-		'<dl><dt>foo<dd>[]bar</dl>',
-		'<dl><dt>foo<dd>bar[]</dl>',
-		'<dl><dt>foo<dd>bar[]<br></dl>',
-		'<dl><dt>foo<dd>bar[]baz</dl>',
-		'<h1>[]foo</h1>',
-		'<h1>foo[]</h1>',
-		'<h1>foo[]<br></h1>',
-		'<h1>foo[]bar</h1>',
-		'<ol><li>[]foo</ol>',
-		'<ol><li>foo[]</ol>',
-		'<ol><li>foo[]<br></ol>',
-		'<ol><li>foo[]bar</ol>',
-		'<p>[]foo</p>',
-		'<p>foo[]</p>',
-		'<p>foo[]<br></p>',
-		'<p>foo[]bar</p>',
-		'<pre>[]foo</pre>',
-		'<pre>foo[]</pre>',
-		'<pre>foo[]<br></pre>',
-		'<pre>foo[]bar</pre>',
-
-		'<pre>foo[]<br><br></pre>',
-		'<pre>foo<br>{}<br></pre>',
-		'<pre>foo&#10;[]</pre>',
-		'<pre>foo[]&#10;</pre>',
-		'<pre>foo&#10;[]&#10;</pre>',
-
-		'<ol><li>{}<br></li></ol>',
-		'foo<ol><li>{}<br></li></ol>',
-		'<ol><li>{}<br></li></ol>foo',
-		'<ol><li>foo<li>{}<br></ol>',
-		'<ol><li>{}<br><li>bar</ol>',
-		'<ol><li>foo</li><ul><li>{}<br></ul></ol>',
-
-		'<dl><dt>{}<br></dt></dl>',
-		'<dl><dt>foo<dd>{}<br></dl>',
-		'<dl><dt>{}<br><dd>bar</dl>',
-
-		'<h1>foo[bar</h1><p>baz]quz</p>',
-		'<p>foo[bar</p><h1>baz]quz</h1>',
-		'<p>foo</p>{}<br>',
-		'{}<br><p>foo</p>',
-		'<p>foo</p>{}<br><h1>bar</h1>',
-		'<h1>foo</h1>{}<br><p>bar</p>',
-		'<h1>foo</h1>{}<br><h2>bar</h2>',
-		'<p>foo</p><h1>[bar]</h1><p>baz</p>',
-		'<p>foo</p>{<h1>bar</h1>}<p>baz</p>',
-
-		'<table><tr><td>foo[]bar</table>',
-		'<table><tr><td><p>foo[]bar</table>',
-
-		'<blockquote>[]foo</blockquote>',
-		'<blockquote>foo[]</blockquote>',
-		'<blockquote>foo[]<br></blockquote>',
-		'<blockquote>foo[]bar</blockquote>',
-		'<blockquote><p>[]foo</blockquote>',
-		'<blockquote><p>foo[]</blockquote>',
-		'<blockquote><p>foo[]bar</blockquote>',
-		'<blockquote><p>foo[]<p>bar</blockquote>',
-		'<blockquote><p>foo[]bar<p>baz</blockquote>',
-
-		'<span>foo[]bar</span>',
-		'<span>foo[]bar</span>baz',
-		'<b>foo[]bar</b>',
-		'<b>foo[]bar</b>baz',
-		'<b>foo[]</b>bar',
-		'foo<b>[]bar</b>',
-		'<b>foo[]</b><i>bar</i>',
-		'<b id=x class=y>foo[]bar</b>',
-		'<i><b>foo[]bar</b>baz</i>',
-
-		'<p><b>foo[]bar</b></p>',
-		'<p><b>[]foo</b></p>',
-		'<p><b id=x class=y>foo[]bar</b></p>',
-		'<div><b>foo[]bar</b></div>',
-
-		'<a href=foo>foo[]bar</a>',
-		'<a href=foo>foo[]bar</a>baz',
-		'<a href=foo>foo[]</a>bar',
-		'foo<a href=foo>[]bar</a>',
-	],
-	insertunorderedlist: [
+	//@{
 		'foo[]bar',
 		'<span>foo</span>{}<span>bar</span>',
 		'<span>foo[</span><span>]bar</span>',
@@ -1920,7 +1661,309 @@
 		'<ul style=color:red><li>foo<li>bar<li>[baz]</ul>',
 		'<ul style=text-indent:1em><li>foo<li>bar<li>[baz]</ul>',
 	],
+	//@}
+	insertparagraph: [
+	//@{
+		'foo[bar]baz',
+		'fo[o<table><tr><td>b]ar</table>',
+		'<table><tr><td>[foo<td>bar]<tr><td>baz<td>quz</table>',
+		'<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<tr><td>baz<td>quz</table>',
+		'<table><tr><td>fo[o</table>b]ar',
+		'<table><tr><td>fo[o<td>b]ar<td>baz</table>',
+		'{<table><tr><td>foo</table>}',
+		'<table><tr><td>[foo]</table>',
+		'<ol><li>[foo]<li>bar</ol>',
+		'<ol><li>f[o]o<li>bar</ol>',
+
+		'[]foo',
+		'foo[]',
+		'foo[]<br>',
+		'foo[]bar',
+		'<address>[]foo</address>',
+		'<address>foo[]</address>',
+		'<address>foo[]<br></address>',
+		'<address>foo[]bar</address>',
+		'<div>[]foo</div>',
+		'<div>foo[]</div>',
+		'<div>foo[]<br></div>',
+		'<div>foo[]bar</div>',
+		'<dl><dt>[]foo<dd>bar</dl>',
+		'<dl><dt>foo[]<dd>bar</dl>',
+		'<dl><dt>foo[]<br><dd>bar</dl>',
+		'<dl><dt>foo[]bar<dd>baz</dl>',
+		'<dl><dt>foo<dd>[]bar</dl>',
+		'<dl><dt>foo<dd>bar[]</dl>',
+		'<dl><dt>foo<dd>bar[]<br></dl>',
+		'<dl><dt>foo<dd>bar[]baz</dl>',
+		'<h1>[]foo</h1>',
+		'<h1>foo[]</h1>',
+		'<h1>foo[]<br></h1>',
+		'<h1>foo[]bar</h1>',
+		'<ol><li>[]foo</ol>',
+		'<ol><li>foo[]</ol>',
+		'<ol><li>foo[]<br></ol>',
+		'<ol><li>foo[]bar</ol>',
+		'<p>[]foo</p>',
+		'<p>foo[]</p>',
+		'<p>foo[]<br></p>',
+		'<p>foo[]bar</p>',
+		'<pre>[]foo</pre>',
+		'<pre>foo[]</pre>',
+		'<pre>foo[]<br></pre>',
+		'<pre>foo[]bar</pre>',
+
+		'<pre>foo[]<br><br></pre>',
+		'<pre>foo<br>{}<br></pre>',
+		'<pre>foo&#10;[]</pre>',
+		'<pre>foo[]&#10;</pre>',
+		'<pre>foo&#10;[]&#10;</pre>',
+
+		'<ol><li>{}<br></li></ol>',
+		'foo<ol><li>{}<br></li></ol>',
+		'<ol><li>{}<br></li></ol>foo',
+		'<ol><li>foo<li>{}<br></ol>',
+		'<ol><li>{}<br><li>bar</ol>',
+		'<ol><li>foo</li><ul><li>{}<br></ul></ol>',
+
+		'<dl><dt>{}<br></dt></dl>',
+		'<dl><dt>foo<dd>{}<br></dl>',
+		'<dl><dt>{}<br><dd>bar</dl>',
+
+		'<h1>foo[bar</h1><p>baz]quz</p>',
+		'<p>foo[bar</p><h1>baz]quz</h1>',
+		'<p>foo</p>{}<br>',
+		'{}<br><p>foo</p>',
+		'<p>foo</p>{}<br><h1>bar</h1>',
+		'<h1>foo</h1>{}<br><p>bar</p>',
+		'<h1>foo</h1>{}<br><h2>bar</h2>',
+		'<p>foo</p><h1>[bar]</h1><p>baz</p>',
+		'<p>foo</p>{<h1>bar</h1>}<p>baz</p>',
+
+		'<table><tr><td>foo[]bar</table>',
+		'<table><tr><td><p>foo[]bar</table>',
+
+		'<blockquote>[]foo</blockquote>',
+		'<blockquote>foo[]</blockquote>',
+		'<blockquote>foo[]<br></blockquote>',
+		'<blockquote>foo[]bar</blockquote>',
+		'<blockquote><p>[]foo</blockquote>',
+		'<blockquote><p>foo[]</blockquote>',
+		'<blockquote><p>foo[]bar</blockquote>',
+		'<blockquote><p>foo[]<p>bar</blockquote>',
+		'<blockquote><p>foo[]bar<p>baz</blockquote>',
+
+		'<span>foo[]bar</span>',
+		'<span>foo[]bar</span>baz',
+		'<b>foo[]bar</b>',
+		'<b>foo[]bar</b>baz',
+		'<b>foo[]</b>bar',
+		'foo<b>[]bar</b>',
+		'<b>foo[]</b><i>bar</i>',
+		'<b id=x class=y>foo[]bar</b>',
+		'<i><b>foo[]bar</b>baz</i>',
+
+		'<p><b>foo[]bar</b></p>',
+		'<p><b>[]foo</b></p>',
+		'<p><b id=x class=y>foo[]bar</b></p>',
+		'<div><b>foo[]bar</b></div>',
+
+		'<a href=foo>foo[]bar</a>',
+		'<a href=foo>foo[]bar</a>baz',
+		'<a href=foo>foo[]</a>bar',
+		'foo<a href=foo>[]bar</a>',
+	],
+	//@}
+	insertunorderedlist: [
+	//@{
+		'foo[]bar',
+		'<span>foo</span>{}<span>bar</span>',
+		'<span>foo[</span><span>]bar</span>',
+		'foo[bar]baz',
+		'foo]bar[baz',
+		'{<p><p> <p>foo</p>}',
+		'foo[bar<b>baz]qoz</b>quz',
+		'foo<br>[bar]',
+		'f[oo<br>b]ar<br>baz',
+		'<p>[foo]<br>bar</p>',
+		'[foo<ol><li>bar]</ol>baz',
+		'foo<ol><li>[bar</ol>baz]',
+		'[foo<ul><li>bar]</ul>baz',
+		'foo<ul><li>[bar</ul>baz]',
+		'foo<ul><li>[bar</ul><ol><li>baz]</ol>quz',
+		'foo<ol><li>[bar</ol><ul><li>baz]</ul>quz',
+
+		'<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>',
+		'<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>',
+		'<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>',
+		'<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>',
+		'<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>',
+		'{<table><tr><td>foo<td>bar<td>baz</table>}',
+
+		'<p>foo<p>[bar]<p>baz',
+		'<p>foo<blockquote>[bar]</blockquote><p>baz',
+		'<dl><dt>foo<dd>[bar]<dt>baz<dd>quz</dl>',
+		'<dl><dt>foo<dd>bar<dt>[baz]<dd>quz</dl>',
+
+		'<p>foo<p>b[a]r<p>baz',
+		'<p>foo<blockquote>b[a]r</blockquote><p>baz',
+		'<dl><dt>foo<dd>b[a]r<dt>baz<dd>quz</dl>',
+		'<dl><dt>foo<dd>bar<dt>b[a]z<dd>quz</dl>',
+
+		'<p>[foo<p>bar]<p>baz',
+		'<p>[foo<blockquote>bar]</blockquote><p>baz',
+		'<dl><dt>[foo<dd>bar]<dt>baz<dd>quz</dl>',
+		'<dl><dt>foo<dd>[bar<dt>baz]<dd>quz</dl>',
+
+		'<p>[foo<blockquote><p>bar]<p>baz</blockquote>',
+
+
+		// Various <ol> stuff
+		'<ol><li>foo<li>[bar]<li>baz</ol>',
+		'<ol data-start=1 data-end=2><li>foo<li>bar<li>baz</ol>',
+		'<ol><li>foo</ol>[bar]',
+		'[foo]<ol><li>bar</ol>',
+		'<ol><li>foo</ol>[bar]<ol><li>baz</ol>',
+		'<ol><ol><li>[foo]</ol></ol>',
+		'<ol><li>[foo]<br>bar<li>baz</ol>',
+		'<ol><li>foo<br>[bar]<li>baz</ol>',
+		'<ol><li><div>[foo]</div>bar<li>baz</ol>',
+		'<ol><li>foo<ol><li>[bar]<li>baz</ol><li>quz</ol>',
+		'<ol><li>foo<ol><li>bar<li>[baz]</ol><li>quz</ol>',
+		'<ol><li>foo</li><ol><li>[bar]<li>baz</ol><li>quz</ol>',
+		'<ol><li>foo</li><ol data-start=0 data-end=1><li>bar<li>baz</ol><li>quz</ol>',
+		'<ol><li>foo</li><ol><li>bar<li>[baz]</ol><li>quz</ol>',
+		'<ol><li>foo</li><ol data-start=1 data-end=2><li>bar<li>baz</ol><li>quz</ol>',
+		'<ol><li>foo<ol><li>b[a]r</ol><li>baz</ol>',
+		'<ol><li>foo</li><ol><li>b[a]r</ol><li>baz</ol>',
+		'<ol><li>foo{<ol><li>bar</ol>}<li>baz</ol>',
+		'<ol><li>foo</li>{<ol><li>bar</ol>}<li>baz</ol>',
+		'<ol><li>[foo]<ol><li>bar</ol><li>baz</ol>',
+		'<ol><li>[foo]</li><ol><li>bar</ol><li>baz</ol>',
+		'<ol><li>foo<li>[bar]<ol><li>baz</ol><li>quz</ol>',
+		'<ol><li>foo<li>[bar]</li><ol><li>baz</ol><li>quz</ol>',
+		'<ol><li>foo<ol><li>bar<li>baz</ol><li>[quz]</ol>',
+		'<ol><li>foo</li><ol><li>bar<li>baz</ol><li>[quz]</ol>',
+
+		// Multiple items at once.
+		'<ol><li>foo<li>b[ar<li>baz]</ol>',
+		'<ol><li>[foo<ol><li>bar]</ol><li>baz</ol>',
+		'<ol><li>[foo</li><ol><li>bar]</ol><li>baz</ol>',
+		'<ol><li>foo<ol><li>b[ar</ol><li>b]az</ol>',
+		'<ol><li>foo</li><ol><li>b[ar</ol><li>b]az</ol>',
+		'<ol><li>[foo<ol><li>bar</ol><li>baz]</ol><p>extra',
+		'<ol><li>[foo</li><ol><li>bar</ol><li>baz]</ol><p>extra',
+		'<ol><li>foo<li>[bar</li><ol><li>baz</ol><li>quz]</ol>',
+
+		// We probably can't actually get this DOM . . .
+		'<ol><li>[foo]<ol><li>bar</ol>baz</ol>',
+		'<ol><li>foo<ol><li>[bar]</ol>baz</ol>',
+		'<ol><li>foo<ol><li>bar</ol>[baz]</ol>',
+		'<ol><li>[foo<ol><li>bar]</ol>baz</ol>',
+
+
+		// Same stuff but with <ul>
+		'<ul><li>foo<li>[bar]<li>baz</ul>',
+		'<ol data-start=1 data-end=2><li>foo<li>bar<li>baz</ul>',
+		'<ul><li>foo</ul>[bar]',
+		'[foo]<ul><li>bar</ul>',
+		'<ul><li>foo</ul>[bar]<ul><li>baz</ul>',
+		'<ul><ul><li>[foo]</ul></ul>',
+		'<ul><li>[foo]<br>bar<li>baz</ul>',
+		'<ul><li>foo<br>[bar]<li>baz</ul>',
+		'<ul><li><div>[foo]</div>bar<li>baz</ul>',
+		'<ul><li>foo<ul><li>[bar]<li>baz</ul><li>quz</ul>',
+		'<ul><li>foo<ul><li>bar<li>[baz]</ul><li>quz</ul>',
+		'<ul><li>foo</li><ul><li>[bar]<li>baz</ul><li>quz</ul>',
+		'<ul><li>foo</li><ul data-start=0 data-end=1><li>bar<li>baz</ul><li>quz</ul>',
+		'<ul><li>foo</li><ul><li>bar<li>[baz]</ul><li>quz</ul>',
+		'<ul><li>foo</li><ul data-start=1 data-end=2><li>bar<li>baz</ul><li>quz</ul>',
+		'<ul><li>foo<ul><li>b[a]r</ul><li>baz</ul>',
+		'<ul><li>foo</li><ul><li>b[a]r</ul><li>baz</ul>',
+		'<ul><li>foo{<ul><li>bar</ul>}<li>baz</ul>',
+		'<ul><li>foo</li>{<ul><li>bar</ul>}<li>baz</ul>',
+		'<ul><li>[foo]<ul><li>bar</ul><li>baz</ul>',
+		'<ul><li>[foo]</li><ul><li>bar</ul><li>baz</ul>',
+		'<ul><li>foo<li>[bar]<ul><li>baz</ul><li>quz</ul>',
+		'<ul><li>foo<li>[bar]</li><ul><li>baz</ul><li>quz</ul>',
+		'<ul><li>foo<ul><li>bar<li>baz</ul><li>[quz]</ul>',
+		'<ul><li>foo</li><ul><li>bar<li>baz</ul><li>[quz]</ul>',
+
+		// Multiple items at once.
+		'<ul><li>foo<li>b[ar<li>baz]</ul>',
+		'<ul><li>[foo<ul><li>bar]</ul><li>baz</ul>',
+		'<ul><li>[foo</li><ul><li>bar]</ul><li>baz</ul>',
+		'<ul><li>foo<ul><li>b[ar</ul><li>b]az</ul>',
+		'<ul><li>foo</li><ul><li>b[ar</ul><li>b]az</ul>',
+		'<ul><li>[foo<ul><li>bar</ul><li>baz]</ul><p>extra',
+		'<ul><li>[foo</li><ul><li>bar</ul><li>baz]</ul><p>extra',
+		'<ul><li>foo<li>[bar</li><ul><li>baz</ul><li>quz]</ul>',
+
+		// We probably can't actually get this DOM . . .
+		'<ul><li>[foo]<ul><li>bar</ul>baz</ul>',
+		'<ul><li>foo<ul><li>[bar]</ul>baz</ul>',
+		'<ul><li>foo<ul><li>bar</ul>[baz]</ul>',
+		'<ul><li>[foo<ul><li>bar]</ul>baz</ul>',
+
+
+		// Mix of <ol> and <ul>
+		'foo<ol><li>bar</ol><ul><li>[baz]</ul>quz',
+		'foo<ol><li>bar</ol><ul><li>[baz</ul>quz]',
+		'foo<ul><li>[bar]</ul><ol><li>baz</ol>quz',
+		'[foo<ul><li>bar]</ul><ol><li>baz</ol>quz',
+		'<ol><li>foo</li><ul><li>[bar]</ul><li>baz</ol>',
+		'<ul><li>foo</li><ol><li>[bar]</ol><li>baz</ul>',
+
+		// Interaction with indentation
+		'[foo]<blockquote>bar</blockquote>baz',
+		'foo<blockquote>[bar]</blockquote>baz',
+		'[foo<blockquote>bar]</blockquote>baz',
+		'<ol><li>foo</ol><blockquote>[bar]</blockquote>baz',
+		'[foo]<blockquote><ol><li>bar</ol></blockquote>baz',
+		'foo<blockquote>[bar]<br>baz</blockquote>',
+		'[foo<blockquote>bar]<br>baz</blockquote>',
+		'<ol><li>foo</ol><blockquote>[bar]<br>baz</blockquote>',
+
+		'<p>[foo]<blockquote><p>bar</blockquote><p>baz',
+		'<p>foo<blockquote><p>[bar]</blockquote><p>baz',
+		'<p>[foo<blockquote><p>bar]</blockquote><p>baz',
+		'<ol><li>foo</ol><blockquote><p>[bar]</blockquote><p>baz',
+		'<p>[foo]<blockquote><ol><li><p>bar</ol></blockquote><p>baz',
+		'<p>foo<blockquote><p>[bar]<p>baz</blockquote>',
+		'<p>[foo<blockquote><p>bar]<p>baz</blockquote>',
+		'<ol><li>foo</ol><blockquote><p>[bar]<p>baz</blockquote>',
+
+		'[foo]<div style="margin: 0 40px">bar</div>baz',
+		'foo<div style="margin: 0 40px">[bar]</div>baz',
+		'[foo<div style="margin: 0 40px">bar]</div>baz',
+		'<ol><li>foo</ol><div style="margin: 0 40px">[bar]</div>baz',
+		'[foo]<div style="margin: 0 40px"><ol><li>bar</ol></div>baz',
+		'foo<div style="margin: 0 40px">[bar]<br>baz</div>',
+		'[foo<div style="margin: 0 40px">bar]<br>baz</div>',
+		'<ol><li>foo</ol><div style="margin: 0 40px">[bar]<br>baz</div>',
+
+		'<p>[foo]<div style="margin: 0 40px"><p>bar</div><p>baz',
+		'<p>foo<div style="margin: 0 40px"><p>[bar]</div><p>baz',
+		'<p>[foo<div style="margin: 0 40px"><p>bar]</div><p>baz',
+		'<ol><li>foo</ol><div style="margin: 0 40px"><p>[bar]</div><p>baz',
+		'<p>[foo]<div style="margin: 0 40px"><ol><li><p>bar</ol></div><p>baz',
+		'<p>foo<div style="margin: 0 40px"><p>[bar]<p>baz</div>',
+		'<p>[foo<div style="margin: 0 40px"><p>bar]<p>baz</div>',
+		'<ol><li>foo</ol><div style="margin: 0 40px"><p>[bar]<p>baz</div>',
+
+		// Attributes
+		'<ul id=abc><li>foo<li>[bar]<li>baz</ul>',
+		'<ul style=color:red><li>foo<li>[bar]<li>baz</ul>',
+		'<ul style=text-indent:1em><li>foo<li>[bar]<li>baz</ul>',
+		'<ul id=abc><li>[foo]<li>bar<li>baz</ul>',
+		'<ul style=color:red><li>[foo]<li>bar<li>baz</ul>',
+		'<ul style=text-indent:1em><li>[foo]<li>bar<li>baz</ul>',
+		'<ul id=abc><li>foo<li>bar<li>[baz]</ul>',
+		'<ul style=color:red><li>foo<li>bar<li>[baz]</ul>',
+		'<ul style=text-indent:1em><li>foo<li>bar<li>[baz]</ul>',
+	],
+	//@}
 	italic: [
+	//@{
 		'foo[]bar',
 		'<span>foo</span>{}<span>bar</span>',
 		'<span>foo[</span><span>]bar</span>',
@@ -1990,7 +2033,9 @@
 		'foo [bar <i>baz] qoz</i> quz sic',
 		'foo bar <i>baz [qoz</i> quz] sic',
 	],
+	//@}
 	justifycenter: [
+	//@{
 		'foo[]bar<p>extra',
 		'<span>foo</span>{}<span>bar</span><p>extra',
 		'<span>foo[</span><span>]bar</span><p>extra',
@@ -2048,7 +2093,9 @@
 		'<div style=text-align:inherit><p>[foo]</div><p>extra',
 		'<quasit align=right><p>[foo]</p></quasit><p>extra',
 	],
+	//@}
 	justifyfull: [
+	//@{
 		'foo[]bar<p>extra',
 		'<span>foo</span>{}<span>bar</span><p>extra',
 		'<span>foo[</span><span>]bar</span><p>extra',
@@ -2103,7 +2150,9 @@
 		'<div style=text-align:inherit><p>[foo]</div><p>extra',
 		'<quasit align=center><p>[foo]</p></quasit><p>extra',
 	],
+	//@}
 	justifyleft: [
+	//@{
 		'foo[]bar<p>extra',
 		'<span>foo</span>{}<span>bar</span><p>extra',
 		'<span>foo[</span><span>]bar</span><p>extra',
@@ -2158,7 +2207,9 @@
 		'<div style=text-align:inherit><p>[foo]</div><p>extra',
 		'<quasit align=center><p>[foo]</p></quasit><p>extra',
 	],
+	//@}
 	justifyright: [
+	//@{
 		'foo[]bar<p>extra',
 		'<span>foo</span>{}<span>bar</span><p>extra',
 		'<span>foo[</span><span>]bar</span><p>extra',
@@ -2213,7 +2264,9 @@
 		'<div style=text-align:inherit><p>[foo]</div><p>extra',
 		'<quasit align=center><p>[foo]</p></quasit><p>extra',
 	],
+	//@}
 	outdent: [
+	//@{
 		// These mimic existing indentation in various browsers, to see how
 		// they cope with outdenting various things.  This is spec, Gecko
 		// non-CSS, and Opera:
@@ -2328,7 +2381,9 @@
 		'<ol><li><h1>[foo]</h1></ol>',
 		'<ol><li><xmp>[foo]</xmp></li></ol>',
 	],
+	//@}
 	removeformat: [
+	//@{
 		'foo[]bar',
 		'<span>foo</span>{}<span>bar</span>',
 		'<span>foo[</span><span>]bar</span>',
@@ -2443,7 +2498,9 @@
 		'<p style="text-indent: 2em">foo[bar]baz</p>',
 		'{<p style="text-indent: 2em">foobarbaz</p>}',
 	],
+	//@}
 	strikethrough: [
+	//@{
 		'foo[]bar',
 		'<span>foo</span>{}<span>bar</span>',
 		'<span>foo[</span><span>]bar</span>',
@@ -2519,7 +2576,9 @@
 		'foo<span class="underline-and-line-through">[bar]</span>baz',
 		'foo<span class="underline-and-line-through">b[a]r</span>baz',
 	],
+	//@}
 	subscript: [
+	//@{
 		'foo[]bar',
 		'<span>foo</span>{}<span>bar</span>',
 		'<span>foo[</span><span>]bar</span>',
@@ -2553,7 +2612,9 @@
 		'foo<sup><sub>b[a]r</sub></sup>baz',
 		'foo<sup>b<sub>[a]</sub>r</sup>baz',
 	],
+	//@}
 	superscript: [
+	//@{
 		'foo[]bar',
 		'<span>foo</span>{}<span>bar</span>',
 		'<span>foo[</span><span>]bar</span>',
@@ -2587,7 +2648,9 @@
 		'foo<sup><sub>b[a]r</sub></sup>baz',
 		'foo<sup>b<sub>[a]</sub>r</sup>baz',
 	],
+	//@}
 	underline: [
+	//@{
 		'foo[]bar',
 		'<span>foo</span>{}<span>bar</span>',
 		'<span>foo[</span><span>]bar</span>',
@@ -2663,7 +2726,9 @@
 		'foo<span class="underline-and-line-through">[bar]</span>baz',
 		'foo<span class="underline-and-line-through">b[a]r</span>baz',
 	],
+	//@}
 	unlink: [
+	//@{
 		'foo[]bar',
 		'<span>foo</span>{}<span>bar</span>',
 		'<span>foo[</span><span>]bar</span>',
@@ -2693,6 +2758,7 @@
 		'foo<a name=foo>[bar]</a>baz',
 		'foo[<a name=foo>bar</a>]baz',
 		'[foo<a name=foo>bar</a>baz]',
+	//@}
 	],
 };
 
@@ -2733,6 +2799,7 @@
 ];
 
 function doSetup(selector, idx) {
+//@{
 	var table = document.querySelectorAll(selector)[idx];
 
 	var tr = document.createElement("tr");
@@ -2740,8 +2807,10 @@
 
 	return tr;
 }
+//@}
 
 function doInputCell(tr, test) {
+//@{
 	var value = null;
 	if (typeof test != "string") {
 		value = test[0];
@@ -2756,8 +2825,10 @@
 	}
 	tr.appendChild(inputCell);
 }
+//@}
 
 function doSpecCell(tr, test, command, styleWithCss) {
+//@{
 	var value;
 
 	if (typeof test != "string") {
@@ -2877,8 +2948,10 @@
 		} })(key, newValue, alertDiv);
 	}
 }
+//@}
 
 function browserCellException(e, testDiv, browserCell) {
+//@{
 	if (testDiv) {
 		testDiv.contenteditable = "inherit";
 		testDiv.removeAttribute("spellcheck");
@@ -2892,8 +2965,10 @@
 		browserCell.insertBefore(testDiv, browserCell.firstChild);
 	}
 }
+//@}
 
 function doSameCell(tr) {
+//@{
 	var sameCell = document.createElement("td");
 	var exception = false;
 	try {
@@ -2969,12 +3044,14 @@
 		} catch (e) {};
 	}
 }
+//@}
 
 function doTearDown(command) {
 	getSelection().removeAllRanges();
 }
 
 function setupCell(cell, test) {
+//@{
 	cell.innerHTML = "<div></div><div></div>";
 
 	// A variety of checks to avoid simple errors.  Not foolproof, of course.
@@ -3088,8 +3165,10 @@
 
 	return [startNode, startOffset, endNode, endOffset];
 }
+//@}
 
 function setSelection(startNode, startOffset, endNode, endOffset) {
+//@{
 	if (navigator.userAgent.indexOf("Opera") != -1) {
 		// Yes, browser sniffing is evil, but I can't be bothered to debug
 		// Opera.
@@ -3131,12 +3210,14 @@
 		}
 	}
 }
+//@}
 
 /**
  * Add brackets at the start and end points of the given range, so that they're
  * visible.
  */
 function addBrackets(range) {
+//@{
 	// Handle the collapsed case specially, to avoid confusingly getting the
 	// markers backwards in some cases
 	if (range.startContainer.nodeType == Node.TEXT_NODE) {
@@ -3185,3 +3266,5 @@
 		}
 	}
 }
+//@}
+// vim: foldmarker=@{,@} foldmethod=marker