@tkeron/html-parser 0.1.7 → 1.1.0

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 (90) hide show
  1. package/README.md +1 -7
  2. package/bun.lock +5 -0
  3. package/index.ts +4 -0
  4. package/package.json +7 -1
  5. package/src/css-selector.ts +1 -1
  6. package/src/dom-simulator.ts +41 -17
  7. package/src/encoding.ts +39 -0
  8. package/src/index.ts +9 -0
  9. package/src/parser.ts +509 -143
  10. package/src/serializer.ts +450 -0
  11. package/src/tokenizer.ts +190 -118
  12. package/tests/advanced.test.ts +121 -108
  13. package/tests/custom-elements-head.test.ts +105 -0
  14. package/tests/dom-extended.test.ts +12 -12
  15. package/tests/dom-manipulation.test.ts +9 -10
  16. package/tests/dom.test.ts +32 -27
  17. package/tests/helpers/tokenizer-adapter.test.ts +70 -0
  18. package/tests/helpers/tokenizer-adapter.ts +65 -0
  19. package/tests/helpers/tree-adapter.test.ts +39 -0
  20. package/tests/helpers/tree-adapter.ts +60 -0
  21. package/tests/html5lib-data/tokenizer/namedEntities.test +42422 -0
  22. package/tests/html5lib-data/tokenizer/pendingSpecChanges.test +9 -0
  23. package/tests/html5lib-data/tree-construction/adoption01.dat +354 -0
  24. package/tests/html5lib-data/tree-construction/adoption02.dat +39 -0
  25. package/tests/html5lib-data/tree-construction/domjs-unsafe.dat +0 -0
  26. package/tests/html5lib-data/tree-construction/entities02.dat +309 -0
  27. package/tests/html5lib-data/tree-construction/html5test-com.dat +301 -0
  28. package/tests/html5lib-data/tree-construction/math.dat +104 -0
  29. package/tests/html5lib-data/tree-construction/namespace-sensitivity.dat +22 -0
  30. package/tests/html5lib-data/tree-construction/noscript01.dat +237 -0
  31. package/tests/html5lib-data/tree-construction/ruby.dat +302 -0
  32. package/tests/html5lib-data/tree-construction/scriptdata01.dat +372 -0
  33. package/tests/html5lib-data/tree-construction/svg.dat +104 -0
  34. package/tests/html5lib-data/tree-construction/template.dat +1673 -0
  35. package/tests/html5lib-data/tree-construction/tests10.dat +853 -0
  36. package/tests/html5lib-data/tree-construction/tests11.dat +523 -0
  37. package/tests/html5lib-data/tree-construction/tests20.dat +842 -0
  38. package/tests/html5lib-data/tree-construction/tests21.dat +306 -0
  39. package/tests/html5lib-data/tree-construction/tests23.dat +168 -0
  40. package/tests/html5lib-data/tree-construction/tests24.dat +79 -0
  41. package/tests/html5lib-data/tree-construction/tests5.dat +210 -0
  42. package/tests/html5lib-data/tree-construction/tests6.dat +663 -0
  43. package/tests/html5lib-data/tree-construction/tests_innerHTML_1.dat +844 -0
  44. package/tests/parser.test.ts +173 -193
  45. package/tests/serializer-core.test.ts +16 -0
  46. package/tests/serializer-data/core.test +125 -0
  47. package/tests/serializer-data/injectmeta.test +66 -0
  48. package/tests/serializer-data/optionaltags.test +965 -0
  49. package/tests/serializer-data/options.test +60 -0
  50. package/tests/serializer-data/whitespace.test +51 -0
  51. package/tests/serializer-injectmeta.test.ts +16 -0
  52. package/tests/serializer-optionaltags.test.ts +16 -0
  53. package/tests/serializer-options.test.ts +16 -0
  54. package/tests/serializer-whitespace.test.ts +16 -0
  55. package/tests/tokenizer-namedEntities.test.ts +20 -0
  56. package/tests/tokenizer-pendingSpecChanges.test.ts +20 -0
  57. package/tests/tokenizer.test.ts +25 -32
  58. package/tests/tree-construction-adoption01.test.ts +37 -0
  59. package/tests/tree-construction-adoption02.test.ts +34 -0
  60. package/tests/tree-construction-domjs-unsafe.test.ts +24 -0
  61. package/tests/tree-construction-entities02.test.ts +33 -0
  62. package/tests/tree-construction-html5test-com.test.ts +32 -0
  63. package/tests/tree-construction-math.test.ts +18 -0
  64. package/tests/tree-construction-namespace-sensitivity.test.ts +18 -0
  65. package/tests/tree-construction-noscript01.test.ts +18 -0
  66. package/tests/tree-construction-ruby.test.ts +21 -0
  67. package/tests/tree-construction-scriptdata01.test.ts +21 -0
  68. package/tests/tree-construction-svg.test.ts +21 -0
  69. package/tests/tree-construction-template.test.ts +21 -0
  70. package/tests/tree-construction-tests10.test.ts +21 -0
  71. package/tests/tree-construction-tests11.test.ts +21 -0
  72. package/tests/tree-construction-tests20.test.ts +18 -0
  73. package/tests/tree-construction-tests21.test.ts +18 -0
  74. package/tests/tree-construction-tests23.test.ts +18 -0
  75. package/tests/tree-construction-tests24.test.ts +18 -0
  76. package/tests/tree-construction-tests5.test.ts +21 -0
  77. package/tests/tree-construction-tests6.test.ts +21 -0
  78. package/tests/tree-construction-tests_innerHTML_1.test.ts +21 -0
  79. package/tests/custom-elements.test.ts +0 -745
  80. package/tests/official/README.md +0 -87
  81. package/tests/official/acid/acid-tests.test.ts +0 -309
  82. package/tests/official/final-output/final-output.test.ts +0 -361
  83. package/tests/official/html5lib/tokenizer-utils.ts +0 -192
  84. package/tests/official/html5lib/tokenizer.test.ts +0 -171
  85. package/tests/official/html5lib/tree-construction-utils.ts +0 -194
  86. package/tests/official/html5lib/tree-construction.test.ts +0 -250
  87. package/tests/official/validator/validator-tests.test.ts +0 -237
  88. package/tests/official/validator-nu/validator-nu.test.ts +0 -335
  89. package/tests/official/whatwg/whatwg-tests.test.ts +0 -205
  90. package/tests/official/wpt/wpt-tests.test.ts +0 -409
