justhtml 3.6.0__tar.gz → 3.6.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. {justhtml-3.6.0 → justhtml-3.6.1}/CHANGELOG.md +10 -0
  2. {justhtml-3.6.0 → justhtml-3.6.1}/PKG-INFO +1 -1
  3. {justhtml-3.6.0 → justhtml-3.6.1}/pyproject.toml +1 -1
  4. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/parser/engine.py +25 -1
  5. justhtml-3.6.1/tests/justhtml-tests/character_preprocessing.dat +252 -0
  6. justhtml-3.6.1/tests/justhtml-tests/document_shell_recovery.dat +366 -0
  7. {justhtml-3.6.0 → justhtml-3.6.1}/tests/justhtml-tests/foreign_content.dat +118 -0
  8. justhtml-3.6.1/tests/justhtml-tests/frameset_recovery.dat +229 -0
  9. {justhtml-3.6.0 → justhtml-3.6.1}/tests/justhtml-tests/head_noscript_recovery.dat +24 -0
  10. justhtml-3.6.1/tests/justhtml-tests/in_body_recovery.dat +175 -0
  11. justhtml-3.6.1/tests/justhtml-tests/raw_text_recovery.dat +166 -0
  12. {justhtml-3.6.0 → justhtml-3.6.1}/tests/justhtml-tests/select_recovery.dat +66 -0
  13. {justhtml-3.6.0 → justhtml-3.6.1}/tests/justhtml-tests/selectedcontent.dat +10 -0
  14. {justhtml-3.6.0 → justhtml-3.6.1}/tests/justhtml-tests/table_recovery.dat +107 -0
  15. {justhtml-3.6.0 → justhtml-3.6.1}/tests/justhtml-tests/template_recovery.dat +250 -0
  16. justhtml-3.6.1/tests/justhtml-tests/tokenizer_recovery.dat +238 -0
  17. {justhtml-3.6.0 → justhtml-3.6.1}/tests/justhtml-tests/xml_coercion.dat +24 -0
  18. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_parser_engine.py +0 -128
  19. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_parser_regressions.py +0 -37
  20. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_parser_tree.py +1 -372
  21. justhtml-3.6.0/tests/justhtml-tests/character_preprocessing.dat +0 -110
  22. justhtml-3.6.0/tests/justhtml-tests/document_shell_recovery.dat +0 -106
  23. justhtml-3.6.0/tests/justhtml-tests/frameset_recovery.dat +0 -60
  24. justhtml-3.6.0/tests/justhtml-tests/in_body_recovery.dat +0 -66
  25. {justhtml-3.6.0 → justhtml-3.6.1}/.github/copilot-instructions.md +0 -0
  26. {justhtml-3.6.0 → justhtml-3.6.1}/.github/workflows/ci.yml +0 -0
  27. {justhtml-3.6.0 → justhtml-3.6.1}/.github/workflows/publish.yml +0 -0
  28. {justhtml-3.6.0 → justhtml-3.6.1}/.gitignore +0 -0
  29. {justhtml-3.6.0 → justhtml-3.6.1}/.pre-commit-config.yaml +0 -0
  30. {justhtml-3.6.0 → justhtml-3.6.1}/AGENTS.md +0 -0
  31. {justhtml-3.6.0 → justhtml-3.6.1}/CODE_OF_CONDUCT.md +0 -0
  32. {justhtml-3.6.0 → justhtml-3.6.1}/CONTRIBUTING.md +0 -0
  33. {justhtml-3.6.0 → justhtml-3.6.1}/LICENSE +0 -0
  34. {justhtml-3.6.0 → justhtml-3.6.1}/Makefile +0 -0
  35. {justhtml-3.6.0 → justhtml-3.6.1}/PERFORMANCE.md +0 -0
  36. {justhtml-3.6.0 → justhtml-3.6.1}/README.md +0 -0
  37. {justhtml-3.6.0 → justhtml-3.6.1}/SECURITY.md +0 -0
  38. {justhtml-3.6.0 → justhtml-3.6.1}/assets/justhtml-readme-explainer.png +0 -0
  39. {justhtml-3.6.0 → justhtml-3.6.1}/benchmarks/chromium_parser_diff.py +0 -0
  40. {justhtml-3.6.0 → justhtml-3.6.1}/benchmarks/correctness.py +0 -0
  41. {justhtml-3.6.0 → justhtml-3.6.1}/benchmarks/fuzz.py +0 -0
  42. {justhtml-3.6.0 → justhtml-3.6.1}/benchmarks/html5lib_engine_diff.py +0 -0
  43. {justhtml-3.6.0 → justhtml-3.6.1}/benchmarks/parser_engine_gate.py +0 -0
  44. {justhtml-3.6.0 → justhtml-3.6.1}/benchmarks/performance.py +0 -0
  45. {justhtml-3.6.0 → justhtml-3.6.1}/benchmarks/profile.py +0 -0
  46. {justhtml-3.6.0 → justhtml-3.6.1}/docs/_config.yml +0 -0
  47. {justhtml-3.6.0 → justhtml-3.6.1}/docs/_layouts/default.html +0 -0
  48. {justhtml-3.6.0 → justhtml-3.6.1}/docs/api.md +0 -0
  49. {justhtml-3.6.0 → justhtml-3.6.1}/docs/assets/search.js +0 -0
  50. {justhtml-3.6.0 → justhtml-3.6.1}/docs/bleach-migration.md +0 -0
  51. {justhtml-3.6.0 → justhtml-3.6.1}/docs/building.md +0 -0
  52. {justhtml-3.6.0 → justhtml-3.6.1}/docs/cli.md +0 -0
  53. {justhtml-3.6.0 → justhtml-3.6.1}/docs/comparison.md +0 -0
  54. {justhtml-3.6.0 → justhtml-3.6.1}/docs/correctness.md +0 -0
  55. {justhtml-3.6.0 → justhtml-3.6.1}/docs/encoding.md +0 -0
  56. {justhtml-3.6.0 → justhtml-3.6.1}/docs/errors.md +0 -0
  57. {justhtml-3.6.0 → justhtml-3.6.1}/docs/fragments.md +0 -0
  58. {justhtml-3.6.0 → justhtml-3.6.1}/docs/html-cleaning.md +0 -0
  59. {justhtml-3.6.0 → justhtml-3.6.1}/docs/index.md +0 -0
  60. {justhtml-3.6.0 → justhtml-3.6.1}/docs/linkify.md +0 -0
  61. {justhtml-3.6.0 → justhtml-3.6.1}/docs/migration-examples.md +0 -0
  62. {justhtml-3.6.0 → justhtml-3.6.1}/docs/playground/app.js +0 -0
  63. {justhtml-3.6.0 → justhtml-3.6.1}/docs/playground/index.html +0 -0
  64. {justhtml-3.6.0 → justhtml-3.6.1}/docs/playground/py/__init__.py +0 -0
  65. {justhtml-3.6.0 → justhtml-3.6.1}/docs/playground/py/install_latest_justhtml.py +0 -0
  66. {justhtml-3.6.0 → justhtml-3.6.1}/docs/playground/py/render.py +0 -0
  67. {justhtml-3.6.0 → justhtml-3.6.1}/docs/playground/py/use_local_repo.py +0 -0
  68. {justhtml-3.6.0 → justhtml-3.6.1}/docs/quickstart.md +0 -0
  69. {justhtml-3.6.0 → justhtml-3.6.1}/docs/sanitization.md +0 -0
  70. {justhtml-3.6.0 → justhtml-3.6.1}/docs/selectors.md +0 -0
  71. {justhtml-3.6.0 → justhtml-3.6.1}/docs/streaming.md +0 -0
  72. {justhtml-3.6.0 → justhtml-3.6.1}/docs/text.md +0 -0
  73. {justhtml-3.6.0 → justhtml-3.6.1}/docs/transforms.md +0 -0
  74. {justhtml-3.6.0 → justhtml-3.6.1}/docs/unsafe-handling.md +0 -0
  75. {justhtml-3.6.0 → justhtml-3.6.1}/docs/url-cleaning.md +0 -0
  76. {justhtml-3.6.0 → justhtml-3.6.1}/llms.txt +0 -0
  77. {justhtml-3.6.0 → justhtml-3.6.1}/project_ideas.md +0 -0
  78. {justhtml-3.6.0 → justhtml-3.6.1}/run_tests.py +0 -0
  79. {justhtml-3.6.0 → justhtml-3.6.1}/scripts/release.py +0 -0
  80. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/__init__.py +0 -0
  81. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/__main__.py +0 -0
  82. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/core/__init__.py +0 -0
  83. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/core/constants.py +0 -0
  84. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/core/doctype.py +0 -0
  85. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/core/entities.py +0 -0
  86. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/core/errors.py +0 -0
  87. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/core/rawtext.py +0 -0
  88. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/core/text.py +0 -0
  89. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/core/types.py +0 -0
  90. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/dom/__init__.py +0 -0
  91. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/dom/builder.py +0 -0
  92. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/parser/__init__.py +0 -0
  93. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/parser/context.py +0 -0
  94. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/parser/encoding.py +0 -0
  95. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/parser/options.py +0 -0
  96. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/parser/scanner.py +0 -0
  97. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/parser/stream.py +0 -0
  98. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/py.typed +0 -0
  99. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/sanitizer/__init__.py +0 -0
  100. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/sanitizer/css.py +0 -0
  101. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/sanitizer/dom.py +0 -0
  102. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/sanitizer/policy.py +0 -0
  103. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/sanitizer/policy_defaults.py +0 -0
  104. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/sanitizer/rawtext.py +0 -0
  105. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/sanitizer/url/__init__.py +0 -0
  106. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/sanitizer/url/policy.py +0 -0
  107. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/sanitizer/url/runtime.py +0 -0
  108. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/sanitizer/url/spec.py +0 -0
  109. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/selector/__init__.py +0 -0
  110. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/selector/core.py +0 -0
  111. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/serializer/__init__.py +0 -0
  112. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/serializer/html.py +0 -0
  113. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/serializer/markdown.py +0 -0
  114. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/transforms/__init__.py +0 -0
  115. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/transforms/compile.py +0 -0
  116. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/transforms/linkify.py +0 -0
  117. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/transforms/linkify_core.py +0 -0
  118. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/transforms/runtime.py +0 -0
  119. {justhtml-3.6.0 → justhtml-3.6.1}/src/justhtml/transforms/spec.py +0 -0
  120. {justhtml-3.6.0 → justhtml-3.6.1}/test-summary.txt +0 -0
  121. {justhtml-3.6.0 → justhtml-3.6.1}/tests/README.md +0 -0
  122. {justhtml-3.6.0 → justhtml-3.6.1}/tests/__init__.py +0 -0
  123. {justhtml-3.6.0 → justhtml-3.6.1}/tests/data/wikipedia.html +0 -0
  124. {justhtml-3.6.0 → justhtml-3.6.1}/tests/harness/__init__.py +0 -0
  125. {justhtml-3.6.0 → justhtml-3.6.1}/tests/harness/encoding.py +0 -0
  126. {justhtml-3.6.0 → justhtml-3.6.1}/tests/harness/regressions.py +0 -0
  127. {justhtml-3.6.0 → justhtml-3.6.1}/tests/harness/reporter.py +0 -0
  128. {justhtml-3.6.0 → justhtml-3.6.1}/tests/harness/serializer.py +0 -0
  129. {justhtml-3.6.0 → justhtml-3.6.1}/tests/harness/tree.py +0 -0
  130. {justhtml-3.6.0 → justhtml-3.6.1}/tests/justhtml-sanitize-tests/cases.json +0 -0
  131. {justhtml-3.6.0 → justhtml-3.6.1}/tests/justhtml-tests/entities.test +0 -0
  132. {justhtml-3.6.0 → justhtml-3.6.1}/tests/justhtml-tests/foreign_stack_recovery.dat +0 -0
  133. {justhtml-3.6.0 → justhtml-3.6.1}/tests/justhtml-tests/iframe_srcdoc.dat +0 -0
  134. {justhtml-3.6.0 → justhtml-3.6.1}/tests/justhtml-tests/tokenizer_state_transitions.test +0 -0
  135. {justhtml-3.6.0 → justhtml-3.6.1}/tests/justhtml-tests/tokenizer_states.test +0 -0
  136. {justhtml-3.6.0 → justhtml-3.6.1}/tests/justhtml-tests/xml_coercion_invalid_characters.test +0 -0
  137. {justhtml-3.6.0 → justhtml-3.6.1}/tests/linkify-it/LICENSE.txt +0 -0
  138. {justhtml-3.6.0 → justhtml-3.6.1}/tests/linkify-it/README.md +0 -0
  139. {justhtml-3.6.0 → justhtml-3.6.1}/tests/linkify-it/fixtures/links.txt +0 -0
  140. {justhtml-3.6.0 → justhtml-3.6.1}/tests/linkify-it/fixtures/not_links.txt +0 -0
  141. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_builder.py +0 -0
  142. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_cli.py +0 -0
  143. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_docs_examples.py +0 -0
  144. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_encoding.py +0 -0
  145. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_entities.py +0 -0
  146. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_errors.py +0 -0
  147. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_linkify_internals.py +0 -0
  148. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_linkify_it.py +0 -0
  149. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_linkify_transform.py +0 -0
  150. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_node.py +0 -0
  151. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_playground_local_repo_file_list.py +0 -0
  152. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_sanitize.py +0 -0
  153. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_sanitize_integration.py +0 -0
  154. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_sanitize_transform.py +0 -0
  155. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_selector.py +0 -0
  156. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_serialize.py +0 -0
  157. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_stream.py +0 -0
  158. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_transform_runtime.py +0 -0
  159. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_transforms.py +0 -0
  160. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_transforms_compiler.py +0 -0
  161. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_transforms_sanitize_integration.py +0 -0
  162. {justhtml-3.6.0 → justhtml-3.6.1}/tests/test_wikipedia.py +0 -0
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.6.1] - 2026-07-13
11
+
12
+ ### Fixed
13
+
14
+ - Keep processing instructions inside a scripting-disabled head `noscript`, and process them in body mode inside templates as required by the latest WHATWG parsing rules.
15
+
16
+ ### Changed
17
+
18
+ - Move raw parser input/output regressions from Python unit tests into the shared tree-construction fixture format.
19
+
10
20
  ## [3.6.0] - 2026-07-13
