| 1 |
<html><body> |
| 2 |
|
| 3 |
This is an example of an evil HTML file, intended to screw up non-robust |
| 4 |
HTML parsers. It's used as a test for LW::html_find_tags(). So let's get |
| 5 |
started... |
| 6 |
|
| 7 |
<p> |
| 8 |
<script language="javascript"> |
| 9 |
document.writeln("Do not parse <this> or <that> tag!"); |
| 10 |
document.writeln("<!-- no comments! Do not stop! /script>"); |
| 11 |
</script> |
| 12 |
|
| 13 |
<!-- overzealous --> |
| 14 |
|
| 15 |
<<a href=http://localhost/">link</a></a> |
| 16 |
|
| 17 |
<form method=post action=/script> |
| 18 |
<input type=text value=work?> |
| 19 |
<input type=text value="Don't use <blink> |
| 20 |
anywhere"> |
| 21 |
<input value="Continue -->" |
| 22 |
type="submit"> |
| 23 |
|
| 24 |
<!-- |
| 25 |
Don't stop - -> and -- and -> and <!-- |
| 26 |
stopped? |
| 27 |
--> show <!-- nope --> |
| 28 |
|
| 29 |
Some parsers < a href="/blank">skip this</a> |
| 30 |
This is <i><b>also a variable case</i</b> |
| 31 |
|
| 32 |
<a href="/blah>bold?</ a><b/>">link?</a> |
| 33 |
|
| 34 |
<a href=/blah">yes?</a>">link?</a> |
| 35 |
|
| 36 |
</body></html> |
| 37 |
|
| 38 |
|
| 39 |
<!-- Intended/valid results (according to RFP): |
| 40 |
|
| 41 |
1. None of the tags in the script section should be considered valid |
| 42 |
|
| 43 |
2. 'link' is an ahref to preferably http://localhost/, however |
| 44 |
even Netscape makes it http://localhost" |
| 45 |
|
| 46 |
3. form tag properly exist only to ensure input elements show |
| 47 |
up in browsers |
| 48 |
|
| 49 |
4. input tag should show 'work?' in box. Tabs used to fool parsers |
| 50 |
hellbent on spaces only |
| 51 |
|
| 52 |
5. second input should have 'Don't use <blink> anywhere' in the |
| 53 |
box. Some parsers might pull the <blink> out as a separate |
| 54 |
tag. |
| 55 |
|
| 56 |
6. Of course, the parser needs to handle the whitespace separating |
| 57 |
the elements of the input tag. |
| 58 |
|
| 59 |
7. The submit button must have caption of 'Continue - ->'. (space |
| 60 |
added so this properly parses) Parser shouldn't stop at the > |
| 61 |
|
| 62 |
8. The parser should skip all the crap within the comments. |
| 63 |
'stopped?' should not appear. 'show' should appear, and |
| 64 |
'nope' should not. |
| 65 |
|
| 66 |
9. The < a href...> tag is a crapshoot. Netscape skips it. |
| 67 |
|
| 68 |
10. Many parsers signal the start of a tag to be the end of another, |
| 69 |
so both the </b> and </i> tags could be found. Libwhisker |
| 70 |
does not (tag is set to /b</i) |
| 71 |
|
| 72 |
11. the link should have an href to '/blah>bold?</ a><b/>' |
| 73 |
|
| 74 |
12. the last ahref should href to preferably /blah, but perhaps |
| 75 |
/blah". The yes? should be linked, and the link? should |
| 76 |
not be. |
| 77 |
|
| 78 |
|
| 79 |
So I hope that tag processing goes through the following 18/19 tags: |
| 80 |
|
| 81 |
<html> |
| 82 |
<body> |
| 83 |
<script language="javascript"> |
| 84 |
</script> |
| 85 |
<p> |
| 86 |
<a href=http://localhost/"> |
| 87 |
</a> |
| 88 |
</a> |
| 89 |
<form method=post action=/blah> |
| 90 |
<input type=text value="work?"> |
| 91 |
<input type=text value="Don't use <blink> anywhere"> |
| 92 |
<input value="Continue - ->" type="submit"> |
| 93 |
< a href="/blank"> [NOTE: THIS IS OPTIONAL] |
| 94 |
<i> |
| 95 |
<b> |
| 96 |
</i</b> |
| 97 |
</a> |
| 98 |
<a href="/blah>bold?</ a><b/>"> |
| 99 |
</a> |
| 100 |
<a href=/blah"> |
| 101 |
</a> |
| 102 |
</a> |
| 103 |
</body> |
| 104 |
</html> |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
--> |
| 109 |
|