@@ -0,0 +1,104 @@
1
+ #data
2
+ <svg><tr><td><title><tr>
3
+ #errors
4
+ (1:21) Unexpected <tr> tag
5
+ (1:25) Unexpected EOF
6
+ #document-fragment
7
+ td
8
+ #document
9
+ | <svg svg>
10
+ | <svg tr>
11
+ | <svg td>
12
+ | <svg title>
13
+
14
+ #data
15
+ <svg><tr><td><title><tr>
16
+ #errors
17
+ (1:1) Unexpected <svg> tag
18
+ (1:21) Unexpected <tr> tag
19
+ (1:25) Unexpected EOF
20
+ #document-fragment
21
+ tr
22
+ #document
23
+ | <svg svg>
24
+ | <svg tr>
25
+ | <svg td>
26
+ | <svg title>
27
+
28
+ #data
29
+ <svg><thead><title><tbody>
30
+ #errors
31
+ (1:1) Unexpected <svg> tag
32
+ (1:20) Unexpected <tbody> tag
33
+ (1:27) Unexpected EOF
34
+ #document-fragment
35
+ thead
36
+ #document
37
+ | <svg svg>
38
+ | <svg thead>
39
+ | <svg title>
40
+
41
+ #data
42
+ <svg><tfoot><title><tbody>
43
+ #errors
44
+ (1:1) Unexpected <svg> tag
45
+ (1:20) Unexpected <tbody> tag
46
+ (1:27) Unexpected EOF
47
+ #document-fragment
48
+ tfoot
49
+ #document
50
+ | <svg svg>
51
+ | <svg tfoot>
52
+ | <svg title>
53
+
54
+ #data
55
+ <svg><tbody><title><tfoot>
56
+ #errors
57
+ (1:1) Unexpected <svg> tag
58
+ (1:20) Unexpected <tfoot> tag
59
+ (1:27) Unexpected EOF
60
+ #document-fragment
61
+ tbody
62
+ #document
63
+ | <svg svg>
64
+ | <svg tbody>
65
+ | <svg title>
66
+
67
+ #data
68
+ <svg><tbody><title></table>
69
+ #errors
70
+ (1:1) Unexpected <svg> tag
71
+ (1:20) Unexpected </table> tag
72
+ (1:28) Unexpected EOF
73
+ #document-fragment
74
+ tbody
75
+ #document
76
+ | <svg svg>
77
+ | <svg tbody>
78
+ | <svg title>
79
+
80
+ #data
81
+ <svg><thead><title></table>
82
+ #errors
83
+ (1:1) Unexpected <svg> tag
84
+ (1:20) Unexpected </table> tag
85
+ (1:28) Unexpected EOF
86
+ #document-fragment
87
+ tbody
88
+ #document
89
+ | <svg svg>
90
+ | <svg thead>
91
+ | <svg title>
92
+
93
+ #data
94
+ <svg><tfoot><title></table>
95
+ #errors
96
+ (1:1) Unexpected <svg> tag
97
+ (1:20) Unexpected </table> tag
98
+ (1:28) Unexpected EOF
99
+ #document-fragment
100
+ tbody
101
+ #document
102
+ | <svg svg>
103
+ | <svg tfoot>
104
+ | <svg title>