Regular version | extsrc.js enhanced

This test suite was made to check how well extsrc.js plays with asynchronous `document.write`.
Turns out, it plays rather nicely in simple cases, but fails in more complex scenarios. These are some of the cons: 1) Slightly obtrusive (wraps `document.write` output with double <span>) 2) Messes up markup (due to <span> wrapping) in cases like: a) <script>document.write('<h1>')</script> some text <script>document.write('</h1>')</script> b) <script>document.write('<p>foo')</script> <script>document.write(' bar</p>')</script> 3) Doesn't work with nested scripts: a) Either inline: <script>document.write('<script>alert(1)</script>')</script> b) Or external: <script>document.write('<script src="..."></script>')</script> 4) Does not preserve execution order (when mixed with inline scripts): <script>var foo = 1</script> <script src="... set foo to 2 ..."> <script>alert(foo)</script> // 1, not 2

This text is in between scripts A and B

This text should be part of a header

The following line should be green

The following line should be blue