11
21
 
12
22
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: justhtml
3
- Version: 3.6.0
3
+ Version: 3.6.1
4
4
  Summary: A pure Python HTML5 parser that just works.
5
5
  Project-URL: Homepage, https://github.com/emilstenstrom/justhtml
6
6
  Project-URL: Issues, https://github.com/emilstenstrom/justhtml/issues
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "justhtml"
3
3
  authors = [{ name = "Emil Stenström", email = "emil@emilstenstrom.se" }]
4
- version = "3.6.0"
4
+ version = "3.6.1"
5
5
  description = "A pure Python HTML5 parser that just works."
6
6
  readme = "README.md"
7
7
  license = { file = "LICENSE" }
@@ -1253,8 +1253,32 @@ class ParseEngine:
1253
1253
  if self._has_null and "\0" in data:
1254
1254
  data = data.replace("\0", "\ufffd")
1255
1255
  node = ProcessingInstruction(data=data)
1256
+ self._move_head_template_to_body_for_processing_instruction()
1256
1257
  self._append_misc_node(node, source_pos)
1257
1258
 
1259
+ def _move_head_template_to_body_for_processing_instruction(self) -> None:
1260
+ if self._fragment or self._head is None or self._html is None:
1261
+ return
1262
+ stack = self._stack
1263
+ template_idx = self._open_template_index()
1264
+ if template_idx is None:
1265
+ return
1266
+ outer_template_idx = template_idx
1267
+ for idx in range(template_idx, 0, -1):
1268
+ candidate = stack[idx]
1269
+ if type(candidate) is Template and candidate.parent is self._head:
1270
+ outer_template_idx = idx
1271
+ template = stack[outer_template_idx]
1272
+ if type(template) is not Template or template.parent is not self._head:
1273
+ return
1274
+ head_children = self._head.children
1275
+ if head_children is not None: # pragma: no branch - Document head always owns a children list
1276
+ head_children.remove(template)
1277
+ self._append(self._body, template)
1278
+ self._stack = _CountingStack([self._doc, self._html, self._body, *stack[outer_template_idx:]]) # type: ignore[list-item]
1279
+ self._body_mode_seen = True
1280
+ self._after_head = False
1281
+
1258
1282
  def _processing_instruction_data(self, content_start: int, content_end: int) -> str | None:
