blob: 391f3f0a35c6e646ad5c420d56e85a1aee3aa8fa [file] [log] [blame]
Brian Silverman70325d62015-09-20 17:00:43 -04001<!-- Tests for HTML comments and cdata escaping text spans. -->
2<html>
3
4<body>
5
6<?state state=text, tag=body ?>
7
8<!-- HTML doctype declaration -->
9<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
10<?state state=text, tag=body?>
11"http://www.w3.org/TR/html4/strict.dtd">
12<?state state=text, tag=body ?>
13
14<!-- Regular HTML comment -->
15<!-- <?state state=comment, tag=body ?> -->
16<?state state=text, tag=body ?>
17
18<!-- HTML comment with tags -->
19<!-- > -> </b> <a href="<?state state=comment, tag=body ?>"></a>-->
20<?state state=text, tag=body ?>
21
22<!-- Should not be interpreted as an SGML comment -->
23<?state state=text, tag=body ?>
24<!-- -- -->
25<?state state=text, tag=body ?>
26
27<!-- -- Sync back the SGML comment for editors who parse SGML comments
28(ie: vim) -->
29<?state state=text, tag=body ?>
30
31<!-- Multiple dashes at the end. -->
32<!----- <?state state=comment, tag=body ?> --><?state state=text, tag=body ?>
33<!----- <?state state=comment, tag=body ?> ---><?state state=text, tag=body ?>
34<!----- <?state state=comment, tag=body ?> ----><?state state=text, tag=body ?>
35<!----- <?state state=comment, tag=body ?> -----><?state state=text, tag=body ?>
36
37<!-- Some more misc tests -->
38<!-- test <?state state=comment?> --><?state state=text?> test test --><?state state=text?>
39<!-- test -> test test --><?state state=text?>
40<!-- test test='--><?state state=text?>'
41<!----><?state state=text?>
42<!-----><?state state=text?>
43
44<!-- Make sure the double dash sequence is not interpreted as an SGML comment
45by introducing a legit postfix decrement operator -->
46<?state state=text, in_js=false ?>
47<script>
48<!--
49<?state state=text, in_js=true ?>
50
51var x = 1;
52x--;
53<?state state=text, in_js=true ?>
54-->
55</script>
56<?state state=text, in_js=false ?>
57
58</body>
59
60</html>
61<?state state=text ?>