1 description('Test for handling of line breaks following the pre element.');
3 var element = document.createElement("div");
5 function roundTrip(string)
7 element.innerHTML = string;
8 return element.innerHTML;
11 shouldBe("roundTrip('<pre></pre>')", "'<pre></pre>'");
12 shouldBe("roundTrip('<pre>\\n</pre>')", "'<pre></pre>'");
13 shouldBe("roundTrip('<pre>\\n\\n</pre>')", "'<pre>\\n</pre>'");
14 shouldBe("roundTrip('<pre>x\\n</pre>')", "'<pre>x\\n</pre>'");
15 shouldBe("roundTrip('<pre><\\n</pre>')", "'<pre><\\n</pre>'");
16 shouldBe("roundTrip('<pre>=\\n</pre>')", "'<pre>=\\n</pre>'");
17 shouldBe("roundTrip('<pre><a></a></pre>')", "'<pre><a></a></pre>'");
18 shouldBe("roundTrip('<pre><a>\\n</a></pre>')", "'<pre><a>\\n</a></pre>'");
19 shouldBe("roundTrip('<pre>\\n<a></a></pre>')", "'<pre><a></a></pre>'");
20 shouldBe("roundTrip('<pre>\\n<a>\\n</a></pre>')", "'<pre><a>\\n</a></pre>'");
22 shouldBe("roundTrip('<listing></listing>')", "'<listing></listing>'");
23 shouldBe("roundTrip('<listing>\\n</listing>')", "'<listing></listing>'");
24 shouldBe("roundTrip('<listing>\\n\\n</listing>')", "'<listing>\\n</listing>'");
25 shouldBe("roundTrip('<listing>x\\n</listing>')", "'<listing>x\\n</listing>'");
26 shouldBe("roundTrip('<listing><\\n</listing>')", "'<listing><\\n</listing>'");
27 shouldBe("roundTrip('<listing>=\\n</listing>')", "'<listing>=\\n</listing>'");
28 shouldBe("roundTrip('<listing><a></a></listing>')", "'<listing><a></a></listing>'");
29 shouldBe("roundTrip('<listing><a>\\n</a></listing>')", "'<listing><a>\\n</a></listing>'");
30 shouldBe("roundTrip('<listing>\\n<a></a></listing>')", "'<listing><a></a></listing>'");
31 shouldBe("roundTrip('<listing>\\n<a>\\n</a></listing>')", "'<listing><a>\\n</a></listing>'");
33 shouldBe("roundTrip('<div></div>')", "'<div></div>'");
34 shouldBe("roundTrip('<div>\\n</div>')", "'<div>\\n</div>'");
35 shouldBe("roundTrip('<div>\\n\\n</div>')", "'<div>\\n\\n</div>'");
36 shouldBe("roundTrip('<div>x\\n</div>')", "'<div>x\\n</div>'");
37 shouldBe("roundTrip('<div><\\n</div>')", "'<div><\\n</div>'");
38 shouldBe("roundTrip('<div>=\\n</div>')", "'<div>=\\n</div>'");
39 shouldBe("roundTrip('<div><a></a></div>')", "'<div><a></a></div>'");
40 shouldBe("roundTrip('<div><a>\\n</a></div>')", "'<div><a>\\n</a></div>'");
41 shouldBe("roundTrip('<div>\\n<a></a></div>')", "'<div>\\n<a></a></div>'");
42 shouldBe("roundTrip('<div>\\n<a>\\n</a></div>')", "'<div>\\n<a>\\n</a></div>'");