1259
1283
  html = self._html_input
1260
1284
  if content_start >= content_end or not _is_processing_instruction_name_start(html[content_start]):
@@ -1632,7 +1656,7 @@ class ParseEngine:
1632
1656
  append_text(html[lt:end] if gt == -1 else html[lt : gt + 1], lt)
1633
1657
  pos = end if gt == -1 else gt + 1
1634
1658
  continue
1635
- if self._raw_mode and len(self._stack) > 1 and self._stack[-1].name in _RAWTEXT_ELEMENT_TAGS:
1659
+ if self._raw_mode and len(self._stack) > 1 and self._stack[-1].name in self._rawtext_element_tags:
1636
1660
  comment_end = end if gt == -1 else gt
1637
1661
  append_text(html[lt:comment_end] if gt == -1 else html[lt : gt + 1], lt)
1638
1662
  pos = end if gt == -1 else gt + 1
@@ -0,0 +1,252 @@
1
+ #data
2
+ <math><mi>\x00</mi></math>
3
+ #errors
4
+ (1,6): expected-doctype-but-got-start-tag
5
+ (1,11): unexpected-null-character
6
+
7
+ #document
8
+ | <html>
9
+ | <head>
10
+ | <body>
11
+ | <math math>
12
+ | <math mi>
13
+
14
+ #data
15
+ <math><mi>\x00\x0c</mi></math>
16
+ #errors
17
+ (1,6): expected-doctype-but-got-start-tag
18
+ (1,11): unexpected-null-character
19
+
20
+ #document
21
+ | <html>
22
+ | <head>
23
+ | <body>
24
+ | <math math>
25
+ | <math mi>
26
+ | " "
27
+
28
+ #data
29
+ <math><mi> </mi></math>
30
+ #errors
31
+ (1,1): expected-doctype-but-got-start-tag
32
+
33
+ #document
34
+ | <html>
35
+ | <head>
36
+ | <body>
37
+ | <math math>
38
+ | <math mi>
39
+ | " "
40
+
41
+ #data
42
+ <math><mi>\x0ctext</mi></math>
43
+ #errors
44
+ (1,1): expected-doctype-but-got-start-tag
45
+
46
+ #document
47
+ | <html>
48
+ | <head>
49
+ | <body>
50
+ | <math math>
51
+ | <math mi>
52
+ | " text"
53
+
54
+ #data
55
+ <select>\x0ctext</select>
56
+ #errors
57
+ (1,1): expected-doctype-but-got-start-tag
58
+
59
+ #document
60
+ | <html>
61
+ | <head>
62
+ | <body>
63
+ | <select>
64
+ | " text"
65
+
66
+ #data
67
+ <table>\x00</table>
68
+ #errors
69
+ (1,7): expected-doctype-but-got-start-tag
70
+ (1,8): unexpected-null-character
71
+
72
+ #document
73
+ | <html>
74
+ | <head>
75
+ | <body>
76
+ | <table>
77
+
78
+ #data
79
+ <head></head>\x00
80
+ #errors
81
+ (1,6): expected-doctype-but-got-start-tag
82
+ (1,14): unexpected-null-character
83
+
84
+ #document
85
+ | <html>
86
+ | <head>
87
+ | <body>
88
+
89
+ #data
90
+ <table>\x0c</table>
91
+ #errors
92
+ (1,1): expected-doctype-but-got-start-tag
93
+
94
+ #document
95
+ | <html>
96
+ | <head>
97
+ | <body>
98
+ | <table>
99
+ | " "
100
+
101
+ #data
102
+ <!doctype html>\x00
103
+ #errors
104
+ (1,16): unexpected-null-character
105
+
106
+ #document
107
+ | <!DOCTYPE html>
108
+ | <html>
109
+ | <head>
110
+ | <body>
111
+
112
+
113
+ #data
114
+ <!--a\x00b-->
115
+ #errors
116
+ (1,1): expected-doctype-but-got-chars
117
+ (1,6): unexpected-null-character
118
+ #document
119
+ | <!-- a�b -->
120
+ | <html>
121
+ | <head>
122
+ | <body>
123
+
124
+ #data
125
+ <frameset>\x0d\x0a
126
+ #errors
127
+ #document
128
+ | <html>
129
+ | <head>
130
+ | <frameset>
131
+ | "
132
+ "
133
+ #data
134
+ <!--a-
135
+ #errors
136
+ (1,1): expected-doctype-but-got-chars
137
+ (1,6): eof-in-comment
138
+ #document
139
+ | <!-- a -->
140
+ | <html>
141
+ | <head>
142
+ | <body>
143
+
144
+ #data
145
+ <!x\x0d\x0ay>
146
+ #errors
147
+ (1,1): expected-doctype-but-got-chars
148
+ #document
149
+ | <!-- x
150
+ y -->
151
+ | <html>
152
+ | <head>
153
+ | <body>
154
+
155
+ #data
156
+ <\x00div>
157
+ #errors
158
+ (1,1): expected-doctype-but-got-chars
159
+ (1,2): unexpected-null-character
160
+ #document
161
+ | <html>
162
+ | <head>
163
+ | <body>
164
+ | "<�div>"
165
+
166
+ #data
167
+ </>
168
+ #errors
169
+ (1,1): expected-doctype-but-got-chars
170
+ #document
171
+ | <html>
172
+ | <head>
173
+ | <body>
174
+
175
+ #data
176
+ \x00\x0cA
177
+ #errors
178
+ (1,1): unexpected-null-character
179
+ (1,1): expected-doctype-but-got-chars
180
+ #document
181
+ | <html>
182
+ | <head>
183
+ | <body>
184
+ | "A"
185
+
186
+ #data
187
+ <!DOCTYPE\x00html>
188
+ #errors
189
+ (1,10): unexpected-null-character
190
+ (1,15): unknown-doctype
191
+ #document
192
+ | <!DOCTYPE �html>
193
+ | <html>
194
+ | <head>
195
+ | <body>
196
+
197
+ #data
198
+ &#x;
199
+ #errors
200
+ (1,1): expected-doctype-but-got-chars
201
+ #document
202
+ | <html>
203
+ | <head>
204
+ | <body>
205
+ | "&#x;"
206
+
207
+ #data
208
+ <!--first--><!DOCTYPE\x0d\x0ahtml>
209
+ #errors
210
+ (1,1): expected-doctype-but-got-chars
211
+ #document
212
+ | <!-- first -->
213
+ | <!DOCTYPE html>
214
+ | <html>
215
+ | <head>
216
+ | <body>
217
+
218
+ #data
219
+ <o\x0ce="\x0d">
220
+ #errors
221
+ (1,9): expected-doctype-but-got-start-tag
222
+ #document
223
+ | <html>
224
+ | <head>
225
+ | <body>
226
+ | <o>
227
+ | e="
228
+ "
229
+
230
+ #data
231
+ <d 2="\x0d">
232
+ #errors
233
+ (1,9): expected-doctype-but-got-start-tag
234
+ #document
235
+ | <html>
236
+ | <head>
237
+ | <body>
238
+ | <d>
239
+ | 2="
240
+ "
241
+
242
+ #data
243
+ <a 8=&#13\x0d>
244
+ #errors
245
+ (1,11): expected-doctype-but-got-start-tag
246
+ #document
247
+ | <html>
248
+ | <head>
249
+ | <body>
250
+ | <a>
251
+ | 8="
252
+ "
@@ -0,0 +1,366 @@
1
+ #data
2
+ </template>
3
+ #errors
4
+ (1,1): expected-doctype-but-got-end-tag
5
+ (1,11): unexpected-end-tag-before-html
6
+
7
+ #document
8
+ | <html>
9
+ | <head>
10
+ | <body>
11
+
12
+ #data
13
+ <body><input type="hidden">
14
+ #errors
15
+ (1,1): expected-doctype-but-got-start-tag
16
+
17
+ #document
18
+ | <html>
19
+ | <head>
20
+ | <body>
21
+ | <input>
22
+ | type="hidden"
23
+
24
+ #data
25
+ <html><body><html attr="test">
26
+ #errors
27
+ (1,1): expected-doctype-but-got-start-tag
28
+ (1,30): unexpected-start-tag
29
+
30
+ #document
31
+ | <html>
32
+ | attr="test"
33
+ | <head>
34
+ | <body>
35
+
36
+ #data
37
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//" "http://www.w3.org/TR/html4/loose.dtd">
38
+ #errors
39
+ (1,100): unknown-doctype
40
+
41
+ #document
42
+ | <!DOCTYPE html "-//W3C//DTD HTML 4.01 Transitional//" "http://www.w3.org/TR/html4/loose.dtd">
43
+ | <html>
44
+ | <head>
45
+ | <body>
46
+
47
+ #data
48
+ <head></head></template>text
49
+ #errors
50
+ (1,1): expected-doctype-but-got-start-tag
51
+ (1,24): unexpected-end-tag
52
+
53
+ #document
54
+ | <html>
55
+ | <head>
56
+ | <body>
57
+ | "text"
58
+
59
+ #data
60
+ <meta><!--x-->
61
+ #errors
62
+ (1,1): expected-doctype-but-got-start-tag
63
+
64
+ #document
65
+ | <html>
66
+ | <head>
67
+ | <meta>
68
+ | <!-- x -->
69
+ | <body>
70
+
71
+ #data
72
+ <!DOCTYPE 
73
+ #errors
74
+ (1,10): eof-in-tag
75
+ (1,10): unknown-doctype
76
+
77
+ #document
78
+ | <!DOCTYPE  >
79
+ | <html>
80
+ | <head>
81
+ | <body>
82
+
83
+ #data
84
+ <!doctype html>x<head><meta>
85
+ #errors
86
+
87
+ #document
88
+ | <!DOCTYPE html>
89
+ | <html>
90
+ | <head>
91
+ | <body>
92
+ | "x"
93
+ | <meta>
94
+
95
+ #data
96
+ <!DOCTYPE html foo><p><table>
97
+ #errors
98
+ (1,19): unknown-doctype
99
+
100
+ #document
101
+ | <!DOCTYPE html>
102
+ | <html>
103
+ | <head>
104
+ | <body>
105
+ | <p>
106
+ | <table>
107
+
108
+
109
+ #data
110
+ <div a="unterminated
111
+ #errors
112
+ #document
113
+ | <html>
114
+ | <head>
115
+ | <body>
116
+
117
+ #data
118
+ <DIV A=1 a=2>x</DIV>
119
+ #errors
120
+ #document
121
+ | <html>
122
+ | <head>
123
+ | <body>
124
+ | <div>
125
+ | a="1"
126
+ | "x"
127
+
128
+ #data
129
+ <! first><?second
130
+ #errors
131
+ (1,1): expected-doctype-but-got-chars
132
+ #document
133
+ | <!-- first -->
134
+ | <html>
135
+ | <head>
136
+ | <body>
137
+
138
+ #data
139
+ <div \x00name=value>
140
+ #errors
141
+ (1,6): unexpected-null-character
142
+ (1,17): expected-doctype-but-got-start-tag
143
+ #document
144
+ | <html>
145
+ | <head>
146
+ | <body>
147
+ | <div>
148
+ | �name="value"
149
+
150
+ #data
151
+ <source\x00 x=y>
152
+ #errors
153
+ (1,8): unexpected-null-character
154
+ (1,13): expected-doctype-but-got-start-tag
155
+ #document
156
+ | <html>
157
+ | <head>
158
+ | <body>
159
+ | <source�>
160
+ | x="y"
161
+
162
+ #data
163
+ <html 1name='\x00'>
164
+ #errors
165
+ (1,14): unexpected-null-character
166
+ (1,16): expected-doctype-but-got-start-tag
167
+ #document
168
+ | <html>
169
+ | 1name="�"
170
+ | <head>
171
+ | <body>
172
+
173
+ #data
174
+ <source\x00 '='<script>alert(1)</script>'>
175
+ #errors
176
+ (1,8): unexpected-null-character
177
+ (1,20): expected-doctype-but-got-start-tag
178
+ (1,29): unexpected-end-tag
179
+ #document
180
+ | <html>
181
+ | <head>
182
+ | <body>
183
+ | <source�>
184
+ | '="<script>alert(1)</script>"
185
+
186
+ #data
187
+ </html><script>
188
+ #errors
189
+ (1,1): expected-doctype-but-got-chars
190
+ (1,1): unexpected-end-tag
191
+ #document
192
+ | <html>
193
+ | <head>
194
+ | <body>
195
+ | <script>
196
+
197
+ #data
198
+ </head></html><y>
199
+ #errors
200
+ (1,1): expected-doctype-but-got-chars
201
+ (1,1): unexpected-end-tag
202
+ (1,8): unexpected-end-tag
203
+ #document
204
+ | <html>
205
+ | <head>
206
+ | <body>
207
+ | <y>
208
+
209
+ #data
210
+ </html><</\x20
211
+ #errors
212
+ (1,1): expected-doctype-but-got-chars
213
+ (1,1): unexpected-end-tag
214
+ #document
215
+ | <html>
216
+ | <head>
217
+ | <body>
218
+ | "<"
219
+ | <!-- -->
220
+
221
+ #data
222
+ <i></body></f><
223
+ #errors
224
+ (1,3): expected-doctype-but-got-start-tag
225
+ (1,4): unexpected-end-tag
226
+ (1,11): unexpected-end-tag
227
+ #document
228
+ | <html>
229
+ | <head>
230
+ | <body>
231
+ | <i>
232
+ | "<"
233
+
234
+ #data
235
+ </>&#9
236
+ #errors
237
+ (1,1): expected-doctype-but-got-chars
238
+ #document
239
+ | <html>
240
+ | <head>
241
+ | <body>
242
+
243
+ #data
244
+ <!>&#xD
245
+ #errors
246
+ (1,1): expected-doctype-but-got-chars
247
+ #document
248
+ | <!-- -->
249
+ | <html>
250
+ | <head>
251
+ | <body>
252
+
253
+ #data
254
+ <!DOCTYPE>&#xD
255
+ #errors
256
+ (1,10): unknown-doctype
257
+ #document
258
+ | <!DOCTYPE >
259
+ | <html>
260
+ | <head>
261
+ | <body>
262
+
263
+ #data
264
+ </e>&#9
265
+ #errors
266
+ (1,1): expected-doctype-but-got-chars
267
+ (1,1): unexpected-end-tag
268
+ #document
269
+ | <html>
270
+ | <head>
271
+ | <body>
272
+
273
+ #data
274
+ </head></html>2</t></-
275
+ #errors
276
+ (1,1): expected-doctype-but-got-chars
277
+ (1,1): unexpected-end-tag
278
+ (1,8): unexpected-end-tag
279
+ (1,16): unexpected-end-tag
280
+ #document
281
+ | <html>
282
+ | <head>
283
+ | <body>
284
+ | "2"
285
+ | <!-- - -->
286
+
287
+ #data
288
+ <body id='a'><div><body id='b'>x</div>
289
+ #errors
290
+ (1,13): expected-doctype-but-got-start-tag
291
+ #document
292
+ | <html>
293
+ | <head>
294
+ | <body>
295
+ | id="a"
296
+ | <div>
297
+ | "x"
298
+
299
+ #data
300
+ <div><li>x<body class='late'>y
301
+ #errors
302
+ (1,5): expected-doctype-but-got-start-tag
303
+ #document
304
+ | <html>
305
+ | <head>
306
+ | <body>
307
+ | class="late"
308
+ | <div>
309
+ | <li>
310
+ | "xy"
311
+
312
+ #data
313
+ <div>x<head><title>ignored</title></head>y
314
+ #errors
315
+ (1,5): expected-doctype-but-got-start-tag
316
+ #document
317
+ | <html>
318
+ | <head>
319
+ | <body>
320
+ | <div>
321
+ | "x"
322
+ | <title>
323
+ | "ignored"
324
+ | "y"
325
+
326
+ #data
327
+ <!DOCTYPE html><body><command>A
328
+ #errors
329
+ #document
330
+ | <!DOCTYPE html>
331
+ | <html>
332
+ | <head>
333
+ | <body>
334
+ | <command>
335
+ | "A"
336
+
337
+ #data
338
+ <head></head>\x0a
339
+ #errors
340
+ #document
341
+ | <html>
342
+ | <head>
343
+ | "
344
+ "
345
+ | <body>
346
+
347
+ #data
348
+ <!doctype html><div></span\x0a>
349
+ #errors
350
+ #document
351
+ | <!DOCTYPE html>
352
+ | <html>
353
+ | <head>
354
+ | <body>
355
+ | <div>
356
+
357
+ #data
358
+ İ<!DOCTYPE html><p>x</p>
359
+ #errors
360
+ #document
361
+ | <html>
362
+ | <head>
363
+ | <body>
364
+ | "İ"
365
+ | <p>
366
+ | "x"