htmljs-parser 2.11.2 → 3.0.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 (1031) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +103 -106
  3. package/dist/core/Parser.d.ts +67 -0
  4. package/dist/index.d.ts +23 -0
  5. package/dist/index.js +2034 -0
  6. package/dist/index.mjs +2013 -0
  7. package/dist/internal.d.ts +4 -0
  8. package/dist/states/ATTRIBUTE.d.ts +18 -0
  9. package/dist/states/BEGIN_DELIMITED_HTML_BLOCK.d.ts +7 -0
  10. package/dist/states/CDATA.d.ts +3 -0
  11. package/dist/states/CLOSE_TAG.d.ts +3 -0
  12. package/dist/states/CONCISE_HTML_CONTENT.d.ts +2 -0
  13. package/dist/states/DECLARATION.d.ts +2 -0
  14. package/dist/states/DTD.d.ts +2 -0
  15. package/dist/states/EXPRESSION.d.ts +9 -0
  16. package/dist/states/HTML_COMMENT.d.ts +2 -0
  17. package/dist/states/HTML_CONTENT.d.ts +7 -0
  18. package/dist/states/INLINE_SCRIPT.d.ts +7 -0
  19. package/dist/states/JS_COMMENT_BLOCK.d.ts +2 -0
  20. package/dist/states/JS_COMMENT_LINE.d.ts +2 -0
  21. package/dist/states/OPEN_TAG.d.ts +25 -0
  22. package/dist/states/PARSED_TEXT_CONTENT.d.ts +7 -0
  23. package/dist/states/PLACEHOLDER.d.ts +7 -0
  24. package/dist/states/REGULAR_EXPRESSION.d.ts +6 -0
  25. package/dist/states/STRING.d.ts +6 -0
  26. package/dist/states/TAG_NAME.d.ts +5 -0
  27. package/dist/states/TEMPLATE_STRING.d.ts +2 -0
  28. package/dist/states/index.d.ts +20 -0
  29. package/dist/util/constants.d.ts +131 -0
  30. package/dist/util/util.d.ts +7 -0
  31. package/package.json +67 -30
  32. package/.jshintrc +0 -29
  33. package/.travis.yml +0 -8
  34. package/BaseParser.js +0 -188
  35. package/Parser.js +0 -3324
  36. package/html-tags.js +0 -126
  37. package/index.js +0 -6
  38. package/notify-util.js +0 -319
  39. package/operators.js +0 -65
  40. package/test/.jshintrc +0 -43
  41. package/test/1.x-test.js +0 -6
  42. package/test/autotest/argument-and-params/expected.html +0 -17
  43. package/test/autotest/argument-and-params/input.htmljs +0 -6
  44. package/test/autotest/argument-attr/expected.html +0 -2
  45. package/test/autotest/argument-attr/input.htmljs +0 -1
  46. package/test/autotest/argument-attr-extra-whitespace/expected.html +0 -4
  47. package/test/autotest/argument-attr-extra-whitespace/input.htmljs +0 -2
  48. package/test/autotest/argument-attr-multiple/expected.html +0 -1
  49. package/test/autotest/argument-attr-multiple/input.htmljs +0 -1
  50. package/test/autotest/argument-tag/expected.html +0 -9
  51. package/test/autotest/argument-tag/input.htmljs +0 -3
  52. package/test/autotest/argument-tag-attr/expected.html +0 -2
  53. package/test/autotest/argument-tag-attr/input.htmljs +0 -1
  54. package/test/autotest/argument-tag-complex/expected.html +0 -2
  55. package/test/autotest/argument-tag-complex/input.htmljs +0 -1
  56. package/test/autotest/argument-tag-extra-whitespace/expected.html +0 -2
  57. package/test/autotest/argument-tag-extra-whitespace/input.htmljs +0 -1
  58. package/test/autotest/argument-tag-multiple/expected.html +0 -1
  59. package/test/autotest/argument-tag-multiple/input.htmljs +0 -1
  60. package/test/autotest/argument-tag-nested-parens/expected.html +0 -3
  61. package/test/autotest/argument-tag-nested-parens/input.htmljs +0 -4
  62. package/test/autotest/attr-bound/expected.html +0 -23
  63. package/test/autotest/attr-bound/input.htmljs +0 -6
  64. package/test/autotest/attr-comma-multiline/expected.html +0 -3
  65. package/test/autotest/attr-comma-multiline/input.htmljs +0 -6
  66. package/test/autotest/attr-complex/expected.html +0 -3
  67. package/test/autotest/attr-complex/input.htmljs +0 -1
  68. package/test/autotest/attr-complex-instanceof/expected.html +0 -2
  69. package/test/autotest/attr-complex-instanceof/input.htmljs +0 -1
  70. package/test/autotest/attr-escape-characters/expected.html +0 -3
  71. package/test/autotest/attr-escape-characters/input.htmljs +0 -3
  72. package/test/autotest/attr-escaped-dollar/expected.html +0 -1
  73. package/test/autotest/attr-escaped-dollar/input.htmljs +0 -1
  74. package/test/autotest/attr-escaped-dollar/test.js +0 -5
  75. package/test/autotest/attr-grouped/expected.html +0 -3
  76. package/test/autotest/attr-grouped/input.htmljs +0 -5
  77. package/test/autotest/attr-grouped-2/expected.html +0 -3
  78. package/test/autotest/attr-grouped-2/input.htmljs +0 -5
  79. package/test/autotest/attr-grouped-3/expected.html +0 -3
  80. package/test/autotest/attr-grouped-3/input.htmljs +0 -5
  81. package/test/autotest/attr-grouped-4/expected.html +0 -3
  82. package/test/autotest/attr-grouped-4/input.htmljs +0 -5
  83. package/test/autotest/attr-grouped-invalid/expected.html +0 -1
  84. package/test/autotest/attr-grouped-invalid/input.htmljs +0 -5
  85. package/test/autotest/attr-grouped-invalid-eof/expected.html +0 -1
  86. package/test/autotest/attr-grouped-invalid-eof/input.htmljs +0 -4
  87. package/test/autotest/attr-grouped-multiple/expected.html +0 -3
  88. package/test/autotest/attr-grouped-multiple/input.htmljs +0 -4
  89. package/test/autotest/attr-inc-and-dec/expected.html +0 -4
  90. package/test/autotest/attr-inc-and-dec/input.htmljs +0 -2
  91. package/test/autotest/attr-inconsistent-commas/expected.html +0 -1
  92. package/test/autotest/attr-inconsistent-commas/input.htmljs +0 -1
  93. package/test/autotest/attr-int-and-id/expected.html +0 -2
  94. package/test/autotest/attr-int-and-id/input.htmljs +0 -1
  95. package/test/autotest/attr-literal-false/expected.html +0 -2
  96. package/test/autotest/attr-literal-false/input.htmljs +0 -1
  97. package/test/autotest/attr-literal-false/test.js +0 -1
  98. package/test/autotest/attr-literal-null/expected.html +0 -2
  99. package/test/autotest/attr-literal-null/input.htmljs +0 -1
  100. package/test/autotest/attr-literal-null/test.js +0 -1
  101. package/test/autotest/attr-literal-numbers/expected.html +0 -2
  102. package/test/autotest/attr-literal-numbers/input.htmljs +0 -1
  103. package/test/autotest/attr-literal-numbers/test.js +0 -1
  104. package/test/autotest/attr-literal-regex/expected.html +0 -11
  105. package/test/autotest/attr-literal-regex/input.htmljs +0 -4
  106. package/test/autotest/attr-literal-string-double-quotes/expected.html +0 -2
  107. package/test/autotest/attr-literal-string-double-quotes/input.htmljs +0 -1
  108. package/test/autotest/attr-literal-string-double-quotes/test.js +0 -1
  109. package/test/autotest/attr-literal-string-single-quotes/expected.html +0 -2
  110. package/test/autotest/attr-literal-string-single-quotes/input.htmljs +0 -1
  111. package/test/autotest/attr-literal-string-single-quotes/test.js +0 -1
  112. package/test/autotest/attr-literal-true/expected.html +0 -2
  113. package/test/autotest/attr-literal-true/input.htmljs +0 -1
  114. package/test/autotest/attr-literal-true/test.js +0 -1
  115. package/test/autotest/attr-literal-undefined/expected.html +0 -2
  116. package/test/autotest/attr-literal-undefined/input.htmljs +0 -1
  117. package/test/autotest/attr-literal-undefined/test.js +0 -1
  118. package/test/autotest/attr-method-shorthand/expected.html +0 -14
  119. package/test/autotest/attr-method-shorthand/input.htmljs +0 -39
  120. package/test/autotest/attr-multi-line-comment/expected.html +0 -3
  121. package/test/autotest/attr-multi-line-comment/input.htmljs +0 -1
  122. package/test/autotest/attr-multi-line-string/expected.html +0 -2
  123. package/test/autotest/attr-multi-line-string/input.htmljs +0 -3
  124. package/test/autotest/attr-name-with-html-chars/expected.html +0 -1
  125. package/test/autotest/attr-name-with-html-chars/input.htmljs +0 -1
  126. package/test/autotest/attr-nested-literal-regex/expected.html +0 -2
  127. package/test/autotest/attr-nested-literal-regex/input.htmljs +0 -1
  128. package/test/autotest/attr-no-value/expected.html +0 -3
  129. package/test/autotest/attr-no-value/input.htmljs +0 -1
  130. package/test/autotest/attr-no-value-self-closed/expected.html +0 -2
  131. package/test/autotest/attr-no-value-self-closed/input.htmljs +0 -1
  132. package/test/autotest/attr-non-literal/expected.html +0 -5
  133. package/test/autotest/attr-non-literal/input.htmljs +0 -2
  134. package/test/autotest/attr-non-literal/test.js +0 -1
  135. package/test/autotest/attr-object-expressions/expected.html +0 -4
  136. package/test/autotest/attr-object-expressions/input.htmljs +0 -3
  137. package/test/autotest/attr-simple-expression/expected.html +0 -3
  138. package/test/autotest/attr-simple-expression/input.htmljs +0 -1
  139. package/test/autotest/attr-unenclosed-whitespace/expected.html +0 -2
  140. package/test/autotest/attr-unenclosed-whitespace/input.htmljs +0 -1
  141. package/test/autotest/attr-unenclosed-whitespace-minus/expected.html +0 -2
  142. package/test/autotest/attr-unenclosed-whitespace-minus/input.htmljs +0 -1
  143. package/test/autotest/attr-unenclosed-whitespace-multiple-attrs/expected.html +0 -5
  144. package/test/autotest/attr-unenclosed-whitespace-multiple-attrs/input.htmljs +0 -2
  145. package/test/autotest/attr-unenclosed-whitespace-odd/expected.html +0 -2
  146. package/test/autotest/attr-unenclosed-whitespace-odd/input.htmljs +0 -1
  147. package/test/autotest/attr-value-self-closed/expected.html +0 -2
  148. package/test/autotest/attr-value-self-closed/input.htmljs +0 -1
  149. package/test/autotest/attr-value-single-quote-escaped/expected.html +0 -2
  150. package/test/autotest/attr-value-single-quote-escaped/input.htmljs +0 -1
  151. package/test/autotest/attr-value-string-concat/expected.html +0 -2
  152. package/test/autotest/attr-value-string-concat/input.htmljs +0 -1
  153. package/test/autotest/attr-value-typeof/expected.html +0 -2
  154. package/test/autotest/attr-value-typeof/input.htmljs +0 -1
  155. package/test/autotest/attr-value-typeof-comma/expected.html +0 -2
  156. package/test/autotest/attr-value-typeof-comma/input.htmljs +0 -1
  157. package/test/autotest/attr-value-typeof-no-space-prefix/expected.html +0 -2
  158. package/test/autotest/attr-value-typeof-no-space-prefix/input.htmljs +0 -1
  159. package/test/autotest/attr-value-void/expected.html +0 -2
  160. package/test/autotest/attr-value-void/input.htmljs +0 -1
  161. package/test/autotest/attr-with-parens-and-double-quoted-strings/expected.html +0 -2
  162. package/test/autotest/attr-with-parens-and-double-quoted-strings/input.htmljs +0 -1
  163. package/test/autotest/attr-with-parens-and-single-quoted-strings/expected.html +0 -2
  164. package/test/autotest/attr-with-parens-and-single-quoted-strings/input.htmljs +0 -1
  165. package/test/autotest/attr-with-right-angle-bracket/expected.html +0 -3
  166. package/test/autotest/attr-with-right-angle-bracket/input.htmljs +0 -1
  167. package/test/autotest/attr-with-right-angle-bracket-parens/expected.html +0 -3
  168. package/test/autotest/attr-with-right-angle-bracket-parens/input.htmljs +0 -1
  169. package/test/autotest/attr-without-delimiters/expected.html +0 -2
  170. package/test/autotest/attr-without-delimiters/input.htmljs +0 -1
  171. package/test/autotest/backtick-string/expected.html +0 -3
  172. package/test/autotest/backtick-string/input.htmljs +0 -2
  173. package/test/autotest/backtick-string-eof/expected.html +0 -1
  174. package/test/autotest/backtick-string-eof/input.htmljs +0 -2
  175. package/test/autotest/backtick-string-nested-with-space/expected.html +0 -2
  176. package/test/autotest/backtick-string-nested-with-space/input.htmljs +0 -1
  177. package/test/autotest/backtick-string-placeholder-newline/expected.html +0 -4
  178. package/test/autotest/backtick-string-placeholder-newline/input.htmljs +0 -3
  179. package/test/autotest/bad-tag-indent/expected.html +0 -1
  180. package/test/autotest/bad-tag-indent/input.htmljs +0 -1
  181. package/test/autotest/cdata/expected.html +0 -3
  182. package/test/autotest/cdata/input.htmljs +0 -1
  183. package/test/autotest/cdata-2/expected.html +0 -5
  184. package/test/autotest/cdata-2/input.htmljs +0 -3
  185. package/test/autotest/cdata-pos/expected.html +0 -7
  186. package/test/autotest/cdata-pos/input.htmljs +0 -4
  187. package/test/autotest/cdata-pos/test.js +0 -1
  188. package/test/autotest/comma-ends-attr-operators/expected.html +0 -2
  189. package/test/autotest/comma-ends-attr-operators/input.htmljs +0 -1
  190. package/test/autotest/commas-relax/expected.html +0 -2
  191. package/test/autotest/commas-relax/input.htmljs +0 -1
  192. package/test/autotest/commas-relax/test.js +0 -7
  193. package/test/autotest/commas-require-all-attrs-first/expected.html +0 -1
  194. package/test/autotest/commas-require-all-attrs-first/input.htmljs +0 -1
  195. package/test/autotest/commas-require-all-attrs-last/expected.html +0 -1
  196. package/test/autotest/commas-require-all-attrs-last/input.htmljs +0 -1
  197. package/test/autotest/comment-concise-js-block/expected.html +0 -4
  198. package/test/autotest/comment-concise-js-block/input.htmljs +0 -6
  199. package/test/autotest/comment-concise-js-block-trailing/expected.html +0 -4
  200. package/test/autotest/comment-concise-js-block-trailing/input.htmljs +0 -6
  201. package/test/autotest/comment-concise-js-line/expected.html +0 -4
  202. package/test/autotest/comment-concise-js-line/input.htmljs +0 -3
  203. package/test/autotest/comments-within-open-tag/expected.html +0 -2
  204. package/test/autotest/comments-within-open-tag/input.htmljs +0 -1
  205. package/test/autotest/complex/expected.html +0 -24
  206. package/test/autotest/complex/input.htmljs +0 -22
  207. package/test/autotest/complex-attr-name/expected.html +0 -2
  208. package/test/autotest/complex-attr-name/input.htmljs +0 -1
  209. package/test/autotest/concise-complex-tag-name/expected.html +0 -2
  210. package/test/autotest/concise-complex-tag-name/input.htmljs +0 -1
  211. package/test/autotest/concise-contentplaceholder-html-start/expected.html +0 -5
  212. package/test/autotest/concise-contentplaceholder-html-start/input.htmljs +0 -1
  213. package/test/autotest/concise-contentplaceholder-start/expected.html +0 -1
  214. package/test/autotest/concise-contentplaceholder-start/input.htmljs +0 -1
  215. package/test/autotest/concise-hyphen-after-tag-name/expected.html +0 -1
  216. package/test/autotest/concise-hyphen-after-tag-name/input.htmljs +0 -1
  217. package/test/autotest/css-calc/expected.html +0 -6
  218. package/test/autotest/css-calc/input.htmljs +0 -5
  219. package/test/autotest/declaration/expected.html +0 -1
  220. package/test/autotest/declaration/input.htmljs +0 -1
  221. package/test/autotest/default-attr/expected.html +0 -2
  222. package/test/autotest/default-attr/input.htmljs +0 -1
  223. package/test/autotest/default-attr-comma/expected.html +0 -2
  224. package/test/autotest/default-attr-comma/input.htmljs +0 -1
  225. package/test/autotest/default-attr-no-space/expected.html +0 -6
  226. package/test/autotest/default-attr-no-space/input.htmljs +0 -3
  227. package/test/autotest/double-hyphen-block/expected.html +0 -12
  228. package/test/autotest/double-hyphen-block/input.htmljs +0 -8
  229. package/test/autotest/double-hyphen-line/expected.html +0 -12
  230. package/test/autotest/double-hyphen-line/input.htmljs +0 -5
  231. package/test/autotest/double-hyphen-line-start/expected.html +0 -12
  232. package/test/autotest/double-hyphen-line-start/input.htmljs +0 -6
  233. package/test/autotest/dtd/expected.html +0 -1
  234. package/test/autotest/dtd/input.htmljs +0 -1
  235. package/test/autotest/empty-closing-tag/expected.html +0 -8
  236. package/test/autotest/empty-closing-tag/input.htmljs +0 -6
  237. package/test/autotest/empty-closing-tag2/expected.html +0 -9
  238. package/test/autotest/empty-closing-tag2/input.htmljs +0 -5
  239. package/test/autotest/eof-attr-argument/expected.html +0 -1
  240. package/test/autotest/eof-attr-argument/input.htmljs +0 -1
  241. package/test/autotest/eof-attr-name/expected.html +0 -3
  242. package/test/autotest/eof-attr-name/input.htmljs +0 -1
  243. package/test/autotest/eof-attr-value/expected.html +0 -3
  244. package/test/autotest/eof-attr-value/input.htmljs +0 -1
  245. package/test/autotest/eof-attr-value-js-comment-comment/expected.html +0 -3
  246. package/test/autotest/eof-attr-value-js-comment-comment/input.htmljs +0 -1
  247. package/test/autotest/eof-attr-value-js-comment-comment-concise/expected.html +0 -1
  248. package/test/autotest/eof-attr-value-js-comment-comment-concise/input.htmljs +0 -1
  249. package/test/autotest/eof-attr-value-string/expected.html +0 -1
  250. package/test/autotest/eof-attr-value-string/input.htmljs +0 -1
  251. package/test/autotest/eof-doctype/expected.html +0 -1
  252. package/test/autotest/eof-doctype/input.htmljs +0 -1
  253. package/test/autotest/eof-placeholder-body-escaped/expected.html +0 -4
  254. package/test/autotest/eof-placeholder-body-escaped/input.htmljs +0 -1
  255. package/test/autotest/eof-placeholder-body-non-escaped/expected.html +0 -4
  256. package/test/autotest/eof-placeholder-body-non-escaped/input.htmljs +0 -4
  257. package/test/autotest/eof-placeholder-concise/expected.html +0 -3
  258. package/test/autotest/eof-placeholder-concise/input.htmljs +0 -2
  259. package/test/autotest/eof-placeholder-script-body-escaped/expected.html +0 -4
  260. package/test/autotest/eof-placeholder-script-body-escaped/input.htmljs +0 -1
  261. package/test/autotest/eof-placeholder-script-body-non-escaped/expected.html +0 -4
  262. package/test/autotest/eof-placeholder-script-body-non-escaped/input.htmljs +0 -1
  263. package/test/autotest/eof-placeholder-string/expected.html +0 -4
  264. package/test/autotest/eof-placeholder-string/input.htmljs +0 -1
  265. package/test/autotest/eof-script-body/expected.html +0 -4
  266. package/test/autotest/eof-script-body/input.htmljs +0 -2
  267. package/test/autotest/eof-style/expected.html +0 -4
  268. package/test/autotest/eof-style/input.htmljs +0 -1
  269. package/test/autotest/eof-tag-start/expected.html +0 -3
  270. package/test/autotest/eof-tag-start/input.htmljs +0 -1
  271. package/test/autotest/eof-xml-declaration/expected.html +0 -1
  272. package/test/autotest/eof-xml-declaration/input.htmljs +0 -1
  273. package/test/autotest/html-block-after-tag/expected.html +0 -6
  274. package/test/autotest/html-block-after-tag/input.htmljs +0 -1
  275. package/test/autotest/html-comments/expected.html +0 -3
  276. package/test/autotest/html-comments/input.htmljs +0 -1
  277. package/test/autotest/html-comments-ignore-placeholders/expected.html +0 -1
  278. package/test/autotest/html-comments-ignore-placeholders/input.htmljs +0 -1
  279. package/test/autotest/ignoreAttributes/expected.html +0 -2
  280. package/test/autotest/ignoreAttributes/input.htmljs +0 -1
  281. package/test/autotest/ignoreAttributes/test.js +0 -7
  282. package/test/autotest/ignoreNonstandardStringPlaceholders/expected.html +0 -2
  283. package/test/autotest/ignoreNonstandardStringPlaceholders/input.htmljs +0 -1
  284. package/test/autotest/ignoreNonstandardStringPlaceholders/test.js +0 -1
  285. package/test/autotest/ignorePlaceholders-attr-double-escaped-dollar-placeholder/expected.html +0 -2
  286. package/test/autotest/ignorePlaceholders-attr-double-escaped-dollar-placeholder/input.htmljs +0 -1
  287. package/test/autotest/ignorePlaceholders-attr-double-escaped-dollar-placeholder/test.js +0 -1
  288. package/test/autotest/ignorePlaceholders-attr-escaped-dollar-placeholder/expected.html +0 -2
  289. package/test/autotest/ignorePlaceholders-attr-escaped-dollar-placeholder/input.htmljs +0 -1
  290. package/test/autotest/ignorePlaceholders-attr-escaped-dollar-placeholder/test.js +0 -1
  291. package/test/autotest/ignorePlaceholders-attr-placeholder/expected.html +0 -2
  292. package/test/autotest/ignorePlaceholders-attr-placeholder/input.htmljs +0 -1
  293. package/test/autotest/ignorePlaceholders-attr-placeholder/test.js +0 -1
  294. package/test/autotest/invalid-closing-tag/expected.html +0 -4
  295. package/test/autotest/invalid-closing-tag/input.htmljs +0 -1
  296. package/test/autotest/mixed/expected.html +0 -21
  297. package/test/autotest/mixed/input.htmljs +0 -8
  298. package/test/autotest/mixed-bad-indentation/expected.html +0 -7
  299. package/test/autotest/mixed-bad-indentation/input.htmljs +0 -3
  300. package/test/autotest/mixed-cdata/expected.html +0 -7
  301. package/test/autotest/mixed-cdata/input.htmljs +0 -3
  302. package/test/autotest/mixed-comment/expected.html +0 -7
  303. package/test/autotest/mixed-comment/input.htmljs +0 -6
  304. package/test/autotest/mixed-invalid/expected.html +0 -16
  305. package/test/autotest/mixed-invalid/input.htmljs +0 -9
  306. package/test/autotest/mixed-open-tag-only/expected.html +0 -14
  307. package/test/autotest/mixed-open-tag-only/input.htmljs +0 -6
  308. package/test/autotest/multiline-html-block/expected.html +0 -5
  309. package/test/autotest/multiline-html-block/input.htmljs +0 -4
  310. package/test/autotest/multiline-html-block-empty/expected.html +0 -0
  311. package/test/autotest/multiline-html-block-empty/input.htmljs +0 -2
  312. package/test/autotest/multiline-html-block-missing-end/expected.html +0 -7
  313. package/test/autotest/multiline-html-block-missing-end/input.htmljs +0 -12
  314. package/test/autotest/multiline-html-block-nested/expected.html +0 -7
  315. package/test/autotest/multiline-html-block-nested/input.htmljs +0 -5
  316. package/test/autotest/multiline-html-block-nested-empty/expected.html +0 -2
  317. package/test/autotest/multiline-html-block-nested-empty/input.htmljs +0 -3
  318. package/test/autotest/multiline-html-block-same-line/expected.html +0 -6
  319. package/test/autotest/multiline-html-block-same-line/input.htmljs +0 -7
  320. package/test/autotest/multiline-text-block/expected.html +0 -1
  321. package/test/autotest/multiline-text-block/input.htmljs +0 -4
  322. package/test/autotest/multiline-text-block-bad/expected.html +0 -1
  323. package/test/autotest/multiline-text-block-bad/input.htmljs +0 -5
  324. package/test/autotest/multiline-text-block-with-hyphens/expected.html +0 -1
  325. package/test/autotest/multiline-text-block-with-hyphens/input.htmljs +0 -4
  326. package/test/autotest/multiple-tags-on-line-close-next/input.htmljs +0 -2
  327. package/test/autotest/multiple-tags-on-line-close-next/test.js +0 -1
  328. package/test/autotest/nested-pyramid/expected.html +0 -12
  329. package/test/autotest/nested-pyramid/input.htmljs +0 -6
  330. package/test/autotest/nested-siblings/expected.html +0 -6
  331. package/test/autotest/nested-siblings/input.htmljs +0 -3
  332. package/test/autotest/nested-tags/expected.html +0 -4
  333. package/test/autotest/nested-tags/input.htmljs +0 -2
  334. package/test/autotest/nested-text/expected.html +0 -8
  335. package/test/autotest/nested-text/input.htmljs +0 -8
  336. package/test/autotest/open-tag-only/expected.html +0 -12
  337. package/test/autotest/open-tag-only/input.htmljs +0 -1
  338. package/test/autotest/open-tag-only-custom/expected.html +0 -10
  339. package/test/autotest/open-tag-only-custom/input.htmljs +0 -4
  340. package/test/autotest/open-tag-only-custom/test.js +0 -9
  341. package/test/autotest/open-tag-only-with-body/expected.html +0 -4
  342. package/test/autotest/open-tag-only-with-body/input.htmljs +0 -5
  343. package/test/autotest/open-tag-only-with-body-concise/expected.html +0 -3
  344. package/test/autotest/open-tag-only-with-body-concise/input.htmljs +0 -2
  345. package/test/autotest/open-tag-parser-state/expected.html +0 -21
  346. package/test/autotest/open-tag-parser-state/input.htmljs +0 -11
  347. package/test/autotest/open-tag-parser-state/test.js +0 -21
  348. package/test/autotest/open-tag-parser-state-concise/expected.html +0 -19
  349. package/test/autotest/open-tag-parser-state-concise/input.htmljs +0 -17
  350. package/test/autotest/open-tag-parser-state-concise/test.js +0 -17
  351. package/test/autotest/param-tag/expected.html +0 -2
  352. package/test/autotest/param-tag/input.htmljs +0 -1
  353. package/test/autotest/parsed-text-placeholder-in-template-literal-string/expected.html +0 -4
  354. package/test/autotest/parsed-text-placeholder-in-template-literal-string/input.htmljs +0 -3
  355. package/test/autotest/parsed-text-placeholder-in-template-literal-string/test.js +0 -1
  356. package/test/autotest/parsed-text-style-tag/expected.html +0 -3
  357. package/test/autotest/parsed-text-style-tag/input.htmljs +0 -1
  358. package/test/autotest/placeholder-attr-invalid/expected.html +0 -1
  359. package/test/autotest/placeholder-attr-invalid/input.htmljs +0 -1
  360. package/test/autotest/placeholder-attr-string-value/expected.html +0 -3
  361. package/test/autotest/placeholder-attr-string-value/input.htmljs +0 -1
  362. package/test/autotest/placeholder-attr-string-value-mixed-quotes/expected.html +0 -3
  363. package/test/autotest/placeholder-attr-string-value-mixed-quotes/input.htmljs +0 -1
  364. package/test/autotest/placeholder-attr-string-value-parens/expected.html +0 -3
  365. package/test/autotest/placeholder-attr-string-value-parens/input.htmljs +0 -1
  366. package/test/autotest/placeholder-attr-within-placeholder/expected.html +0 -2
  367. package/test/autotest/placeholder-attr-within-placeholder/input.htmljs +0 -1
  368. package/test/autotest/placeholder-attr-within-string-complex/expected.html +0 -2
  369. package/test/autotest/placeholder-attr-within-string-complex/input.htmljs +0 -1
  370. package/test/autotest/placeholder-attr-within-string-simple/expected.html +0 -2
  371. package/test/autotest/placeholder-attr-within-string-simple/input.htmljs +0 -1
  372. package/test/autotest/placeholder-attr-wrapped/expected.html +0 -2
  373. package/test/autotest/placeholder-attr-wrapped/input.htmljs +0 -1
  374. package/test/autotest/placeholder-backslash/expected.html +0 -23
  375. package/test/autotest/placeholder-backslash/input.htmljs +0 -15
  376. package/test/autotest/placeholder-body-multi-line-js-comment/expected.html +0 -3
  377. package/test/autotest/placeholder-body-multi-line-js-comment/input.htmljs +0 -1
  378. package/test/autotest/placeholder-body-single-line-js-comment/expected.html +0 -3
  379. package/test/autotest/placeholder-body-single-line-js-comment/input.htmljs +0 -2
  380. package/test/autotest/placeholder-body-text/expected.html +0 -5
  381. package/test/autotest/placeholder-body-text/input.htmljs +0 -1
  382. package/test/autotest/placeholder-escape/expected.html +0 -5
  383. package/test/autotest/placeholder-escape/input.htmljs +0 -3
  384. package/test/autotest/placeholder-no-escape/expected.html +0 -5
  385. package/test/autotest/placeholder-no-escape/input.htmljs +0 -3
  386. package/test/autotest/placeholder-tag-name-concise/expected.html +0 -2
  387. package/test/autotest/placeholder-tag-name-concise/input.htmljs +0 -1
  388. package/test/autotest/placeholder-tag-name-html/expected.html +0 -2
  389. package/test/autotest/placeholder-tag-name-html/input.htmljs +0 -1
  390. package/test/autotest/placeholder-unnamed-attr/expected.html +0 -2
  391. package/test/autotest/placeholder-unnamed-attr/input.htmljs +0 -1
  392. package/test/autotest/placeholder-unnamed-attr-escaped/expected.html +0 -2
  393. package/test/autotest/placeholder-unnamed-attr-escaped/input.htmljs +0 -1
  394. package/test/autotest/placeholder-unnamed-attr-escaped-escaped/expected.html +0 -2
  395. package/test/autotest/placeholder-unnamed-attr-escaped-escaped/input.htmljs +0 -1
  396. package/test/autotest/placeholder-unnamed-attr-last/expected.html +0 -2
  397. package/test/autotest/placeholder-unnamed-attr-last/input.htmljs +0 -1
  398. package/test/autotest/placeholder-unnamed-attr-last-concise/expected.html +0 -4
  399. package/test/autotest/placeholder-unnamed-attr-last-concise/input.htmljs +0 -2
  400. package/test/autotest/placeholder-unnamed-attr-last-self-closed/expected.html +0 -2
  401. package/test/autotest/placeholder-unnamed-attr-last-self-closed/input.htmljs +0 -1
  402. package/test/autotest/placeholder-unnamed-attr-trailing-text/expected.html +0 -1
  403. package/test/autotest/placeholder-unnamed-attr-trailing-text/input.htmljs +0 -1
  404. package/test/autotest/placeholder-within-placeholder/expected.html +0 -1
  405. package/test/autotest/placeholder-within-placeholder/input.htmljs +0 -1
  406. package/test/autotest/placeholder-within-placeholder-escaping/expected.html +0 -1
  407. package/test/autotest/placeholder-within-placeholder-escaping/input.htmljs +0 -1
  408. package/test/autotest/placeholder-within-script-tag/expected.html +0 -5
  409. package/test/autotest/placeholder-within-script-tag/input.htmljs +0 -1
  410. package/test/autotest/placeholder-within-script-within-string/expected.html +0 -5
  411. package/test/autotest/placeholder-within-script-within-string/input.htmljs +0 -1
  412. package/test/autotest/placeholder-within-string-newlines/expected.html +0 -4
  413. package/test/autotest/placeholder-within-string-newlines/input.htmljs +0 -3
  414. package/test/autotest/root-el/expected.html +0 -2
  415. package/test/autotest/root-el/input.htmljs +0 -1
  416. package/test/autotest/root-els/expected.html +0 -4
  417. package/test/autotest/root-els/input.htmljs +0 -2
  418. package/test/autotest/script/expected.html +0 -3
  419. package/test/autotest/script/input.htmljs +0 -2
  420. package/test/autotest/script-concise/expected.html +0 -6
  421. package/test/autotest/script-concise/input.htmljs +0 -7
  422. package/test/autotest/script-concise-invalid-nested-tag/expected.html +0 -3
  423. package/test/autotest/script-concise-invalid-nested-tag/input.htmljs +0 -3
  424. package/test/autotest/script-empty-concise/expected.html +0 -6
  425. package/test/autotest/script-empty-concise/input.htmljs +0 -3
  426. package/test/autotest/script-escaped-placeholder/expected.html +0 -5
  427. package/test/autotest/script-escaped-placeholder/input.htmljs +0 -4
  428. package/test/autotest/script-self-closed/expected.html +0 -9
  429. package/test/autotest/script-self-closed/input.htmljs +0 -4
  430. package/test/autotest/script-single-line-comment/expected.html +0 -3
  431. package/test/autotest/script-single-line-comment/input.htmljs +0 -1
  432. package/test/autotest/scriptlet-block/expected.html +0 -1
  433. package/test/autotest/scriptlet-block/input.htmljs +0 -4
  434. package/test/autotest/scriptlet-block-division/expected.html +0 -1
  435. package/test/autotest/scriptlet-block-division/input.htmljs +0 -4
  436. package/test/autotest/scriptlet-block-html/expected.html +0 -1
  437. package/test/autotest/scriptlet-block-html/input.htmljs +0 -6
  438. package/test/autotest/scriptlet-block-invalid-comment/expected.html +0 -1
  439. package/test/autotest/scriptlet-block-invalid-comment/input.htmljs +0 -3
  440. package/test/autotest/scriptlet-block-multiline-comment/expected.html +0 -1
  441. package/test/autotest/scriptlet-block-multiline-comment/input.htmljs +0 -4
  442. package/test/autotest/scriptlet-block-nested/expected.html +0 -1
  443. package/test/autotest/scriptlet-block-nested/input.htmljs +0 -16
  444. package/test/autotest/scriptlet-block-regex/expected.html +0 -1
  445. package/test/autotest/scriptlet-block-regex/input.htmljs +0 -4
  446. package/test/autotest/scriptlet-block-single-line-comment/expected.html +0 -1
  447. package/test/autotest/scriptlet-block-single-line-comment/input.htmljs +0 -4
  448. package/test/autotest/scriptlet-block-template-literal-href/expected.html +0 -1
  449. package/test/autotest/scriptlet-block-template-literal-href/input.htmljs +0 -4
  450. package/test/autotest/scriptlet-line/expected.html +0 -1
  451. package/test/autotest/scriptlet-line/input.htmljs +0 -1
  452. package/test/autotest/scriptlet-line-continue/expected.html +0 -1
  453. package/test/autotest/scriptlet-line-continue/input.htmljs +0 -3
  454. package/test/autotest/scriptlet-line-continue-chain/expected.html +0 -3
  455. package/test/autotest/scriptlet-line-continue-chain/input.htmljs +0 -8
  456. package/test/autotest/scriptlet-line-html/expected.html +0 -1
  457. package/test/autotest/scriptlet-line-html/input.htmljs +0 -3
  458. package/test/autotest/scriptlet-line-multiline-comments/expected.html +0 -5
  459. package/test/autotest/scriptlet-line-multiline-comments/input.htmljs +0 -7
  460. package/test/autotest/scriptlet-line-no-middle/expected.html +0 -2
  461. package/test/autotest/scriptlet-line-no-middle/input.htmljs +0 -1
  462. package/test/autotest/scriptlet-line-no-middle-html/expected.html +0 -1
  463. package/test/autotest/scriptlet-line-no-middle-html/input.htmljs +0 -3
  464. package/test/autotest/scriptlet-line-regex-open-bracket/input.htmljs +0 -1
  465. package/test/autotest/scriptlet-line-regex-open-bracket/test.js +0 -1
  466. package/test/autotest/scriptlet-line-regex-open-curly/input.htmljs +0 -1
  467. package/test/autotest/scriptlet-line-regex-open-curly/test.js +0 -1
  468. package/test/autotest/scriptlet-line-template-literal/expected.html +0 -1
  469. package/test/autotest/scriptlet-line-template-literal/input.htmljs +0 -4
  470. package/test/autotest/scriptlet-line-trailing-line-comment/expected.html +0 -5
  471. package/test/autotest/scriptlet-line-trailing-line-comment/input.htmljs +0 -5
  472. package/test/autotest/scriptlet-tag/expected.html +0 -11
  473. package/test/autotest/scriptlet-tag/input.htmljs +0 -6
  474. package/test/autotest/scriptlet-tag-html/expected.html +0 -7
  475. package/test/autotest/scriptlet-tag-html/input.htmljs +0 -8
  476. package/test/autotest/self-closed-tag/expected.html +0 -2
  477. package/test/autotest/self-closed-tag/input.htmljs +0 -1
  478. package/test/autotest/self-closed-tag-attrs/expected.html +0 -2
  479. package/test/autotest/self-closed-tag-attrs/input.htmljs +0 -1
  480. package/test/autotest/self-closing-open-tag-only/expected.html +0 -3
  481. package/test/autotest/self-closing-open-tag-only/input.htmljs +0 -1
  482. package/test/autotest/semicolon-concise/expected.html +0 -4
  483. package/test/autotest/semicolon-concise/input.htmljs +0 -2
  484. package/test/autotest/shorthand-class-dynamic/expected.html +0 -2
  485. package/test/autotest/shorthand-class-dynamic/input.htmljs +0 -1
  486. package/test/autotest/shorthand-class-dynamic-literal-prefix/expected.html +0 -2
  487. package/test/autotest/shorthand-class-dynamic-literal-prefix/input.htmljs +0 -1
  488. package/test/autotest/shorthand-class-dynamic-literal-suffix/expected.html +0 -2
  489. package/test/autotest/shorthand-class-dynamic-literal-suffix/input.htmljs +0 -1
  490. package/test/autotest/shorthand-class-self-closed/expected.html +0 -6
  491. package/test/autotest/shorthand-class-self-closed/input.htmljs +0 -3
  492. package/test/autotest/shorthand-closing-html/expected.html +0 -9
  493. package/test/autotest/shorthand-closing-html/input.htmljs +0 -5
  494. package/test/autotest/shorthand-closing-html2/expected.html +0 -3
  495. package/test/autotest/shorthand-closing-html2/input.htmljs +0 -2
  496. package/test/autotest/shorthand-closing-html3/expected.html +0 -3
  497. package/test/autotest/shorthand-closing-html3/input.htmljs +0 -2
  498. package/test/autotest/shorthand-div-id/expected.html +0 -2
  499. package/test/autotest/shorthand-div-id/input.htmljs +0 -1
  500. package/test/autotest/shorthand-div-id-class/expected.html +0 -2
  501. package/test/autotest/shorthand-div-id-class/input.htmljs +0 -1
  502. package/test/autotest/shorthand-div-id-class-multiple/expected.html +0 -2
  503. package/test/autotest/shorthand-div-id-class-multiple/input.htmljs +0 -1
  504. package/test/autotest/shorthand-id/expected.html +0 -2
  505. package/test/autotest/shorthand-id/input.htmljs +0 -1
  506. package/test/autotest/shorthand-id-class/expected.html +0 -2
  507. package/test/autotest/shorthand-id-class/input.htmljs +0 -1
  508. package/test/autotest/shorthand-id-class-html/expected.html +0 -3
  509. package/test/autotest/shorthand-id-class-html/input.htmljs +0 -2
  510. package/test/autotest/shorthand-id-dup/expected.html +0 -1
  511. package/test/autotest/shorthand-id-dup/input.htmljs +0 -1
  512. package/test/autotest/shorthand-id-dynamic/expected.html +0 -2
  513. package/test/autotest/shorthand-id-dynamic/input.htmljs +0 -1
  514. package/test/autotest/shorthand-id-dynamic-literal-prefix/expected.html +0 -2
  515. package/test/autotest/shorthand-id-dynamic-literal-prefix/input.htmljs +0 -1
  516. package/test/autotest/shorthand-id-dynamic-literal-suffix/expected.html +0 -2
  517. package/test/autotest/shorthand-id-dynamic-literal-suffix/input.htmljs +0 -1
  518. package/test/autotest/shorthand-id-self-closed/expected.html +0 -6
  519. package/test/autotest/shorthand-id-self-closed/input.htmljs +0 -3
  520. package/test/autotest/shorthand-mixed/expected.html +0 -15
  521. package/test/autotest/shorthand-mixed/input.htmljs +0 -5
  522. package/test/autotest/shorthand-mixed-concise/expected.html +0 -11
  523. package/test/autotest/shorthand-mixed-concise/input.htmljs +0 -5
  524. package/test/autotest/simple-text-delimited/expected.html +0 -1
  525. package/test/autotest/simple-text-delimited/input.htmljs +0 -3
  526. package/test/autotest/single-line-text-block/expected.html +0 -2
  527. package/test/autotest/single-line-text-block/input.htmljs +0 -2
  528. package/test/autotest/single-line-text-block-nested/expected.html +0 -4
  529. package/test/autotest/single-line-text-block-nested/input.htmljs +0 -3
  530. package/test/autotest/single-line-text-block-sibling/expected.html +0 -6
  531. package/test/autotest/single-line-text-block-sibling/input.htmljs +0 -5
  532. package/test/autotest/stray-forward-slash-within-open-tag/expected.html +0 -3
  533. package/test/autotest/stray-forward-slash-within-open-tag/input.htmljs +0 -1
  534. package/test/autotest/stray-special-chars/expected.html +0 -3
  535. package/test/autotest/stray-special-chars/input.htmljs +0 -1
  536. package/test/autotest/strip-bom/expected.html +0 -3
  537. package/test/autotest/strip-bom/input-good.htmljs +0 -1
  538. package/test/autotest/strip-bom/input.htmljs +0 -1
  539. package/test/autotest/strip-bom/input.htmljs.txt +0 -60
  540. package/test/autotest/tag-name-expression-literal-prefix/expected.html +0 -3
  541. package/test/autotest/tag-name-expression-literal-prefix/input.htmljs +0 -2
  542. package/test/autotest/tag-name-expression-literal-prefix-attrs/expected.html +0 -3
  543. package/test/autotest/tag-name-expression-literal-prefix-attrs/input.htmljs +0 -2
  544. package/test/autotest/tag-name-expression-literal-prefix-suffix/expected.html +0 -3
  545. package/test/autotest/tag-name-expression-literal-prefix-suffix/input.htmljs +0 -2
  546. package/test/autotest/tag-name-expression-literal-suffix/expected.html +0 -3
  547. package/test/autotest/tag-name-expression-literal-suffix/input.htmljs +0 -2
  548. package/test/autotest/tag-name-expression-shorthand-id/expected.html +0 -2
  549. package/test/autotest/tag-name-expression-shorthand-id/input.htmljs +0 -1
  550. package/test/autotest/tag-name-expression-simple/expected.html +0 -3
  551. package/test/autotest/tag-name-expression-simple/input.htmljs +0 -2
  552. package/test/autotest/tag-name-expression-simple-empty-close/expected.html +0 -3
  553. package/test/autotest/tag-name-expression-simple-empty-close/input.htmljs +0 -2
  554. package/test/autotest/tag-var-declaration/expected.html +0 -38
  555. package/test/autotest/tag-var-declaration/input.htmljs +0 -19
  556. package/test/autotest/tag-var-with-params/expected.html +0 -5
  557. package/test/autotest/tag-var-with-params/input.htmljs +0 -3
  558. package/test/autotest/text-after-semicolon/expected.html +0 -15
  559. package/test/autotest/text-after-semicolon/input.htmljs +0 -8
  560. package/test/autotest/text-after-tag/expected.html +0 -3
  561. package/test/autotest/text-after-tag/input.htmljs +0 -1
  562. package/test/autotest/text-parse-mode-concise/expected.html +0 -5
  563. package/test/autotest/text-parse-mode-concise/input.htmljs +0 -3
  564. package/test/autotest/text-parse-mode-concise/test.js +0 -1
  565. package/test/autotest/text-parse-mode-delimited-block/expected.html +0 -8
  566. package/test/autotest/text-parse-mode-delimited-block/input.htmljs +0 -6
  567. package/test/autotest/text-parse-mode-delimited-block/test.js +0 -1
  568. package/test/autotest/text-parse-mode-html/expected.html +0 -7
  569. package/test/autotest/text-parse-mode-html/input.htmljs +0 -3
  570. package/test/autotest/text-parse-mode-html/test.js +0 -1
  571. package/test/autotest/text-parse-mode-parsed-text/expected.html +0 -11
  572. package/test/autotest/text-parse-mode-parsed-text/input.htmljs +0 -7
  573. package/test/autotest/text-parse-mode-parsed-text/test.js +0 -7
  574. package/test/autotest/text-parse-mode-static-text/expected.html +0 -11
  575. package/test/autotest/text-parse-mode-static-text/input.htmljs +0 -7
  576. package/test/autotest/text-parse-mode-static-text/test.js +0 -7
  577. package/test/autotest/textarea/expected.html +0 -5
  578. package/test/autotest/textarea/input.htmljs +0 -2
  579. package/test/autotest/textarea/test.js +0 -0
  580. package/test/autotest/var/expected.html +0 -9
  581. package/test/autotest/var/input.htmljs +0 -5
  582. package/test/autotest/var-new-Date/expected.html +0 -2
  583. package/test/autotest/var-new-Date/input.htmljs +0 -1
  584. package/test/autotest/whitespace-around-equals/expected.html +0 -2
  585. package/test/autotest/whitespace-around-equals/input.htmljs +0 -1
  586. package/test/autotest/whitespace-empty-lines/expected.html +0 -7
  587. package/test/autotest/whitespace-empty-lines/input.htmljs +0 -4
  588. package/test/autotest/whitespace-empty-lines-indent/expected.html +0 -8
  589. package/test/autotest/whitespace-empty-lines-indent/input.htmljs +0 -4
  590. package/test/autotest/whitespace-newline/expected.html +0 -7
  591. package/test/autotest/whitespace-newline/input.htmljs +0 -6
  592. package/test/autotest/whitespace-newline-indent/expected.html +0 -7
  593. package/test/autotest/whitespace-newline-indent/input.htmljs +0 -6
  594. package/test/autotest/whitespace-only-reset-indent/expected.html +0 -6
  595. package/test/autotest/whitespace-only-reset-indent/input.htmljs +0 -3
  596. package/test/autotest/windows-line-ending/expected.html +0 -10
  597. package/test/autotest/windows-line-ending/test.js +0 -11
  598. package/test/autotest/xml-declaration/expected.html +0 -5
  599. package/test/autotest/xml-declaration/input.htmljs +0 -2
  600. package/test/autotest/xml-declaration-ill-formed/expected.html +0 -5
  601. package/test/autotest/xml-declaration-ill-formed/input.htmljs +0 -2
  602. package/test/autotest-1.x/argument-attr/expected.html +0 -2
  603. package/test/autotest-1.x/argument-attr/input.htmljs +0 -1
  604. package/test/autotest-1.x/argument-attr-extra-whitespace/expected.html +0 -4
  605. package/test/autotest-1.x/argument-attr-extra-whitespace/input.htmljs +0 -2
  606. package/test/autotest-1.x/argument-attr-multiple/expected.html +0 -1
  607. package/test/autotest-1.x/argument-attr-multiple/input.htmljs +0 -1
  608. package/test/autotest-1.x/argument-tag/expected.html +0 -2
  609. package/test/autotest-1.x/argument-tag/input.htmljs +0 -1
  610. package/test/autotest-1.x/argument-tag-attr/expected.html +0 -2
  611. package/test/autotest-1.x/argument-tag-attr/input.htmljs +0 -1
  612. package/test/autotest-1.x/argument-tag-complex/expected.html +0 -2
  613. package/test/autotest-1.x/argument-tag-complex/input.htmljs +0 -1
  614. package/test/autotest-1.x/argument-tag-extra-whitespace/expected.html +0 -2
  615. package/test/autotest-1.x/argument-tag-extra-whitespace/input.htmljs +0 -1
  616. package/test/autotest-1.x/argument-tag-multiple/expected.html +0 -1
  617. package/test/autotest-1.x/argument-tag-multiple/input.htmljs +0 -1
  618. package/test/autotest-1.x/argument-tag-nested-parens/expected.html +0 -3
  619. package/test/autotest-1.x/argument-tag-nested-parens/input.htmljs +0 -4
  620. package/test/autotest-1.x/attr-complex/expected.html +0 -1
  621. package/test/autotest-1.x/attr-complex/input.htmljs +0 -1
  622. package/test/autotest-1.x/attr-escape-characters/expected.html +0 -3
  623. package/test/autotest-1.x/attr-escape-characters/input.htmljs +0 -3
  624. package/test/autotest-1.x/attr-escaped-dollar/expected.html +0 -1
  625. package/test/autotest-1.x/attr-escaped-dollar/input.htmljs +0 -1
  626. package/test/autotest-1.x/attr-escaped-dollar/test.js +0 -5
  627. package/test/autotest-1.x/attr-grouped/expected.html +0 -3
  628. package/test/autotest-1.x/attr-grouped/input.htmljs +0 -5
  629. package/test/autotest-1.x/attr-grouped-2/expected.html +0 -3
  630. package/test/autotest-1.x/attr-grouped-2/input.htmljs +0 -5
  631. package/test/autotest-1.x/attr-grouped-3/expected.html +0 -3
  632. package/test/autotest-1.x/attr-grouped-3/input.htmljs +0 -5
  633. package/test/autotest-1.x/attr-grouped-4/expected.html +0 -3
  634. package/test/autotest-1.x/attr-grouped-4/input.htmljs +0 -5
  635. package/test/autotest-1.x/attr-grouped-invalid/expected.html +0 -1
  636. package/test/autotest-1.x/attr-grouped-invalid/input.htmljs +0 -5
  637. package/test/autotest-1.x/attr-grouped-invalid-eof/expected.html +0 -1
  638. package/test/autotest-1.x/attr-grouped-invalid-eof/input.htmljs +0 -4
  639. package/test/autotest-1.x/attr-grouped-multiple/expected.html +0 -3
  640. package/test/autotest-1.x/attr-grouped-multiple/input.htmljs +0 -4
  641. package/test/autotest-1.x/attr-int-and-id/expected.html +0 -2
  642. package/test/autotest-1.x/attr-int-and-id/input.htmljs +0 -1
  643. package/test/autotest-1.x/attr-literal-false/expected.html +0 -2
  644. package/test/autotest-1.x/attr-literal-false/input.htmljs +0 -1
  645. package/test/autotest-1.x/attr-literal-false/test.js +0 -1
  646. package/test/autotest-1.x/attr-literal-null/expected.html +0 -2
  647. package/test/autotest-1.x/attr-literal-null/input.htmljs +0 -1
  648. package/test/autotest-1.x/attr-literal-null/test.js +0 -1
  649. package/test/autotest-1.x/attr-literal-numbers/expected.html +0 -2
  650. package/test/autotest-1.x/attr-literal-numbers/input.htmljs +0 -1
  651. package/test/autotest-1.x/attr-literal-numbers/test.js +0 -1
  652. package/test/autotest-1.x/attr-literal-string-double-quotes/expected.html +0 -2
  653. package/test/autotest-1.x/attr-literal-string-double-quotes/input.htmljs +0 -1
  654. package/test/autotest-1.x/attr-literal-string-double-quotes/test.js +0 -1
  655. package/test/autotest-1.x/attr-literal-string-single-quotes/expected.html +0 -2
  656. package/test/autotest-1.x/attr-literal-string-single-quotes/input.htmljs +0 -1
  657. package/test/autotest-1.x/attr-literal-string-single-quotes/test.js +0 -1
  658. package/test/autotest-1.x/attr-literal-true/expected.html +0 -2
  659. package/test/autotest-1.x/attr-literal-true/input.htmljs +0 -1
  660. package/test/autotest-1.x/attr-literal-true/test.js +0 -1
  661. package/test/autotest-1.x/attr-literal-undefined/expected.html +0 -2
  662. package/test/autotest-1.x/attr-literal-undefined/input.htmljs +0 -1
  663. package/test/autotest-1.x/attr-literal-undefined/test.js +0 -1
  664. package/test/autotest-1.x/attr-multi-line-comment/expected.html +0 -3
  665. package/test/autotest-1.x/attr-multi-line-comment/input.htmljs +0 -1
  666. package/test/autotest-1.x/attr-multi-line-string/expected.html +0 -2
  667. package/test/autotest-1.x/attr-multi-line-string/input.htmljs +0 -3
  668. package/test/autotest-1.x/attr-name-with-html-chars/expected.html +0 -1
  669. package/test/autotest-1.x/attr-name-with-html-chars/input.htmljs +0 -1
  670. package/test/autotest-1.x/attr-no-value/expected.html +0 -3
  671. package/test/autotest-1.x/attr-no-value/input.htmljs +0 -1
  672. package/test/autotest-1.x/attr-no-value-self-closed/expected.html +0 -2
  673. package/test/autotest-1.x/attr-no-value-self-closed/input.htmljs +0 -1
  674. package/test/autotest-1.x/attr-non-literal/expected.html +0 -5
  675. package/test/autotest-1.x/attr-non-literal/input.htmljs +0 -2
  676. package/test/autotest-1.x/attr-non-literal/test.js +0 -1
  677. package/test/autotest-1.x/attr-object-expressions/expected.html +0 -4
  678. package/test/autotest-1.x/attr-object-expressions/input.htmljs +0 -3
  679. package/test/autotest-1.x/attr-simple-expression/expected.html +0 -3
  680. package/test/autotest-1.x/attr-simple-expression/input.htmljs +0 -1
  681. package/test/autotest-1.x/attr-value-self-closed/expected.html +0 -2
  682. package/test/autotest-1.x/attr-value-self-closed/input.htmljs +0 -1
  683. package/test/autotest-1.x/attr-with-parens-and-double-quoted-strings/expected.html +0 -2
  684. package/test/autotest-1.x/attr-with-parens-and-double-quoted-strings/input.htmljs +0 -1
  685. package/test/autotest-1.x/attr-with-parens-and-single-quoted-strings/expected.html +0 -2
  686. package/test/autotest-1.x/attr-with-parens-and-single-quoted-strings/input.htmljs +0 -1
  687. package/test/autotest-1.x/attr-with-right-angle-bracket/expected.html +0 -3
  688. package/test/autotest-1.x/attr-with-right-angle-bracket/input.htmljs +0 -1
  689. package/test/autotest-1.x/attr-with-right-angle-bracket-parens/expected.html +0 -3
  690. package/test/autotest-1.x/attr-with-right-angle-bracket-parens/input.htmljs +0 -1
  691. package/test/autotest-1.x/attr-without-delimiters/expected.html +0 -2
  692. package/test/autotest-1.x/attr-without-delimiters/input.htmljs +0 -1
  693. package/test/autotest-1.x/backtick-string/expected.html +0 -3
  694. package/test/autotest-1.x/backtick-string/input.htmljs +0 -2
  695. package/test/autotest-1.x/backtick-string-eof/expected.html +0 -1
  696. package/test/autotest-1.x/backtick-string-eof/input.htmljs +0 -2
  697. package/test/autotest-1.x/bad-tag-indent/expected.html +0 -1
  698. package/test/autotest-1.x/bad-tag-indent/input.htmljs +0 -1
  699. package/test/autotest-1.x/cdata/expected.html +0 -3
  700. package/test/autotest-1.x/cdata/input.htmljs +0 -1
  701. package/test/autotest-1.x/cdata-2/expected.html +0 -5
  702. package/test/autotest-1.x/cdata-2/input.htmljs +0 -3
  703. package/test/autotest-1.x/cdata-pos/expected.html +0 -7
  704. package/test/autotest-1.x/cdata-pos/input.htmljs +0 -4
  705. package/test/autotest-1.x/cdata-pos/test.js +0 -1
  706. package/test/autotest-1.x/comment-concise-js-block/expected.html +0 -4
  707. package/test/autotest-1.x/comment-concise-js-block/input.htmljs +0 -6
  708. package/test/autotest-1.x/comment-concise-js-block-trailing/expected.html +0 -4
  709. package/test/autotest-1.x/comment-concise-js-block-trailing/input.htmljs +0 -6
  710. package/test/autotest-1.x/comment-concise-js-line/expected.html +0 -4
  711. package/test/autotest-1.x/comment-concise-js-line/input.htmljs +0 -3
  712. package/test/autotest-1.x/comments-within-open-tag/expected.html +0 -2
  713. package/test/autotest-1.x/comments-within-open-tag/input.htmljs +0 -1
  714. package/test/autotest-1.x/complex/expected.html +0 -24
  715. package/test/autotest-1.x/complex/input.htmljs +0 -22
  716. package/test/autotest-1.x/complex-attr-name/expected.html +0 -2
  717. package/test/autotest-1.x/complex-attr-name/input.htmljs +0 -1
  718. package/test/autotest-1.x/concise-complex-tag-name/expected.html +0 -2
  719. package/test/autotest-1.x/concise-complex-tag-name/input.htmljs +0 -1
  720. package/test/autotest-1.x/concise-contentplaceholder-html-start/expected.html +0 -5
  721. package/test/autotest-1.x/concise-contentplaceholder-html-start/input.htmljs +0 -1
  722. package/test/autotest-1.x/concise-contentplaceholder-start/expected.html +0 -1
  723. package/test/autotest-1.x/concise-contentplaceholder-start/input.htmljs +0 -1
  724. package/test/autotest-1.x/declaration/expected.html +0 -1
  725. package/test/autotest-1.x/declaration/input.htmljs +0 -1
  726. package/test/autotest-1.x/double-hyphen-block/expected.html +0 -12
  727. package/test/autotest-1.x/double-hyphen-block/input.htmljs +0 -8
  728. package/test/autotest-1.x/double-hyphen-line/expected.html +0 -12
  729. package/test/autotest-1.x/double-hyphen-line/input.htmljs +0 -5
  730. package/test/autotest-1.x/double-hyphen-line-start/expected.html +0 -12
  731. package/test/autotest-1.x/double-hyphen-line-start/input.htmljs +0 -6
  732. package/test/autotest-1.x/dtd/expected.html +0 -1
  733. package/test/autotest-1.x/dtd/input.htmljs +0 -1
  734. package/test/autotest-1.x/empty-closing-tag/expected.html +0 -8
  735. package/test/autotest-1.x/empty-closing-tag/input.htmljs +0 -6
  736. package/test/autotest-1.x/empty-closing-tag2/expected.html +0 -9
  737. package/test/autotest-1.x/empty-closing-tag2/input.htmljs +0 -5
  738. package/test/autotest-1.x/eof-attr-argument/expected.html +0 -1
  739. package/test/autotest-1.x/eof-attr-argument/input.htmljs +0 -1
  740. package/test/autotest-1.x/eof-attr-name/expected.html +0 -3
  741. package/test/autotest-1.x/eof-attr-name/input.htmljs +0 -1
  742. package/test/autotest-1.x/eof-attr-value/expected.html +0 -3
  743. package/test/autotest-1.x/eof-attr-value/input.htmljs +0 -1
  744. package/test/autotest-1.x/eof-attr-value-js-comment-comment/expected.html +0 -3
  745. package/test/autotest-1.x/eof-attr-value-js-comment-comment/input.htmljs +0 -1
  746. package/test/autotest-1.x/eof-attr-value-js-comment-comment-concise/expected.html +0 -1
  747. package/test/autotest-1.x/eof-attr-value-js-comment-comment-concise/input.htmljs +0 -1
  748. package/test/autotest-1.x/eof-attr-value-string/expected.html +0 -1
  749. package/test/autotest-1.x/eof-attr-value-string/input.htmljs +0 -1
  750. package/test/autotest-1.x/eof-doctype/expected.html +0 -1
  751. package/test/autotest-1.x/eof-doctype/input.htmljs +0 -1
  752. package/test/autotest-1.x/eof-placeholder-body-escaped/expected.html +0 -4
  753. package/test/autotest-1.x/eof-placeholder-body-escaped/input.htmljs +0 -1
  754. package/test/autotest-1.x/eof-placeholder-body-non-escaped/expected.html +0 -4
  755. package/test/autotest-1.x/eof-placeholder-body-non-escaped/input.htmljs +0 -4
  756. package/test/autotest-1.x/eof-placeholder-concise/expected.html +0 -3
  757. package/test/autotest-1.x/eof-placeholder-concise/input.htmljs +0 -2
  758. package/test/autotest-1.x/eof-placeholder-script-body-escaped/expected.html +0 -4
  759. package/test/autotest-1.x/eof-placeholder-script-body-escaped/input.htmljs +0 -1
  760. package/test/autotest-1.x/eof-placeholder-script-body-non-escaped/expected.html +0 -4
  761. package/test/autotest-1.x/eof-placeholder-script-body-non-escaped/input.htmljs +0 -1
  762. package/test/autotest-1.x/eof-placeholder-string/expected.html +0 -4
  763. package/test/autotest-1.x/eof-placeholder-string/input.htmljs +0 -1
  764. package/test/autotest-1.x/eof-script-body/expected.html +0 -4
  765. package/test/autotest-1.x/eof-script-body/input.htmljs +0 -2
  766. package/test/autotest-1.x/eof-style/expected.html +0 -4
  767. package/test/autotest-1.x/eof-style/input.htmljs +0 -1
  768. package/test/autotest-1.x/eof-tag-start/expected.html +0 -3
  769. package/test/autotest-1.x/eof-tag-start/input.htmljs +0 -1
  770. package/test/autotest-1.x/eof-xml-declaration/expected.html +0 -1
  771. package/test/autotest-1.x/eof-xml-declaration/input.htmljs +0 -1
  772. package/test/autotest-1.x/html-block-after-tag/expected.html +0 -6
  773. package/test/autotest-1.x/html-block-after-tag/input.htmljs +0 -1
  774. package/test/autotest-1.x/html-comments/expected.html +0 -3
  775. package/test/autotest-1.x/html-comments/input.htmljs +0 -1
  776. package/test/autotest-1.x/html-comments-ignore-placeholders/expected.html +0 -1
  777. package/test/autotest-1.x/html-comments-ignore-placeholders/input.htmljs +0 -1
  778. package/test/autotest-1.x/ignorePlaceholders-attr-double-escaped-dollar-placeholder/expected.html +0 -2
  779. package/test/autotest-1.x/ignorePlaceholders-attr-double-escaped-dollar-placeholder/input.htmljs +0 -1
  780. package/test/autotest-1.x/ignorePlaceholders-attr-double-escaped-dollar-placeholder/test.js +0 -1
  781. package/test/autotest-1.x/ignorePlaceholders-attr-escaped-dollar-placeholder/expected.html +0 -2
  782. package/test/autotest-1.x/ignorePlaceholders-attr-escaped-dollar-placeholder/input.htmljs +0 -1
  783. package/test/autotest-1.x/ignorePlaceholders-attr-escaped-dollar-placeholder/test.js +0 -1
  784. package/test/autotest-1.x/ignorePlaceholders-attr-placeholder/expected.html +0 -2
  785. package/test/autotest-1.x/ignorePlaceholders-attr-placeholder/input.htmljs +0 -1
  786. package/test/autotest-1.x/ignorePlaceholders-attr-placeholder/test.js +0 -1
  787. package/test/autotest-1.x/invalid-closing-tag/expected.html +0 -4
  788. package/test/autotest-1.x/invalid-closing-tag/input.htmljs +0 -1
  789. package/test/autotest-1.x/mixed/expected.html +0 -21
  790. package/test/autotest-1.x/mixed/input.htmljs +0 -8
  791. package/test/autotest-1.x/mixed-bad-indentation/expected.html +0 -7
  792. package/test/autotest-1.x/mixed-bad-indentation/input.htmljs +0 -3
  793. package/test/autotest-1.x/mixed-cdata/expected.html +0 -7
  794. package/test/autotest-1.x/mixed-cdata/input.htmljs +0 -3
  795. package/test/autotest-1.x/mixed-comment/expected.html +0 -7
  796. package/test/autotest-1.x/mixed-comment/input.htmljs +0 -6
  797. package/test/autotest-1.x/mixed-invalid/expected.html +0 -16
  798. package/test/autotest-1.x/mixed-invalid/input.htmljs +0 -9
  799. package/test/autotest-1.x/mixed-open-tag-only/expected.html +0 -14
  800. package/test/autotest-1.x/mixed-open-tag-only/input.htmljs +0 -6
  801. package/test/autotest-1.x/multiline-html-block/expected.html +0 -5
  802. package/test/autotest-1.x/multiline-html-block/input.htmljs +0 -4
  803. package/test/autotest-1.x/multiline-html-block-empty/expected.html +0 -0
  804. package/test/autotest-1.x/multiline-html-block-empty/input.htmljs +0 -2
  805. package/test/autotest-1.x/multiline-html-block-missing-end/expected.html +0 -1
  806. package/test/autotest-1.x/multiline-html-block-missing-end/input.htmljs +0 -3
  807. package/test/autotest-1.x/multiline-html-block-nested/expected.html +0 -7
  808. package/test/autotest-1.x/multiline-html-block-nested/input.htmljs +0 -5
  809. package/test/autotest-1.x/multiline-html-block-nested-empty/expected.html +0 -2
  810. package/test/autotest-1.x/multiline-html-block-nested-empty/input.htmljs +0 -3
  811. package/test/autotest-1.x/multiline-text-block/expected.html +0 -1
  812. package/test/autotest-1.x/multiline-text-block/input.htmljs +0 -4
  813. package/test/autotest-1.x/multiline-text-block-bad/expected.html +0 -1
  814. package/test/autotest-1.x/multiline-text-block-bad/input.htmljs +0 -5
  815. package/test/autotest-1.x/multiline-text-block-with-hyphens/expected.html +0 -1
  816. package/test/autotest-1.x/multiline-text-block-with-hyphens/input.htmljs +0 -4
  817. package/test/autotest-1.x/nested-pyramid/expected.html +0 -12
  818. package/test/autotest-1.x/nested-pyramid/input.htmljs +0 -6
  819. package/test/autotest-1.x/nested-siblings/expected.html +0 -6
  820. package/test/autotest-1.x/nested-siblings/input.htmljs +0 -3
  821. package/test/autotest-1.x/nested-tags/expected.html +0 -4
  822. package/test/autotest-1.x/nested-tags/input.htmljs +0 -2
  823. package/test/autotest-1.x/nested-text/expected.html +0 -8
  824. package/test/autotest-1.x/nested-text/input.htmljs +0 -8
  825. package/test/autotest-1.x/new-attr-prefix/expected.html +0 -3
  826. package/test/autotest-1.x/new-attr-prefix/input.htmljs +0 -1
  827. package/test/autotest-1.x/open-tag-only/expected.html +0 -12
  828. package/test/autotest-1.x/open-tag-only/input.htmljs +0 -1
  829. package/test/autotest-1.x/open-tag-only-custom/expected.html +0 -10
  830. package/test/autotest-1.x/open-tag-only-custom/input.htmljs +0 -4
  831. package/test/autotest-1.x/open-tag-only-custom/test.js +0 -9
  832. package/test/autotest-1.x/open-tag-only-with-body/expected.html +0 -4
  833. package/test/autotest-1.x/open-tag-only-with-body/input.htmljs +0 -5
  834. package/test/autotest-1.x/open-tag-only-with-body-concise/expected.html +0 -3
  835. package/test/autotest-1.x/open-tag-only-with-body-concise/input.htmljs +0 -2
  836. package/test/autotest-1.x/open-tag-parser-state/expected.html +0 -21
  837. package/test/autotest-1.x/open-tag-parser-state/input.htmljs +0 -11
  838. package/test/autotest-1.x/open-tag-parser-state/test.js +0 -21
  839. package/test/autotest-1.x/open-tag-parser-state-concise/expected.html +0 -19
  840. package/test/autotest-1.x/open-tag-parser-state-concise/input.htmljs +0 -17
  841. package/test/autotest-1.x/open-tag-parser-state-concise/test.js +0 -17
  842. package/test/autotest-1.x/parsed-text-style-tag/expected.html +0 -3
  843. package/test/autotest-1.x/parsed-text-style-tag/input.htmljs +0 -1
  844. package/test/autotest-1.x/parsed-text-style-tag-class/expected.html +0 -12
  845. package/test/autotest-1.x/parsed-text-style-tag-class/input.htmljs +0 -3
  846. package/test/autotest-1.x/placeholder-attr-invalid/expected.html +0 -1
  847. package/test/autotest-1.x/placeholder-attr-invalid/input.htmljs +0 -1
  848. package/test/autotest-1.x/placeholder-attr-string-value/expected.html +0 -3
  849. package/test/autotest-1.x/placeholder-attr-string-value/input.htmljs +0 -1
  850. package/test/autotest-1.x/placeholder-attr-string-value-mixed-quotes/expected.html +0 -3
  851. package/test/autotest-1.x/placeholder-attr-string-value-mixed-quotes/input.htmljs +0 -1
  852. package/test/autotest-1.x/placeholder-attr-string-value-parens/expected.html +0 -3
  853. package/test/autotest-1.x/placeholder-attr-string-value-parens/input.htmljs +0 -1
  854. package/test/autotest-1.x/placeholder-attr-within-placeholder/expected.html +0 -2
  855. package/test/autotest-1.x/placeholder-attr-within-placeholder/input.htmljs +0 -1
  856. package/test/autotest-1.x/placeholder-attr-within-string-complex/expected.html +0 -2
  857. package/test/autotest-1.x/placeholder-attr-within-string-complex/input.htmljs +0 -1
  858. package/test/autotest-1.x/placeholder-attr-within-string-simple/expected.html +0 -2
  859. package/test/autotest-1.x/placeholder-attr-within-string-simple/input.htmljs +0 -1
  860. package/test/autotest-1.x/placeholder-attr-wrapped/expected.html +0 -2
  861. package/test/autotest-1.x/placeholder-attr-wrapped/input.htmljs +0 -1
  862. package/test/autotest-1.x/placeholder-backslash/expected.html +0 -23
  863. package/test/autotest-1.x/placeholder-backslash/input.htmljs +0 -15
  864. package/test/autotest-1.x/placeholder-body-multi-line-js-comment/expected.html +0 -3
  865. package/test/autotest-1.x/placeholder-body-multi-line-js-comment/input.htmljs +0 -1
  866. package/test/autotest-1.x/placeholder-body-single-line-js-comment/expected.html +0 -3
  867. package/test/autotest-1.x/placeholder-body-single-line-js-comment/input.htmljs +0 -2
  868. package/test/autotest-1.x/placeholder-body-text/expected.html +0 -5
  869. package/test/autotest-1.x/placeholder-body-text/input.htmljs +0 -1
  870. package/test/autotest-1.x/placeholder-escape/expected.html +0 -5
  871. package/test/autotest-1.x/placeholder-escape/input.htmljs +0 -3
  872. package/test/autotest-1.x/placeholder-no-escape/expected.html +0 -5
  873. package/test/autotest-1.x/placeholder-no-escape/input.htmljs +0 -3
  874. package/test/autotest-1.x/placeholder-unnamed-attr/expected.html +0 -2
  875. package/test/autotest-1.x/placeholder-unnamed-attr/input.htmljs +0 -1
  876. package/test/autotest-1.x/placeholder-unnamed-attr-escaped/expected.html +0 -2
  877. package/test/autotest-1.x/placeholder-unnamed-attr-escaped/input.htmljs +0 -1
  878. package/test/autotest-1.x/placeholder-unnamed-attr-escaped-escaped/expected.html +0 -2
  879. package/test/autotest-1.x/placeholder-unnamed-attr-escaped-escaped/input.htmljs +0 -1
  880. package/test/autotest-1.x/placeholder-unnamed-attr-last/expected.html +0 -2
  881. package/test/autotest-1.x/placeholder-unnamed-attr-last/input.htmljs +0 -1
  882. package/test/autotest-1.x/placeholder-unnamed-attr-last-concise/expected.html +0 -4
  883. package/test/autotest-1.x/placeholder-unnamed-attr-last-concise/input.htmljs +0 -2
  884. package/test/autotest-1.x/placeholder-unnamed-attr-last-self-closed/expected.html +0 -2
  885. package/test/autotest-1.x/placeholder-unnamed-attr-last-self-closed/input.htmljs +0 -1
  886. package/test/autotest-1.x/placeholder-unnamed-attr-trailing-text/expected.html +0 -1
  887. package/test/autotest-1.x/placeholder-unnamed-attr-trailing-text/input.htmljs +0 -1
  888. package/test/autotest-1.x/placeholder-within-placeholder/expected.html +0 -1
  889. package/test/autotest-1.x/placeholder-within-placeholder/input.htmljs +0 -1
  890. package/test/autotest-1.x/placeholder-within-placeholder-escaping/expected.html +0 -1
  891. package/test/autotest-1.x/placeholder-within-placeholder-escaping/input.htmljs +0 -1
  892. package/test/autotest-1.x/placeholder-within-script-tag/expected.html +0 -5
  893. package/test/autotest-1.x/placeholder-within-script-tag/input.htmljs +0 -1
  894. package/test/autotest-1.x/placeholder-within-script-within-string/expected.html +0 -5
  895. package/test/autotest-1.x/placeholder-within-script-within-string/input.htmljs +0 -1
  896. package/test/autotest-1.x/placeholder-within-string-newlines/expected.html +0 -4
  897. package/test/autotest-1.x/placeholder-within-string-newlines/input.htmljs +0 -3
  898. package/test/autotest-1.x/root-el/expected.html +0 -2
  899. package/test/autotest-1.x/root-el/input.htmljs +0 -1
  900. package/test/autotest-1.x/root-els/expected.html +0 -4
  901. package/test/autotest-1.x/root-els/input.htmljs +0 -2
  902. package/test/autotest-1.x/script/expected.html +0 -3
  903. package/test/autotest-1.x/script/input.htmljs +0 -2
  904. package/test/autotest-1.x/script-concise/expected.html +0 -6
  905. package/test/autotest-1.x/script-concise/input.htmljs +0 -7
  906. package/test/autotest-1.x/script-concise-invalid-nested-tag/expected.html +0 -3
  907. package/test/autotest-1.x/script-concise-invalid-nested-tag/input.htmljs +0 -3
  908. package/test/autotest-1.x/script-empty-concise/expected.html +0 -6
  909. package/test/autotest-1.x/script-empty-concise/input.htmljs +0 -3
  910. package/test/autotest-1.x/script-self-closed/expected.html +0 -9
  911. package/test/autotest-1.x/script-self-closed/input.htmljs +0 -4
  912. package/test/autotest-1.x/script-single-line-comment/expected.html +0 -3
  913. package/test/autotest-1.x/script-single-line-comment/input.htmljs +0 -1
  914. package/test/autotest-1.x/scriptlet/expected.html +0 -11
  915. package/test/autotest-1.x/scriptlet/input.htmljs +0 -6
  916. package/test/autotest-1.x/scriptlet-html-block/expected.html +0 -7
  917. package/test/autotest-1.x/scriptlet-html-block/input.htmljs +0 -8
  918. package/test/autotest-1.x/self-closed-tag/expected.html +0 -2
  919. package/test/autotest-1.x/self-closed-tag/input.htmljs +0 -1
  920. package/test/autotest-1.x/self-closed-tag-attrs/expected.html +0 -2
  921. package/test/autotest-1.x/self-closed-tag-attrs/input.htmljs +0 -1
  922. package/test/autotest-1.x/self-closing-open-tag-only/expected.html +0 -3
  923. package/test/autotest-1.x/self-closing-open-tag-only/input.htmljs +0 -1
  924. package/test/autotest-1.x/shorthand-class-dynamic/expected.html +0 -2
  925. package/test/autotest-1.x/shorthand-class-dynamic/input.htmljs +0 -1
  926. package/test/autotest-1.x/shorthand-class-dynamic-literal-prefix/expected.html +0 -2
  927. package/test/autotest-1.x/shorthand-class-dynamic-literal-prefix/input.htmljs +0 -1
  928. package/test/autotest-1.x/shorthand-class-dynamic-literal-suffix/expected.html +0 -2
  929. package/test/autotest-1.x/shorthand-class-dynamic-literal-suffix/input.htmljs +0 -1
  930. package/test/autotest-1.x/shorthand-class-self-closed/expected.html +0 -6
  931. package/test/autotest-1.x/shorthand-class-self-closed/input.htmljs +0 -3
  932. package/test/autotest-1.x/shorthand-closing-html/expected.html +0 -9
  933. package/test/autotest-1.x/shorthand-closing-html/input.htmljs +0 -5
  934. package/test/autotest-1.x/shorthand-closing-html2/expected.html +0 -3
  935. package/test/autotest-1.x/shorthand-closing-html2/input.htmljs +0 -2
  936. package/test/autotest-1.x/shorthand-closing-html3/expected.html +0 -3
  937. package/test/autotest-1.x/shorthand-closing-html3/input.htmljs +0 -2
  938. package/test/autotest-1.x/shorthand-div-id/expected.html +0 -2
  939. package/test/autotest-1.x/shorthand-div-id/input.htmljs +0 -1
  940. package/test/autotest-1.x/shorthand-div-id-class/expected.html +0 -2
  941. package/test/autotest-1.x/shorthand-div-id-class/input.htmljs +0 -1
  942. package/test/autotest-1.x/shorthand-div-id-class-multiple/expected.html +0 -2
  943. package/test/autotest-1.x/shorthand-div-id-class-multiple/input.htmljs +0 -1
  944. package/test/autotest-1.x/shorthand-id/expected.html +0 -2
  945. package/test/autotest-1.x/shorthand-id/input.htmljs +0 -1
  946. package/test/autotest-1.x/shorthand-id-class/expected.html +0 -2
  947. package/test/autotest-1.x/shorthand-id-class/input.htmljs +0 -1
  948. package/test/autotest-1.x/shorthand-id-class-html/expected.html +0 -3
  949. package/test/autotest-1.x/shorthand-id-class-html/input.htmljs +0 -2
  950. package/test/autotest-1.x/shorthand-id-dup/expected.html +0 -1
  951. package/test/autotest-1.x/shorthand-id-dup/input.htmljs +0 -1
  952. package/test/autotest-1.x/shorthand-id-dynamic/expected.html +0 -2
  953. package/test/autotest-1.x/shorthand-id-dynamic/input.htmljs +0 -1
  954. package/test/autotest-1.x/shorthand-id-dynamic-literal-prefix/expected.html +0 -2
  955. package/test/autotest-1.x/shorthand-id-dynamic-literal-prefix/input.htmljs +0 -1
  956. package/test/autotest-1.x/shorthand-id-dynamic-literal-suffix/expected.html +0 -2
  957. package/test/autotest-1.x/shorthand-id-dynamic-literal-suffix/input.htmljs +0 -1
  958. package/test/autotest-1.x/shorthand-id-self-closed/expected.html +0 -6
  959. package/test/autotest-1.x/shorthand-id-self-closed/input.htmljs +0 -3
  960. package/test/autotest-1.x/shorthand-mixed/expected.html +0 -15
  961. package/test/autotest-1.x/shorthand-mixed/input.htmljs +0 -5
  962. package/test/autotest-1.x/shorthand-mixed-concise/expected.html +0 -11
  963. package/test/autotest-1.x/shorthand-mixed-concise/input.htmljs +0 -5
  964. package/test/autotest-1.x/simple-text-delimited/expected.html +0 -1
  965. package/test/autotest-1.x/simple-text-delimited/input.htmljs +0 -3
  966. package/test/autotest-1.x/single-hyphen-after-attr/expected.html +0 -3
  967. package/test/autotest-1.x/single-hyphen-after-attr/input.htmljs +0 -1
  968. package/test/autotest-1.x/single-line-text-block/expected.html +0 -2
  969. package/test/autotest-1.x/single-line-text-block/input.htmljs +0 -2
  970. package/test/autotest-1.x/single-line-text-block-nested/expected.html +0 -4
  971. package/test/autotest-1.x/single-line-text-block-nested/input.htmljs +0 -3
  972. package/test/autotest-1.x/single-line-text-block-sibling/expected.html +0 -6
  973. package/test/autotest-1.x/single-line-text-block-sibling/input.htmljs +0 -5
  974. package/test/autotest-1.x/stray-forward-slash-within-open-tag/expected.html +0 -3
  975. package/test/autotest-1.x/stray-forward-slash-within-open-tag/input.htmljs +0 -1
  976. package/test/autotest-1.x/stray-special-chars/expected.html +0 -3
  977. package/test/autotest-1.x/stray-special-chars/input.htmljs +0 -1
  978. package/test/autotest-1.x/strip-bom/expected.html +0 -3
  979. package/test/autotest-1.x/strip-bom/input-good.htmljs +0 -1
  980. package/test/autotest-1.x/strip-bom/input.htmljs +0 -1
  981. package/test/autotest-1.x/strip-bom/input.htmljs.txt +0 -60
  982. package/test/autotest-1.x/tag-name-expression-literal-prefix/expected.html +0 -3
  983. package/test/autotest-1.x/tag-name-expression-literal-prefix/input.htmljs +0 -2
  984. package/test/autotest-1.x/tag-name-expression-literal-prefix-attrs/expected.html +0 -3
  985. package/test/autotest-1.x/tag-name-expression-literal-prefix-attrs/input.htmljs +0 -2
  986. package/test/autotest-1.x/tag-name-expression-literal-prefix-suffix/expected.html +0 -3
  987. package/test/autotest-1.x/tag-name-expression-literal-prefix-suffix/input.htmljs +0 -2
  988. package/test/autotest-1.x/tag-name-expression-literal-suffix/expected.html +0 -3
  989. package/test/autotest-1.x/tag-name-expression-literal-suffix/input.htmljs +0 -2
  990. package/test/autotest-1.x/tag-name-expression-shorthand-id/expected.html +0 -2
  991. package/test/autotest-1.x/tag-name-expression-shorthand-id/input.htmljs +0 -1
  992. package/test/autotest-1.x/tag-name-expression-simple/expected.html +0 -3
  993. package/test/autotest-1.x/tag-name-expression-simple/input.htmljs +0 -2
  994. package/test/autotest-1.x/tag-name-expression-simple-empty-close/expected.html +0 -3
  995. package/test/autotest-1.x/tag-name-expression-simple-empty-close/input.htmljs +0 -2
  996. package/test/autotest-1.x/text-after-tag/expected.html +0 -3
  997. package/test/autotest-1.x/text-after-tag/input.htmljs +0 -1
  998. package/test/autotest-1.x/text-parse-mode-concise/expected.html +0 -5
  999. package/test/autotest-1.x/text-parse-mode-concise/input.htmljs +0 -3
  1000. package/test/autotest-1.x/text-parse-mode-concise/test.js +0 -1
  1001. package/test/autotest-1.x/text-parse-mode-delimited-block/expected.html +0 -8
  1002. package/test/autotest-1.x/text-parse-mode-delimited-block/input.htmljs +0 -6
  1003. package/test/autotest-1.x/text-parse-mode-delimited-block/test.js +0 -1
  1004. package/test/autotest-1.x/text-parse-mode-html/expected.html +0 -7
  1005. package/test/autotest-1.x/text-parse-mode-html/input.htmljs +0 -3
  1006. package/test/autotest-1.x/text-parse-mode-html/test.js +0 -1
  1007. package/test/autotest-1.x/text-parse-mode-parsed-text/expected.html +0 -11
  1008. package/test/autotest-1.x/text-parse-mode-parsed-text/input.htmljs +0 -7
  1009. package/test/autotest-1.x/text-parse-mode-parsed-text/test.js +0 -7
  1010. package/test/autotest-1.x/text-parse-mode-static-text/expected.html +0 -11
  1011. package/test/autotest-1.x/text-parse-mode-static-text/input.htmljs +0 -7
  1012. package/test/autotest-1.x/text-parse-mode-static-text/test.js +0 -7
  1013. package/test/autotest-1.x/var/expected.html +0 -9
  1014. package/test/autotest-1.x/var/input.htmljs +0 -5
  1015. package/test/autotest-1.x/whitespace-empty-lines/expected.html +0 -7
  1016. package/test/autotest-1.x/whitespace-empty-lines/input.htmljs +0 -4
  1017. package/test/autotest-1.x/whitespace-empty-lines-indent/expected.html +0 -8
  1018. package/test/autotest-1.x/whitespace-empty-lines-indent/input.htmljs +0 -4
  1019. package/test/autotest-1.x/whitespace-newline/expected.html +0 -7
  1020. package/test/autotest-1.x/whitespace-newline/input.htmljs +0 -6
  1021. package/test/autotest-1.x/whitespace-newline-indent/expected.html +0 -7
  1022. package/test/autotest-1.x/whitespace-newline-indent/input.htmljs +0 -6
  1023. package/test/autotest-1.x/windows-line-ending/expected.html +0 -10
  1024. package/test/autotest-1.x/windows-line-ending/test.js +0 -11
  1025. package/test/autotest-1.x/xml-declaration/expected.html +0 -5
  1026. package/test/autotest-1.x/xml-declaration/input.htmljs +0 -2
  1027. package/test/autotest-1.x/xml-declaration-ill-formed/expected.html +0 -5
  1028. package/test/autotest-1.x/xml-declaration-ill-formed/input.htmljs +0 -2
  1029. package/test/test.js +0 -6
  1030. package/test/util/TreeBuilder.js +0 -417
  1031. package/test/util/runDirTest.js +0 -76
package/dist/index.mjs ADDED
@@ -0,0 +1,2013 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ // src/util/constants.ts
8
+ var OpenTagEnding = /* @__PURE__ */ ((OpenTagEnding2) => {
9
+ OpenTagEnding2[OpenTagEnding2["tag"] = 0] = "tag";
10
+ OpenTagEnding2[OpenTagEnding2["self"] = 1] = "self";
11
+ OpenTagEnding2[OpenTagEnding2["void"] = 2] = "void";
12
+ OpenTagEnding2[OpenTagEnding2["code"] = 4] = "code";
13
+ return OpenTagEnding2;
14
+ })(OpenTagEnding || {});
15
+
16
+ // src/util/util.ts
17
+ function isWhitespaceCode(code) {
18
+ return code <= 32 /* SPACE */;
19
+ }
20
+ function getLoc(lines, range) {
21
+ const start = getPos(lines, 0, range.start);
22
+ const end = range.start === range.end ? start : getPos(lines, start.line, range.end);
23
+ return { start, end };
24
+ }
25
+ function getPos(lines, startLine, index) {
26
+ let max = lines.length - 1;
27
+ let line = startLine;
28
+ while (line < max) {
29
+ const mid = 1 + line + max >>> 1;
30
+ if (lines[mid] <= index) {
31
+ line = mid;
32
+ } else {
33
+ max = mid - 1;
34
+ }
35
+ }
36
+ return {
37
+ line,
38
+ character: index - lines[line]
39
+ };
40
+ }
41
+ function getLines(src) {
42
+ const lines = [-1];
43
+ for (let i = 0; i < src.length; i++) {
44
+ if (src.charCodeAt(i) === 10 /* NEWLINE */) {
45
+ lines.push(i);
46
+ }
47
+ }
48
+ return lines;
49
+ }
50
+ function htmlEOF() {
51
+ this.endText();
52
+ while (this.activeTag) {
53
+ if (this.activeTag.concise) {
54
+ this.closeTag(this.pos, this.pos, void 0);
55
+ } else {
56
+ return this.emitError(this.activeTag, "MISSING_END_TAG", 'Missing ending "' + this.read(this.activeTag.tagName) + '" tag');
57
+ }
58
+ }
59
+ }
60
+
61
+ // src/core/Parser.ts
62
+ var Parser = class {
63
+ constructor(handlers) {
64
+ this.handlers = handlers;
65
+ this.handlers = handlers;
66
+ }
67
+ pos;
68
+ maxPos;
69
+ data;
70
+ activeState;
71
+ activeRange;
72
+ forward;
73
+ activeTag;
74
+ activeAttr;
75
+ indent;
76
+ isConcise;
77
+ beginMixedMode;
78
+ endingMixedModeAtEOL;
79
+ textPos;
80
+ lines;
81
+ read(range) {
82
+ return this.data.slice(range.start, range.end);
83
+ }
84
+ positionAt(index) {
85
+ return getPos(this.lines || (this.lines = getLines(this.data)), 0, index);
86
+ }
87
+ locationAt(range) {
88
+ return getLoc(this.lines || (this.lines = getLines(this.data)), range);
89
+ }
90
+ enterState(state) {
91
+ this.activeState = state;
92
+ return this.activeRange = state.enter.call(this, this.activeRange, this.pos);
93
+ }
94
+ exitState() {
95
+ const { activeRange, activeState } = this;
96
+ const parent = this.activeRange = activeRange.parent;
97
+ this.activeState = parent.state;
98
+ this.forward = 0;
99
+ activeRange.end = this.pos;
100
+ activeState.exit.call(this, activeRange);
101
+ this.activeState.return.call(this, activeRange, parent);
102
+ }
103
+ matchAtPos(a, b) {
104
+ const aPos = a.start;
105
+ const aLen = a.end - aPos;
106
+ let bPos = 0;
107
+ let bLen = 0;
108
+ let bSource = this.data;
109
+ if (typeof b === "string") {
110
+ bLen = b.length;
111
+ bSource = b;
112
+ } else {
113
+ bPos = b.start;
114
+ bLen = b.end - bPos;
115
+ }
116
+ if (aLen !== bLen)
117
+ return false;
118
+ for (let i = 0; i < aLen; i++) {
119
+ if (this.data.charAt(aPos + i) !== bSource.charAt(bPos + i)) {
120
+ return false;
121
+ }
122
+ }
123
+ return true;
124
+ }
125
+ matchAnyAtPos(a, list) {
126
+ for (const item of list) {
127
+ if (this.matchAtPos(a, item))
128
+ return true;
129
+ }
130
+ return false;
131
+ }
132
+ lookAheadFor(str, startPos = this.pos + 1) {
133
+ let i = str.length;
134
+ if (startPos + i <= this.maxPos) {
135
+ const { data } = this;
136
+ for (; i--; ) {
137
+ if (str[i] !== data[startPos + i]) {
138
+ return void 0;
139
+ }
140
+ }
141
+ return str;
142
+ }
143
+ }
144
+ lookAtCharCodeAhead(offset, startPos = this.pos) {
145
+ return this.data.charCodeAt(startPos + offset);
146
+ }
147
+ startText() {
148
+ if (this.textPos === -1) {
149
+ this.textPos = this.pos;
150
+ }
151
+ }
152
+ endText() {
153
+ var _a, _b;
154
+ const start = this.textPos;
155
+ if (start !== -1) {
156
+ (_b = (_a = this.handlers).onText) == null ? void 0 : _b.call(_a, { start, end: this.pos });
157
+ this.textPos = -1;
158
+ }
159
+ }
160
+ beginHtmlBlock(delimiter, singleLine) {
161
+ var _a;
162
+ const content = this.enterState(((_a = this.activeTag) == null ? void 0 : _a.bodyMode) === 1 /* PARSED_TEXT */ ? states_exports.PARSED_TEXT_CONTENT : states_exports.HTML_CONTENT);
163
+ content.singleLine = singleLine;
164
+ content.delimiter = delimiter;
165
+ content.indent = this.indent;
166
+ }
167
+ emitError(range, code, message) {
168
+ var _a, _b;
169
+ let start, end;
170
+ if (typeof range === "number") {
171
+ start = end = range;
172
+ } else {
173
+ start = range.start;
174
+ end = range.end;
175
+ }
176
+ (_b = (_a = this.handlers).onError) == null ? void 0 : _b.call(_a, {
177
+ start,
178
+ end,
179
+ code,
180
+ message
181
+ });
182
+ this.pos = this.maxPos + 1;
183
+ }
184
+ closeTag(start, end, value) {
185
+ var _a, _b;
186
+ const { beginMixedMode, parentTag } = this.activeTag;
187
+ if (beginMixedMode)
188
+ this.endingMixedModeAtEOL = true;
189
+ this.activeTag = parentTag;
190
+ (_b = (_a = this.handlers).onCloseTag) == null ? void 0 : _b.call(_a, {
191
+ start,
192
+ end,
193
+ value
194
+ });
195
+ }
196
+ consumeWhitespaceIfBefore(str, start = 0) {
197
+ const { pos, data } = this;
198
+ let cur = pos + start;
199
+ while (isWhitespaceCode(data.charCodeAt(cur)))
200
+ cur++;
201
+ if (this.lookAheadFor(str, cur)) {
202
+ this.pos = cur;
203
+ return true;
204
+ }
205
+ return false;
206
+ }
207
+ getPreviousNonWhitespaceCharCode(start = -1) {
208
+ let behind = start;
209
+ while (isWhitespaceCode(this.lookAtCharCodeAhead(behind)))
210
+ behind--;
211
+ return this.lookAtCharCodeAhead(behind);
212
+ }
213
+ onlyWhitespaceRemainsOnLine(start = 1) {
214
+ const maxOffset = this.maxPos - this.pos;
215
+ let ahead = start;
216
+ while (ahead < maxOffset) {
217
+ const code = this.lookAtCharCodeAhead(ahead);
218
+ if (isWhitespaceCode(code)) {
219
+ switch (code) {
220
+ case 13 /* CARRIAGE_RETURN */:
221
+ case 10 /* NEWLINE */:
222
+ return true;
223
+ }
224
+ } else {
225
+ return false;
226
+ }
227
+ ahead++;
228
+ }
229
+ return true;
230
+ }
231
+ consumeWhitespaceOnLine(start = 1) {
232
+ const maxOffset = this.maxPos - this.pos;
233
+ let ahead = start;
234
+ while (ahead < maxOffset) {
235
+ const code = this.lookAtCharCodeAhead(ahead);
236
+ if (isWhitespaceCode(code)) {
237
+ switch (code) {
238
+ case 13 /* CARRIAGE_RETURN */:
239
+ case 10 /* NEWLINE */:
240
+ this.pos += ahead;
241
+ return true;
242
+ }
243
+ } else {
244
+ this.pos += ahead;
245
+ return false;
246
+ }
247
+ ahead++;
248
+ }
249
+ this.pos = this.maxPos;
250
+ return true;
251
+ }
252
+ consumeWhitespace() {
253
+ const maxOffset = this.maxPos - this.pos;
254
+ let ahead = 0;
255
+ while (ahead < maxOffset && isWhitespaceCode(this.lookAtCharCodeAhead(ahead))) {
256
+ ahead++;
257
+ }
258
+ this.pos += ahead;
259
+ }
260
+ parse(data) {
261
+ const maxPos = this.maxPos = data.length;
262
+ this.data = data;
263
+ this.indent = "";
264
+ this.textPos = -1;
265
+ this.forward = 1;
266
+ this.isConcise = true;
267
+ this.beginMixedMode = this.endingMixedModeAtEOL = false;
268
+ this.lines = this.activeTag = this.activeAttr = void 0;
269
+ this.pos = data.charCodeAt(0) === 65279 ? 1 : 0;
270
+ this.enterState(states_exports.CONCISE_HTML_CONTENT);
271
+ while (this.pos < maxPos) {
272
+ const code = data.charCodeAt(this.pos);
273
+ if (code === 10 /* NEWLINE */) {
274
+ this.forward = 1;
275
+ this.activeState.eol.call(this, 1, this.activeRange);
276
+ } else if (code === 13 /* CARRIAGE_RETURN */ && data.charCodeAt(this.pos + 1) === 10 /* NEWLINE */) {
277
+ this.forward = 2;
278
+ this.activeState.eol.call(this, 2, this.activeRange);
279
+ } else {
280
+ this.forward = 1;
281
+ this.activeState.char.call(this, code, this.activeRange);
282
+ }
283
+ this.pos += this.forward;
284
+ }
285
+ while (this.pos === this.maxPos) {
286
+ this.forward = 1;
287
+ this.activeState.eof.call(this, this.activeRange);
288
+ if (this.forward !== 0)
289
+ break;
290
+ }
291
+ }
292
+ };
293
+
294
+ // src/states/index.ts
295
+ var states_exports = {};
296
+ __export(states_exports, {
297
+ ATTRIBUTE: () => ATTRIBUTE,
298
+ BEGIN_DELIMITED_HTML_BLOCK: () => BEGIN_DELIMITED_HTML_BLOCK,
299
+ CDATA: () => CDATA,
300
+ CLOSE_TAG: () => CLOSE_TAG,
301
+ CONCISE_HTML_CONTENT: () => CONCISE_HTML_CONTENT,
302
+ DECLARATION: () => DECLARATION,
303
+ DTD: () => DTD,
304
+ EXPRESSION: () => EXPRESSION,
305
+ HTML_COMMENT: () => HTML_COMMENT,
306
+ HTML_CONTENT: () => HTML_CONTENT,
307
+ INLINE_SCRIPT: () => INLINE_SCRIPT,
308
+ JS_COMMENT_BLOCK: () => JS_COMMENT_BLOCK,
309
+ JS_COMMENT_LINE: () => JS_COMMENT_LINE,
310
+ OPEN_TAG: () => OPEN_TAG,
311
+ PARSED_TEXT_CONTENT: () => PARSED_TEXT_CONTENT,
312
+ PLACEHOLDER: () => PLACEHOLDER,
313
+ REGULAR_EXPRESSION: () => REGULAR_EXPRESSION,
314
+ STRING: () => STRING,
315
+ TAG_NAME: () => TAG_NAME,
316
+ TEMPLATE_STRING: () => TEMPLATE_STRING,
317
+ checkForCDATA: () => checkForCDATA,
318
+ checkForClosingTag: () => checkForClosingTag,
319
+ checkForPlaceholder: () => checkForPlaceholder,
320
+ handleDelimitedEOL: () => handleDelimitedEOL
321
+ });
322
+
323
+ // src/states/ATTRIBUTE.ts
324
+ var HTML_VALUE_TERMINATORS = [
325
+ 62 /* CLOSE_ANGLE_BRACKET */,
326
+ 44 /* COMMA */,
327
+ [47 /* FORWARD_SLASH */, 62 /* CLOSE_ANGLE_BRACKET */]
328
+ ];
329
+ var CONCISE_VALUE_TERMINATORS = [
330
+ 93 /* CLOSE_SQUARE_BRACKET */,
331
+ 59 /* SEMICOLON */,
332
+ 44 /* COMMA */
333
+ ];
334
+ var HTML_NAME_TERMINATORS = [
335
+ 62 /* CLOSE_ANGLE_BRACKET */,
336
+ 44 /* COMMA */,
337
+ 40 /* OPEN_PAREN */,
338
+ 61 /* EQUAL */,
339
+ [58 /* COLON */, 61 /* EQUAL */],
340
+ [47 /* FORWARD_SLASH */, 62 /* CLOSE_ANGLE_BRACKET */]
341
+ ];
342
+ var CONCISE_NAME_TERMINATORS = [
343
+ 93 /* CLOSE_SQUARE_BRACKET */,
344
+ 59 /* SEMICOLON */,
345
+ 61 /* EQUAL */,
346
+ 44 /* COMMA */,
347
+ 40 /* OPEN_PAREN */,
348
+ [58 /* COLON */, 61 /* EQUAL */]
349
+ ];
350
+ var ATTRIBUTE = {
351
+ name: "ATTRIBUTE",
352
+ enter(parent, start) {
353
+ return this.activeAttr = {
354
+ state: ATTRIBUTE,
355
+ parent,
356
+ start,
357
+ end: start,
358
+ valueStart: start,
359
+ stage: 0 /* UNKNOWN */,
360
+ name: void 0,
361
+ args: false,
362
+ bound: false,
363
+ spread: false
364
+ };
365
+ },
366
+ exit() {
367
+ this.activeAttr = void 0;
368
+ },
369
+ char(code, attr) {
370
+ if (isWhitespaceCode(code)) {
371
+ return;
372
+ } else if (code === 61 /* EQUAL */ || code === 58 /* COLON */ && this.lookAtCharCodeAhead(1) === 61 /* EQUAL */ || code === 46 /* PERIOD */ && this.lookAheadFor("..")) {
373
+ attr.valueStart = this.pos;
374
+ if (code === 58 /* COLON */) {
375
+ ensureAttrName(this, attr);
376
+ attr.bound = true;
377
+ this.pos += 2;
378
+ this.consumeWhitespace();
379
+ } else if (code === 46 /* PERIOD */) {
380
+ attr.spread = true;
381
+ this.pos += 3;
382
+ } else {
383
+ ensureAttrName(this, attr);
384
+ this.pos++;
385
+ this.consumeWhitespace();
386
+ }
387
+ attr.stage = 2 /* VALUE */;
388
+ const expr = this.enterState(states_exports.EXPRESSION);
389
+ expr.terminatedByWhitespace = true;
390
+ expr.terminator = this.isConcise ? CONCISE_VALUE_TERMINATORS : HTML_VALUE_TERMINATORS;
391
+ this.pos--;
392
+ } else if (code === 40 /* OPEN_PAREN */) {
393
+ ensureAttrName(this, attr);
394
+ attr.stage = 3 /* ARGUMENT */;
395
+ this.pos++;
396
+ this.enterState(states_exports.EXPRESSION).terminator = 41 /* CLOSE_PAREN */;
397
+ this.pos--;
398
+ } else if (code === 123 /* OPEN_CURLY_BRACE */ && attr.args) {
399
+ ensureAttrName(this, attr);
400
+ attr.stage = 4 /* BLOCK */;
401
+ this.pos++;
402
+ const expr = this.enterState(states_exports.EXPRESSION);
403
+ expr.terminatedByWhitespace = false;
404
+ expr.terminator = 125 /* CLOSE_CURLY_BRACE */;
405
+ this.pos--;
406
+ } else if (attr.stage === 0 /* UNKNOWN */) {
407
+ attr.stage = 1 /* NAME */;
408
+ const expr = this.enterState(states_exports.EXPRESSION);
409
+ expr.terminatedByWhitespace = true;
410
+ expr.skipOperators = true;
411
+ expr.terminator = this.isConcise ? CONCISE_NAME_TERMINATORS : HTML_NAME_TERMINATORS;
412
+ this.pos--;
413
+ } else {
414
+ this.exitState();
415
+ }
416
+ },
417
+ eol() {
418
+ if (this.isConcise) {
419
+ this.exitState();
420
+ }
421
+ },
422
+ eof(attr) {
423
+ if (this.isConcise) {
424
+ this.exitState();
425
+ } else {
426
+ this.emitError(attr, "MALFORMED_OPEN_TAG", 'EOF reached while parsing attribute "' + (attr.name ? this.read(attr.name) : "default") + '" for the "' + this.read(this.activeTag.tagName) + '" tag');
427
+ }
428
+ },
429
+ return(child, attr) {
430
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
431
+ switch (attr.stage) {
432
+ case 1 /* NAME */: {
433
+ attr.name = {
434
+ start: child.start,
435
+ end: child.end
436
+ };
437
+ (_b = (_a = this.handlers).onAttrName) == null ? void 0 : _b.call(_a, attr.name);
438
+ break;
439
+ }
440
+ case 3 /* ARGUMENT */: {
441
+ if (attr.args) {
442
+ this.emitError(child, "ILLEGAL_ATTRIBUTE_ARGUMENT", "An attribute can only have one set of arguments");
443
+ return;
444
+ }
445
+ const start = child.start - 1;
446
+ const end = ++this.pos;
447
+ const value = {
448
+ start: child.start,
449
+ end: child.end
450
+ };
451
+ if (this.consumeWhitespaceIfBefore("{")) {
452
+ attr.args = {
453
+ start,
454
+ end,
455
+ value
456
+ };
457
+ } else {
458
+ attr.args = true;
459
+ (_d = (_c = this.handlers).onAttrArgs) == null ? void 0 : _d.call(_c, {
460
+ start,
461
+ end,
462
+ value
463
+ });
464
+ }
465
+ break;
466
+ }
467
+ case 4 /* BLOCK */: {
468
+ const params = attr.args;
469
+ const start = params.start;
470
+ const end = ++this.pos;
471
+ (_f = (_e = this.handlers).onAttrMethod) == null ? void 0 : _f.call(_e, {
472
+ start,
473
+ end,
474
+ params,
475
+ body: {
476
+ start: child.start - 1,
477
+ end,
478
+ value: {
479
+ start: child.start,
480
+ end: child.end
481
+ }
482
+ }
483
+ });
484
+ this.exitState();
485
+ break;
486
+ }
487
+ case 2 /* VALUE */: {
488
+ if (child.start === child.end) {
489
+ return this.emitError(child, "ILLEGAL_ATTRIBUTE_VALUE", "Missing value for attribute");
490
+ }
491
+ if (attr.spread) {
492
+ (_h = (_g = this.handlers).onAttrSpread) == null ? void 0 : _h.call(_g, {
493
+ start: attr.valueStart,
494
+ end: child.end,
495
+ value: {
496
+ start: child.start,
497
+ end: child.end
498
+ }
499
+ });
500
+ } else {
501
+ (_j = (_i = this.handlers).onAttrValue) == null ? void 0 : _j.call(_i, {
502
+ start: attr.valueStart,
503
+ end: child.end,
504
+ bound: attr.bound,
505
+ value: {
506
+ start: child.start,
507
+ end: child.end
508
+ }
509
+ });
510
+ }
511
+ this.exitState();
512
+ break;
513
+ }
514
+ }
515
+ }
516
+ };
517
+ function ensureAttrName(parser, attr) {
518
+ var _a, _b;
519
+ if (!attr.name) {
520
+ (_b = (_a = parser.handlers).onAttrName) == null ? void 0 : _b.call(_a, {
521
+ start: attr.start,
522
+ end: attr.start
523
+ });
524
+ }
525
+ }
526
+
527
+ // src/states/BEGIN_DELIMITED_HTML_BLOCK.ts
528
+ var BEGIN_DELIMITED_HTML_BLOCK = {
529
+ name: "BEGIN_DELIMITED_HTML_BLOCK",
530
+ enter(parent, start) {
531
+ return {
532
+ state: BEGIN_DELIMITED_HTML_BLOCK,
533
+ parent,
534
+ start,
535
+ end: start,
536
+ indent: this.indent,
537
+ delimiter: ""
538
+ };
539
+ },
540
+ exit() {
541
+ },
542
+ char(code, block) {
543
+ if (code === 45 /* HTML_BLOCK_DELIMITER */) {
544
+ block.delimiter += "-";
545
+ } else {
546
+ const startPos = this.pos;
547
+ if (!this.consumeWhitespaceOnLine()) {
548
+ this.pos = startPos + 1;
549
+ this.beginHtmlBlock(void 0, true);
550
+ this.pos--;
551
+ }
552
+ }
553
+ },
554
+ eol(len, block) {
555
+ this.beginHtmlBlock(block.delimiter, false);
556
+ handleDelimitedBlockEOL(this, len, block);
557
+ },
558
+ eof: htmlEOF,
559
+ return() {
560
+ }
561
+ };
562
+ function handleDelimitedEOL(parser, newLineLength, content) {
563
+ if (content.singleLine) {
564
+ parser.endText();
565
+ parser.exitState();
566
+ parser.exitState();
567
+ return true;
568
+ }
569
+ if (content.delimiter) {
570
+ handleDelimitedBlockEOL(parser, newLineLength, content);
571
+ return true;
572
+ }
573
+ return false;
574
+ }
575
+ function handleDelimitedBlockEOL(parser, newLineLength, {
576
+ indent,
577
+ delimiter
578
+ }) {
579
+ const endHtmlBlockLookahead = indent + delimiter;
580
+ if (parser.lookAheadFor(endHtmlBlockLookahead, parser.pos + newLineLength)) {
581
+ parser.startText();
582
+ parser.pos += newLineLength;
583
+ parser.endText();
584
+ parser.pos += endHtmlBlockLookahead.length;
585
+ if (parser.consumeWhitespaceOnLine(0)) {
586
+ parser.endText();
587
+ parser.exitState();
588
+ parser.exitState();
589
+ } else {
590
+ parser.emitError(parser.pos, "INVALID_CHARACTER", "A concise mode closing block delimiter can only be followed by whitespace.");
591
+ }
592
+ } else if (parser.lookAheadFor(indent, parser.pos + newLineLength)) {
593
+ parser.startText();
594
+ parser.pos += indent.length;
595
+ } else if (indent && !parser.onlyWhitespaceRemainsOnLine(newLineLength)) {
596
+ parser.endText();
597
+ parser.exitState();
598
+ parser.exitState();
599
+ } else {
600
+ parser.startText();
601
+ }
602
+ }
603
+
604
+ // src/states/CDATA.ts
605
+ var CDATA = {
606
+ name: "CDATA",
607
+ enter(parent, start) {
608
+ return {
609
+ state: CDATA,
610
+ parent,
611
+ start,
612
+ end: start
613
+ };
614
+ },
615
+ exit(cdata) {
616
+ var _a, _b;
617
+ (_b = (_a = this.handlers).onCDATA) == null ? void 0 : _b.call(_a, {
618
+ start: cdata.start,
619
+ end: cdata.end,
620
+ value: {
621
+ start: cdata.start + 9,
622
+ end: cdata.end - 3
623
+ }
624
+ });
625
+ },
626
+ char(code) {
627
+ if (code === 93 /* CLOSE_SQUARE_BRACKET */ && this.lookAheadFor("]>")) {
628
+ this.pos += 3;
629
+ this.exitState();
630
+ return;
631
+ }
632
+ },
633
+ eol() {
634
+ },
635
+ eof(cdata) {
636
+ this.emitError(cdata, "MALFORMED_CDATA", "EOF reached while parsing CDATA");
637
+ },
638
+ return() {
639
+ }
640
+ };
641
+ function checkForCDATA(parser) {
642
+ if (parser.lookAheadFor("![CDATA[")) {
643
+ parser.endText();
644
+ parser.enterState(CDATA);
645
+ parser.pos += 8;
646
+ return true;
647
+ }
648
+ return false;
649
+ }
650
+
651
+ // src/states/CLOSE_TAG.ts
652
+ var CLOSE_TAG = {
653
+ name: "CLOSE_TAG",
654
+ enter(parent, start) {
655
+ this.endText();
656
+ return {
657
+ state: CLOSE_TAG,
658
+ parent,
659
+ start,
660
+ end: start
661
+ };
662
+ },
663
+ exit() {
664
+ },
665
+ char(code, closeTag) {
666
+ if (code === 62 /* CLOSE_ANGLE_BRACKET */) {
667
+ this.pos++;
668
+ this.exitState();
669
+ ensureExpectedCloseTag(this, closeTag);
670
+ }
671
+ },
672
+ eol() {
673
+ },
674
+ eof(closeTag) {
675
+ this.emitError(closeTag, "MALFORMED_CLOSE_TAG", "EOF reached while parsing closing tag");
676
+ },
677
+ return() {
678
+ }
679
+ };
680
+ function checkForClosingTag(parser) {
681
+ const curPos = parser.pos + 1;
682
+ let match = !!parser.lookAheadFor("/>");
683
+ let skip = 3;
684
+ if (!match) {
685
+ const { tagName } = parser.activeTag;
686
+ const tagNameLen = tagName.end - tagName.start;
687
+ if (tagNameLen) {
688
+ skip += tagNameLen;
689
+ match = parser.lookAheadFor("/", curPos) && parser.lookAheadFor(">", 1 + curPos + tagNameLen) && parser.matchAtPos(tagName, {
690
+ start: 1 + curPos,
691
+ end: 1 + curPos + tagNameLen
692
+ }) || false;
693
+ }
694
+ }
695
+ if (match) {
696
+ parser.endText();
697
+ if (ensureExpectedCloseTag(parser, {
698
+ start: parser.pos,
699
+ end: parser.pos += skip
700
+ })) {
701
+ parser.exitState();
702
+ }
703
+ return true;
704
+ }
705
+ return false;
706
+ }
707
+ function ensureExpectedCloseTag(parser, closeTag) {
708
+ const activeTag = parser.activeTag;
709
+ const closeTagNameStart = closeTag.start + 2;
710
+ const closeTagNameEnd = closeTag.end - 1;
711
+ if (!activeTag) {
712
+ parser.emitError(closeTag, "EXTRA_CLOSING_TAG", 'The closing "' + parser.read({ start: closeTagNameStart, end: closeTagNameEnd }) + '" tag was not expected');
713
+ return false;
714
+ }
715
+ const closeTagNamePos = {
716
+ start: closeTagNameStart,
717
+ end: closeTagNameEnd
718
+ };
719
+ if (closeTagNameStart < closeTagNameEnd) {
720
+ if (!parser.matchAtPos(closeTagNamePos, activeTag.tagName.end > activeTag.tagName.start ? activeTag.tagName : "div")) {
721
+ if (activeTag.shorthandEnd === void 0 || !parser.matchAtPos(closeTagNamePos, {
722
+ start: activeTag.tagName.start,
723
+ end: activeTag.shorthandEnd
724
+ })) {
725
+ parser.emitError(closeTag, "MISMATCHED_CLOSING_TAG", 'The closing "' + parser.read(closeTagNamePos) + '" tag does not match the corresponding opening "' + (parser.read(activeTag.tagName) || "div") + '" tag');
726
+ return false;
727
+ }
728
+ }
729
+ }
730
+ parser.closeTag(closeTag.start, closeTag.end, closeTagNamePos);
731
+ return true;
732
+ }
733
+
734
+ // src/states/CONCISE_HTML_CONTENT.ts
735
+ var CONCISE_HTML_CONTENT = {
736
+ name: "CONCISE_HTML_CONTENT",
737
+ enter(parent, start) {
738
+ this.isConcise = true;
739
+ this.indent = "";
740
+ return {
741
+ state: CONCISE_HTML_CONTENT,
742
+ parent,
743
+ start,
744
+ end: start
745
+ };
746
+ },
747
+ exit() {
748
+ },
749
+ char(code) {
750
+ if (isWhitespaceCode(code)) {
751
+ this.indent += this.data[this.pos];
752
+ } else {
753
+ const curIndent = this.indent.length;
754
+ const indentStart = this.pos - curIndent - 1;
755
+ let parentTag = this.activeTag;
756
+ while (parentTag && parentTag.indent.length >= curIndent) {
757
+ this.closeTag(indentStart, indentStart, void 0);
758
+ parentTag = this.activeTag;
759
+ }
760
+ if (!parentTag && curIndent) {
761
+ this.emitError(this.pos, "BAD_INDENTATION", "Line has extra indentation at the beginning");
762
+ return;
763
+ }
764
+ if (parentTag) {
765
+ if (parentTag.ending !== 0 /* tag */) {
766
+ this.emitError(this.pos, "INVALID_BODY", `The "${this.read(parentTag.tagName)}" tag does not allow nested body content`);
767
+ return;
768
+ }
769
+ if (parentTag.bodyMode === 1 /* PARSED_TEXT */ && code !== 45 /* HTML_BLOCK_DELIMITER */) {
770
+ this.emitError(this.pos, "ILLEGAL_LINE_START", 'A line within a tag that only allows text content must begin with a "-" character');
771
+ return;
772
+ }
773
+ if (parentTag.nestedIndent === void 0) {
774
+ parentTag.nestedIndent = this.indent;
775
+ } else if (parentTag.nestedIndent !== this.indent) {
776
+ this.emitError(this.pos, "BAD_INDENTATION", "Line indentation does match indentation of previous line");
777
+ return;
778
+ }
779
+ }
780
+ switch (code) {
781
+ case 60 /* OPEN_ANGLE_BRACKET */:
782
+ this.beginMixedMode = true;
783
+ this.pos--;
784
+ this.beginHtmlBlock(void 0, false);
785
+ return;
786
+ case 36 /* DOLLAR */:
787
+ if (isWhitespaceCode(this.lookAtCharCodeAhead(1))) {
788
+ this.pos++;
789
+ this.enterState(states_exports.INLINE_SCRIPT);
790
+ return;
791
+ }
792
+ break;
793
+ case 45 /* HTML_BLOCK_DELIMITER */:
794
+ if (this.lookAtCharCodeAhead(1) === 45 /* HTML_BLOCK_DELIMITER */) {
795
+ this.enterState(states_exports.BEGIN_DELIMITED_HTML_BLOCK);
796
+ this.pos--;
797
+ } else {
798
+ this.emitError(this.pos, "ILLEGAL_LINE_START", 'A line in concise mode cannot start with a single hyphen. Use "--" instead. See: https://github.com/marko-js/htmljs-parser/issues/43');
799
+ }
800
+ return;
801
+ case 47 /* FORWARD_SLASH */:
802
+ switch (this.lookAtCharCodeAhead(1)) {
803
+ case 47 /* FORWARD_SLASH */:
804
+ this.enterState(states_exports.JS_COMMENT_LINE);
805
+ this.pos++;
806
+ return;
807
+ case 42 /* ASTERISK */:
808
+ this.enterState(states_exports.JS_COMMENT_BLOCK);
809
+ this.pos++;
810
+ return;
811
+ default:
812
+ this.emitError(this.pos, "ILLEGAL_LINE_START", 'A line in concise mode cannot start with "/" unless it starts a "//" or "/*" comment');
813
+ return;
814
+ }
815
+ }
816
+ this.enterState(states_exports.OPEN_TAG);
817
+ this.pos--;
818
+ }
819
+ },
820
+ eol() {
821
+ this.indent = "";
822
+ },
823
+ eof: htmlEOF,
824
+ return(child) {
825
+ var _a, _b, _c, _d;
826
+ this.indent = "";
827
+ this.isConcise = true;
828
+ switch (child.state) {
829
+ case states_exports.JS_COMMENT_LINE:
830
+ (_b = (_a = this.handlers).onComment) == null ? void 0 : _b.call(_a, {
831
+ start: child.start,
832
+ end: child.end,
833
+ value: {
834
+ start: child.start + 2,
835
+ end: child.end
836
+ }
837
+ });
838
+ break;
839
+ case states_exports.JS_COMMENT_BLOCK: {
840
+ (_d = (_c = this.handlers).onComment) == null ? void 0 : _d.call(_c, {
841
+ start: child.start,
842
+ end: child.end,
843
+ value: {
844
+ start: child.start + 2,
845
+ end: child.end - 2
846
+ }
847
+ });
848
+ if (!this.consumeWhitespaceOnLine(0)) {
849
+ this.emitError(this.pos, "INVALID_CHARACTER", "In concise mode a javascript comment block can only be followed by whitespace characters and a newline.");
850
+ }
851
+ break;
852
+ }
853
+ }
854
+ }
855
+ };
856
+
857
+ // src/states/DECLARATION.ts
858
+ var DECLARATION = {
859
+ name: "DECLARATION",
860
+ enter(parent, start) {
861
+ this.endText();
862
+ return {
863
+ state: DECLARATION,
864
+ parent,
865
+ start,
866
+ end: start
867
+ };
868
+ },
869
+ exit() {
870
+ },
871
+ char(code, declaration) {
872
+ if (code === 63 /* QUESTION */) {
873
+ if (this.lookAtCharCodeAhead(1) === 62 /* CLOSE_ANGLE_BRACKET */) {
874
+ exitDeclaration(this, declaration, 2);
875
+ }
876
+ } else if (code === 62 /* CLOSE_ANGLE_BRACKET */) {
877
+ exitDeclaration(this, declaration, 1);
878
+ }
879
+ },
880
+ eol() {
881
+ },
882
+ eof(declaration) {
883
+ this.emitError(declaration, "MALFORMED_DECLARATION", "EOF reached while parsing declaration");
884
+ },
885
+ return() {
886
+ }
887
+ };
888
+ function exitDeclaration(parser, declaration, closeOffset) {
889
+ var _a, _b;
890
+ parser.pos += closeOffset;
891
+ parser.exitState();
892
+ (_b = (_a = parser.handlers).onDeclaration) == null ? void 0 : _b.call(_a, {
893
+ start: declaration.start,
894
+ end: declaration.end,
895
+ value: {
896
+ start: declaration.start + 2,
897
+ end: declaration.end - closeOffset
898
+ }
899
+ });
900
+ }
901
+
902
+ // src/states/DTD.ts
903
+ var DTD = {
904
+ name: "DTD",
905
+ enter(parent, start) {
906
+ this.endText();
907
+ return {
908
+ state: DTD,
909
+ parent,
910
+ start,
911
+ end: start
912
+ };
913
+ },
914
+ exit(documentType) {
915
+ var _a, _b;
916
+ (_b = (_a = this.handlers).onDoctype) == null ? void 0 : _b.call(_a, {
917
+ start: documentType.start,
918
+ end: documentType.end,
919
+ value: {
920
+ start: documentType.start + 2,
921
+ end: documentType.end - 1
922
+ }
923
+ });
924
+ },
925
+ char(code) {
926
+ if (code === 62 /* CLOSE_ANGLE_BRACKET */) {
927
+ this.pos++;
928
+ this.exitState();
929
+ }
930
+ },
931
+ eol() {
932
+ },
933
+ eof(documentType) {
934
+ this.emitError(documentType, "MALFORMED_DOCUMENT_TYPE", "EOF reached while parsing document type");
935
+ },
936
+ return() {
937
+ }
938
+ };
939
+
940
+ // src/states/EXPRESSION.ts
941
+ var conciseOperatorPattern = buildOperatorPattern(true);
942
+ var htmlOperatorPattern = buildOperatorPattern(false);
943
+ var EXPRESSION = {
944
+ name: "EXPRESSION",
945
+ enter(parent, start) {
946
+ return {
947
+ state: EXPRESSION,
948
+ parent,
949
+ start,
950
+ end: start,
951
+ groupStack: [],
952
+ terminator: -1,
953
+ skipOperators: false,
954
+ terminatedByEOL: false,
955
+ terminatedByWhitespace: false
956
+ };
957
+ },
958
+ exit() {
959
+ },
960
+ char(code, expression) {
961
+ if (!expression.groupStack.length) {
962
+ if (expression.terminatedByWhitespace && isWhitespaceCode(code)) {
963
+ if (!checkForOperators(this, expression)) {
964
+ this.exitState();
965
+ }
966
+ return;
967
+ }
968
+ if (typeof expression.terminator === "number" ? expression.terminator === code : checkForTerminators(this, code, expression.terminator)) {
969
+ this.exitState();
970
+ return;
971
+ }
972
+ }
973
+ switch (code) {
974
+ case 34 /* DOUBLE_QUOTE */:
975
+ this.enterState(states_exports.STRING);
976
+ break;
977
+ case 39 /* SINGLE_QUOTE */:
978
+ this.enterState(states_exports.STRING).quoteCharCode = code;
979
+ break;
980
+ case 96 /* BACKTICK */:
981
+ this.enterState(states_exports.TEMPLATE_STRING);
982
+ break;
983
+ case 47 /* FORWARD_SLASH */:
984
+ switch (this.lookAtCharCodeAhead(1)) {
985
+ case 47 /* FORWARD_SLASH */:
986
+ this.enterState(states_exports.JS_COMMENT_LINE);
987
+ this.pos++;
988
+ break;
989
+ case 42 /* ASTERISK */:
990
+ this.enterState(states_exports.JS_COMMENT_BLOCK);
991
+ this.pos++;
992
+ break;
993
+ default: {
994
+ if (!canCharCodeBeFollowedByDivision(this.getPreviousNonWhitespaceCharCode())) {
995
+ this.enterState(states_exports.REGULAR_EXPRESSION);
996
+ }
997
+ break;
998
+ }
999
+ }
1000
+ break;
1001
+ case 40 /* OPEN_PAREN */:
1002
+ expression.groupStack.push(41 /* CLOSE_PAREN */);
1003
+ break;
1004
+ case 91 /* OPEN_SQUARE_BRACKET */:
1005
+ expression.groupStack.push(93 /* CLOSE_SQUARE_BRACKET */);
1006
+ break;
1007
+ case 123 /* OPEN_CURLY_BRACE */:
1008
+ expression.groupStack.push(125 /* CLOSE_CURLY_BRACE */);
1009
+ break;
1010
+ case 41 /* CLOSE_PAREN */:
1011
+ case 93 /* CLOSE_SQUARE_BRACKET */:
1012
+ case 125 /* CLOSE_CURLY_BRACE */: {
1013
+ if (!expression.groupStack.length) {
1014
+ return this.emitError(expression, "INVALID_EXPRESSION", 'Mismatched group. A closing "' + String.fromCharCode(code) + '" character was found but it is not matched with a corresponding opening character.');
1015
+ }
1016
+ const expectedCode = expression.groupStack.pop();
1017
+ if (expectedCode !== code) {
1018
+ return this.emitError(expression, "INVALID_EXPRESSION", 'Mismatched group. A "' + String.fromCharCode(code) + '" character was found when "' + String.fromCharCode(expectedCode) + '" was expected.');
1019
+ }
1020
+ break;
1021
+ }
1022
+ }
1023
+ },
1024
+ eol(_, expression) {
1025
+ if (!expression.groupStack.length && (expression.terminatedByWhitespace || expression.terminatedByEOL)) {
1026
+ this.exitState();
1027
+ }
1028
+ },
1029
+ eof(expression) {
1030
+ if (!expression.groupStack.length && (this.isConcise || expression.terminatedByEOL)) {
1031
+ this.exitState();
1032
+ } else {
1033
+ const { parent } = expression;
1034
+ switch (parent.state) {
1035
+ case states_exports.ATTRIBUTE: {
1036
+ const attr = parent;
1037
+ if (!attr.spread && !attr.name) {
1038
+ return this.emitError(expression, "MALFORMED_OPEN_TAG", 'EOF reached while parsing attribute name for the "' + this.read(this.activeTag.tagName) + '" tag');
1039
+ }
1040
+ return this.emitError(expression, "MALFORMED_OPEN_TAG", `EOF reached while parsing attribute value for the ${attr.spread ? "..." : attr.name ? `"${this.read(attr.name)}"` : `"default"`} attribute`);
1041
+ }
1042
+ case states_exports.TAG_NAME:
1043
+ return this.emitError(expression, "MALFORMED_OPEN_TAG", "EOF reached while parsing tag name");
1044
+ case states_exports.PLACEHOLDER:
1045
+ return this.emitError(expression, "MALFORMED_PLACEHOLDER", "EOF reached while parsing placeholder");
1046
+ }
1047
+ return this.emitError(expression, "INVALID_EXPRESSION", "EOF reached while parsing expression");
1048
+ }
1049
+ },
1050
+ return() {
1051
+ }
1052
+ };
1053
+ function buildOperatorPattern(isConcise) {
1054
+ const binary = `[!~*%&^|?:]+|(?<=[!=<>&^~|/*?%+-])=|=(?=[!=<>&^~|/*?%+-])|(?<!\\+)\\s*\\+(?:\\s*\\+\\s*\\+)*\\s*(?!\\+)|(?<!-)${isConcise ? "-" : "\\s*-(?:\\s*-\\s*-)*\\s*"}(?!-)|(?<![/*])/(?![/*${isConcise ? "" : ">"}])|(?<!${isConcise ? "^\\s*|" : ""}\\.)\\.(?!\\.)|<${isConcise ? "{2,}|(?<!^\\s*)<" : "+"}|>${isConcise ? "+" : "{2,}"}|\\bin(?:stanceof)?(?=\\s+[^=/,;:>])`;
1055
+ const unary = "\\b(?:a(?:sync|wait)|class|function|new|typeof|void)\\b";
1056
+ const lookAheadPattern = "\\s*(?:" + binary + `)\\s*|\\s+(?=[${isConcise ? "" : "["}{(])`;
1057
+ const lookBehindPattern = `(?<=${unary}|${binary})`;
1058
+ return new RegExp(`${lookAheadPattern}|${lookBehindPattern}`, "ym");
1059
+ }
1060
+ function checkForOperators(parser, expression) {
1061
+ if (expression.skipOperators) {
1062
+ return false;
1063
+ }
1064
+ const pattern = parser.isConcise ? conciseOperatorPattern : htmlOperatorPattern;
1065
+ pattern.lastIndex = parser.pos;
1066
+ const matches = pattern.exec(parser.data);
1067
+ if (matches) {
1068
+ const [match] = matches;
1069
+ if (match.length === 0) {
1070
+ parser.consumeWhitespace();
1071
+ parser.pos--;
1072
+ } else {
1073
+ parser.pos += match.length - 1;
1074
+ }
1075
+ } else {
1076
+ return false;
1077
+ }
1078
+ return true;
1079
+ }
1080
+ function checkForTerminators(parser, code, terminators) {
1081
+ outer:
1082
+ for (const terminator of terminators) {
1083
+ if (typeof terminator === "number") {
1084
+ if (code === terminator)
1085
+ return true;
1086
+ } else {
1087
+ if (terminator[0] === code) {
1088
+ for (let i = terminator.length; i-- > 1; ) {
1089
+ if (parser.data.charCodeAt(parser.pos + i) !== terminator[i])
1090
+ continue outer;
1091
+ }
1092
+ return true;
1093
+ }
1094
+ }
1095
+ }
1096
+ }
1097
+ function canCharCodeBeFollowedByDivision(code) {
1098
+ return code >= 48 /* NUMBER_0 */ && code <= 57 /* NUMBER_9 */ || code >= 65 /* UPPER_A */ && code <= 90 /* UPPER_Z */ || code >= 97 /* LOWER_A */ && code <= 122 /* LOWER_Z */ || code === 37 /* PERCENT */ || code === 41 /* CLOSE_PAREN */ || code === 46 /* PERIOD */ || code === 60 /* OPEN_ANGLE_BRACKET */ || code === 93 /* CLOSE_SQUARE_BRACKET */ || code === 125 /* CLOSE_CURLY_BRACE */;
1099
+ }
1100
+
1101
+ // src/states/HTML_COMMENT.ts
1102
+ var HTML_COMMENT = {
1103
+ name: "HTML_COMMENT",
1104
+ enter(parent, start) {
1105
+ this.endText();
1106
+ return {
1107
+ state: HTML_COMMENT,
1108
+ parent,
1109
+ start,
1110
+ end: start
1111
+ };
1112
+ },
1113
+ exit(comment) {
1114
+ var _a, _b;
1115
+ (_b = (_a = this.handlers).onComment) == null ? void 0 : _b.call(_a, {
1116
+ start: comment.start,
1117
+ end: comment.end,
1118
+ value: {
1119
+ start: comment.start + 4,
1120
+ end: comment.end - 3
1121
+ }
1122
+ });
1123
+ },
1124
+ char(code) {
1125
+ if (code === 45 /* HYPHEN */) {
1126
+ let offset = 1;
1127
+ let next;
1128
+ while ((next = this.lookAtCharCodeAhead(offset++)) === 45 /* HYPHEN */)
1129
+ ;
1130
+ this.pos += offset;
1131
+ if (next === 62 /* CLOSE_ANGLE_BRACKET */) {
1132
+ this.exitState();
1133
+ }
1134
+ }
1135
+ },
1136
+ eol() {
1137
+ },
1138
+ eof(comment) {
1139
+ this.emitError(comment, "MALFORMED_COMMENT", "EOF reached while parsing comment");
1140
+ },
1141
+ return() {
1142
+ }
1143
+ };
1144
+
1145
+ // src/states/HTML_CONTENT.ts
1146
+ var HTML_CONTENT = {
1147
+ name: "HTML_CONTENT",
1148
+ enter(parent, start) {
1149
+ this.isConcise = false;
1150
+ return {
1151
+ state: HTML_CONTENT,
1152
+ parent,
1153
+ start,
1154
+ end: start,
1155
+ indent: "",
1156
+ singleLine: false,
1157
+ delimiter: void 0
1158
+ };
1159
+ },
1160
+ exit() {
1161
+ },
1162
+ char(code) {
1163
+ if (code === 60 /* OPEN_ANGLE_BRACKET */) {
1164
+ if (states_exports.checkForCDATA(this))
1165
+ return;
1166
+ const nextCode = this.lookAtCharCodeAhead(1);
1167
+ if (nextCode === 33 /* EXCLAMATION */) {
1168
+ if (this.lookAtCharCodeAhead(2) === 45 /* HYPHEN */ && this.lookAtCharCodeAhead(3) === 45 /* HYPHEN */) {
1169
+ this.enterState(states_exports.HTML_COMMENT);
1170
+ this.pos += 3;
1171
+ } else {
1172
+ this.enterState(states_exports.DTD);
1173
+ this.pos++;
1174
+ }
1175
+ } else if (nextCode === 63 /* QUESTION */) {
1176
+ this.enterState(states_exports.DECLARATION);
1177
+ this.pos++;
1178
+ } else if (nextCode === 47 /* FORWARD_SLASH */) {
1179
+ this.enterState(states_exports.CLOSE_TAG);
1180
+ this.pos++;
1181
+ } else if (nextCode === 62 /* CLOSE_ANGLE_BRACKET */ || nextCode === 60 /* OPEN_ANGLE_BRACKET */ || isWhitespaceCode(nextCode)) {
1182
+ this.startText();
1183
+ } else {
1184
+ this.enterState(states_exports.OPEN_TAG);
1185
+ }
1186
+ } else if (code === 36 /* DOLLAR */ && isWhitespaceCode(this.lookAtCharCodeAhead(1)) && isBeginningOfLine(this)) {
1187
+ this.endText();
1188
+ this.enterState(states_exports.INLINE_SCRIPT);
1189
+ this.pos++;
1190
+ } else if (!states_exports.checkForPlaceholder(this, code)) {
1191
+ this.startText();
1192
+ }
1193
+ },
1194
+ eol(len, content) {
1195
+ if (this.beginMixedMode) {
1196
+ this.beginMixedMode = false;
1197
+ this.endText();
1198
+ this.exitState();
1199
+ } else if (this.endingMixedModeAtEOL) {
1200
+ this.endingMixedModeAtEOL = false;
1201
+ this.endText();
1202
+ this.exitState();
1203
+ } else if (!states_exports.handleDelimitedEOL(this, len, content)) {
1204
+ this.startText();
1205
+ }
1206
+ },
1207
+ eof: htmlEOF,
1208
+ return() {
1209
+ }
1210
+ };
1211
+ function isBeginningOfLine(parser) {
1212
+ let pos = parser.pos;
1213
+ do {
1214
+ const code = parser.data.charCodeAt(--pos);
1215
+ if (isWhitespaceCode(code)) {
1216
+ if (code === 10 /* NEWLINE */) {
1217
+ return true;
1218
+ }
1219
+ } else {
1220
+ return false;
1221
+ }
1222
+ } while (pos > 0);
1223
+ return true;
1224
+ }
1225
+
1226
+ // src/states/INLINE_SCRIPT.ts
1227
+ var INLINE_SCRIPT = {
1228
+ name: "INLINE_SCRIPT",
1229
+ enter(parent, start) {
1230
+ this.endText();
1231
+ return {
1232
+ state: INLINE_SCRIPT,
1233
+ parent,
1234
+ start,
1235
+ end: start,
1236
+ block: false,
1237
+ value: {
1238
+ start,
1239
+ end: start
1240
+ }
1241
+ };
1242
+ },
1243
+ exit(inlineScript) {
1244
+ var _a, _b;
1245
+ (_b = (_a = this.handlers).onScriptlet) == null ? void 0 : _b.call(_a, {
1246
+ start: inlineScript.start,
1247
+ end: inlineScript.end,
1248
+ block: inlineScript.block,
1249
+ value: {
1250
+ start: inlineScript.value.start,
1251
+ end: inlineScript.value.end
1252
+ }
1253
+ });
1254
+ },
1255
+ eol() {
1256
+ },
1257
+ eof() {
1258
+ },
1259
+ char(code, inlineScript) {
1260
+ if (code === 123 /* OPEN_CURLY_BRACE */) {
1261
+ inlineScript.block = true;
1262
+ this.pos++;
1263
+ const expr = this.enterState(states_exports.EXPRESSION);
1264
+ expr.terminator = 125 /* CLOSE_CURLY_BRACE */;
1265
+ expr.skipOperators = true;
1266
+ this.pos--;
1267
+ } else {
1268
+ const expr = this.enterState(states_exports.EXPRESSION);
1269
+ expr.terminatedByEOL = true;
1270
+ this.pos--;
1271
+ }
1272
+ },
1273
+ return(child, inlineScript) {
1274
+ if (inlineScript.block)
1275
+ this.pos++;
1276
+ inlineScript.value.start = child.start;
1277
+ inlineScript.value.end = child.end;
1278
+ this.exitState();
1279
+ }
1280
+ };
1281
+
1282
+ // src/states/JS_COMMENT_BLOCK.ts
1283
+ var JS_COMMENT_BLOCK = {
1284
+ name: "JS_COMMENT_BLOCK",
1285
+ enter(parent, start) {
1286
+ return {
1287
+ state: JS_COMMENT_BLOCK,
1288
+ parent,
1289
+ start,
1290
+ end: start
1291
+ };
1292
+ },
1293
+ exit() {
1294
+ },
1295
+ char(code) {
1296
+ if (code === 42 /* ASTERISK */ && this.lookAtCharCodeAhead(1) === 47 /* FORWARD_SLASH */) {
1297
+ this.pos += 2;
1298
+ this.exitState();
1299
+ }
1300
+ },
1301
+ eol() {
1302
+ },
1303
+ eof(comment) {
1304
+ this.emitError(comment, "MALFORMED_COMMENT", "EOF reached while parsing multi-line JavaScript comment");
1305
+ },
1306
+ return() {
1307
+ }
1308
+ };
1309
+
1310
+ // src/states/JS_COMMENT_LINE.ts
1311
+ var JS_COMMENT_LINE = {
1312
+ name: "JS_COMMENT_LINE",
1313
+ enter(parent, start) {
1314
+ return {
1315
+ state: JS_COMMENT_LINE,
1316
+ parent,
1317
+ start,
1318
+ end: start
1319
+ };
1320
+ },
1321
+ exit() {
1322
+ },
1323
+ char(code) {
1324
+ var _a;
1325
+ if (!this.isConcise && code === 60 /* OPEN_ANGLE_BRACKET */ && ((_a = this.activeTag) == null ? void 0 : _a.bodyMode) === 1 /* PARSED_TEXT */) {
1326
+ states_exports.checkForClosingTag(this);
1327
+ }
1328
+ },
1329
+ eol() {
1330
+ this.exitState();
1331
+ },
1332
+ eof() {
1333
+ this.exitState();
1334
+ },
1335
+ return() {
1336
+ }
1337
+ };
1338
+
1339
+ // src/states/PARSED_TEXT_CONTENT.ts
1340
+ var PARSED_TEXT_CONTENT = {
1341
+ name: "PARSED_TEXT_CONTENT",
1342
+ enter(parent, start) {
1343
+ return {
1344
+ state: PARSED_TEXT_CONTENT,
1345
+ parent,
1346
+ start,
1347
+ end: start,
1348
+ indent: "",
1349
+ singleLine: false,
1350
+ delimiter: void 0
1351
+ };
1352
+ },
1353
+ exit() {
1354
+ },
1355
+ char(code) {
1356
+ switch (code) {
1357
+ case 60 /* OPEN_ANGLE_BRACKET */:
1358
+ if (this.isConcise || !(states_exports.checkForClosingTag(this) || states_exports.checkForCDATA(this))) {
1359
+ this.startText();
1360
+ }
1361
+ break;
1362
+ case 47 /* FORWARD_SLASH */:
1363
+ this.startText();
1364
+ switch (this.lookAtCharCodeAhead(1)) {
1365
+ case 42 /* ASTERISK */:
1366
+ this.enterState(states_exports.JS_COMMENT_BLOCK);
1367
+ this.pos++;
1368
+ break;
1369
+ case 47 /* FORWARD_SLASH */:
1370
+ this.enterState(states_exports.JS_COMMENT_LINE);
1371
+ this.pos++;
1372
+ break;
1373
+ }
1374
+ break;
1375
+ case 96 /* BACKTICK */:
1376
+ this.startText();
1377
+ this.enterState(states_exports.TEMPLATE_STRING);
1378
+ break;
1379
+ default:
1380
+ if (!states_exports.checkForPlaceholder(this, code))
1381
+ this.startText();
1382
+ break;
1383
+ }
1384
+ },
1385
+ eol(len, content) {
1386
+ if (!states_exports.handleDelimitedEOL(this, len, content)) {
1387
+ this.startText();
1388
+ }
1389
+ },
1390
+ eof: htmlEOF,
1391
+ return() {
1392
+ }
1393
+ };
1394
+
1395
+ // src/states/PLACEHOLDER.ts
1396
+ var PLACEHOLDER = {
1397
+ name: "PLACEHOLDER",
1398
+ enter(parent, start) {
1399
+ return {
1400
+ state: PLACEHOLDER,
1401
+ parent,
1402
+ start,
1403
+ end: start,
1404
+ escape: false
1405
+ };
1406
+ },
1407
+ exit(placeholder) {
1408
+ var _a, _b;
1409
+ (_b = (_a = this.handlers).onPlaceholder) == null ? void 0 : _b.call(_a, {
1410
+ start: placeholder.start,
1411
+ end: placeholder.end,
1412
+ escape: placeholder.escape,
1413
+ value: {
1414
+ start: placeholder.start + (placeholder.escape ? 2 : 3),
1415
+ end: placeholder.end - 1
1416
+ }
1417
+ });
1418
+ },
1419
+ char() {
1420
+ },
1421
+ eol() {
1422
+ },
1423
+ eof() {
1424
+ },
1425
+ return(child) {
1426
+ if (child.start === child.end) {
1427
+ this.emitError(child, "PLACEHOLDER_EXPRESSION_REQUIRED", "Invalid placeholder, the expression cannot be missing");
1428
+ }
1429
+ this.pos++;
1430
+ this.exitState();
1431
+ }
1432
+ };
1433
+ function checkForPlaceholder(parser, code) {
1434
+ let ahead = 0;
1435
+ let curCode = code;
1436
+ while (curCode === 92 /* BACK_SLASH */) {
1437
+ curCode = parser.lookAtCharCodeAhead(++ahead);
1438
+ }
1439
+ if (curCode === 36 /* DOLLAR */) {
1440
+ let escape = true;
1441
+ curCode = parser.lookAtCharCodeAhead(ahead + 1);
1442
+ if (curCode === 33 /* EXCLAMATION */) {
1443
+ escape = false;
1444
+ curCode = parser.lookAtCharCodeAhead(ahead + 2);
1445
+ }
1446
+ if (curCode === 123 /* OPEN_CURLY_BRACE */) {
1447
+ if (ahead) {
1448
+ const remainder = ahead % 2;
1449
+ const extra = (ahead + remainder) / 2;
1450
+ if (remainder) {
1451
+ parser.endText();
1452
+ parser.pos += extra;
1453
+ parser.startText();
1454
+ parser.pos += escape ? 2 : 3;
1455
+ return true;
1456
+ } else {
1457
+ parser.startText();
1458
+ parser.pos += extra;
1459
+ parser.endText();
1460
+ parser.pos += extra;
1461
+ }
1462
+ }
1463
+ parser.endText();
1464
+ parser.enterState(PLACEHOLDER).escape = escape;
1465
+ parser.pos += escape ? 2 : 3;
1466
+ parser.enterState(states_exports.EXPRESSION).terminator = 125 /* CLOSE_CURLY_BRACE */;
1467
+ parser.pos--;
1468
+ return true;
1469
+ }
1470
+ }
1471
+ return false;
1472
+ }
1473
+
1474
+ // src/states/REGULAR_EXPRESSION.ts
1475
+ var REGULAR_EXPRESSION = {
1476
+ name: "REGULAR_EXPRESSION",
1477
+ enter(parent, start) {
1478
+ return {
1479
+ state: REGULAR_EXPRESSION,
1480
+ parent,
1481
+ start,
1482
+ end: start,
1483
+ isInCharSet: false
1484
+ };
1485
+ },
1486
+ exit() {
1487
+ },
1488
+ char(code, regExp) {
1489
+ if (code === 92 /* BACK_SLASH */) {
1490
+ this.pos++;
1491
+ } else if (code === 91 /* OPEN_SQUARE_BRACKET */ && regExp.isInCharSet) {
1492
+ regExp.isInCharSet = true;
1493
+ } else if (code === 93 /* CLOSE_SQUARE_BRACKET */ && regExp.isInCharSet) {
1494
+ regExp.isInCharSet = false;
1495
+ } else if (code === 47 /* FORWARD_SLASH */ && !regExp.isInCharSet) {
1496
+ this.pos++;
1497
+ this.exitState();
1498
+ }
1499
+ },
1500
+ eol(_, regExp) {
1501
+ this.emitError(regExp, "INVALID_REGULAR_EXPRESSION", "EOL reached while parsing regular expression");
1502
+ },
1503
+ eof(regExp) {
1504
+ this.emitError(regExp, "INVALID_REGULAR_EXPRESSION", "EOF reached while parsing regular expression");
1505
+ },
1506
+ return() {
1507
+ }
1508
+ };
1509
+
1510
+ // src/states/STRING.ts
1511
+ var STRING = {
1512
+ name: "STRING",
1513
+ enter(parent, start) {
1514
+ return {
1515
+ state: STRING,
1516
+ parent,
1517
+ start,
1518
+ end: start,
1519
+ quoteCharCode: 34 /* DOUBLE_QUOTE */
1520
+ };
1521
+ },
1522
+ exit() {
1523
+ },
1524
+ char(code, string) {
1525
+ switch (code) {
1526
+ case 92 /* BACK_SLASH */:
1527
+ this.pos++;
1528
+ break;
1529
+ case string.quoteCharCode:
1530
+ this.pos++;
1531
+ this.exitState();
1532
+ break;
1533
+ }
1534
+ },
1535
+ eol() {
1536
+ },
1537
+ eof(string) {
1538
+ this.emitError(string, "INVALID_STRING", "EOF reached while parsing string expression");
1539
+ },
1540
+ return() {
1541
+ }
1542
+ };
1543
+
1544
+ // src/states/TAG_NAME.ts
1545
+ var VOID_TAGS = [
1546
+ "area",
1547
+ "base",
1548
+ "br",
1549
+ "col",
1550
+ "hr",
1551
+ "embed",
1552
+ "img",
1553
+ "input",
1554
+ "link",
1555
+ "meta",
1556
+ "param",
1557
+ "source",
1558
+ "track",
1559
+ "wbr"
1560
+ ];
1561
+ var CODE_TAGS = ["import", "export", "static", "class"];
1562
+ var TAG_NAME = {
1563
+ name: "TAG_NAME",
1564
+ enter(parent, start) {
1565
+ return {
1566
+ state: TAG_NAME,
1567
+ parent,
1568
+ start,
1569
+ end: start,
1570
+ expressions: [],
1571
+ quasis: [{ start, end: start }]
1572
+ };
1573
+ },
1574
+ exit(tagName) {
1575
+ var _a, _b, _c, _d, _e, _f;
1576
+ const { start, end, quasis, expressions } = tagName;
1577
+ const last = quasis[quasis.length - 1];
1578
+ if (last.end < end)
1579
+ last.end = end;
1580
+ switch (tagName.shorthandCode) {
1581
+ case 35 /* NUMBER_SIGN */:
1582
+ if (this.activeTag.hasShorthandId) {
1583
+ return this.emitError(tagName, "INVALID_TAG_SHORTHAND", "Multiple shorthand ID parts are not allowed on the same tag");
1584
+ }
1585
+ this.activeTag.hasShorthandId = true;
1586
+ (_b = (_a = this.handlers).onTagShorthandId) == null ? void 0 : _b.call(_a, {
1587
+ start,
1588
+ end,
1589
+ quasis,
1590
+ expressions
1591
+ });
1592
+ break;
1593
+ case 46 /* PERIOD */:
1594
+ (_d = (_c = this.handlers).onTagShorthandClass) == null ? void 0 : _d.call(_c, {
1595
+ start,
1596
+ end,
1597
+ quasis,
1598
+ expressions
1599
+ });
1600
+ break;
1601
+ default: {
1602
+ const tag = this.activeTag;
1603
+ tag.tagName = tagName;
1604
+ if (tagName.expressions.length === 0) {
1605
+ if (this.matchAnyAtPos(tagName, VOID_TAGS)) {
1606
+ tag.ending |= 2 /* void */;
1607
+ } else if (this.matchAnyAtPos(tagName, CODE_TAGS)) {
1608
+ if (!tag.concise) {
1609
+ return this.emitError(tagName, "RESERVED_TAG_NAME", `The "${this.read(tagName)}" tag is reserved and cannot be used as an HTML tag.`);
1610
+ }
1611
+ if (tag.parentTag) {
1612
+ return this.emitError(tagName, "ROOT_TAG_ONLY", `"${this.read(tagName)}" can only be used at the root of the template.`);
1613
+ }
1614
+ tag.ending |= 4 /* code */;
1615
+ this.enterState(states_exports.EXPRESSION).terminatedByEOL = true;
1616
+ }
1617
+ }
1618
+ (_f = (_e = this.handlers).onTagName) == null ? void 0 : _f.call(_e, {
1619
+ start,
1620
+ end,
1621
+ quasis,
1622
+ expressions,
1623
+ concise: this.isConcise
1624
+ });
1625
+ break;
1626
+ }
1627
+ }
1628
+ },
1629
+ char(code) {
1630
+ if (code === 36 /* DOLLAR */ && this.lookAtCharCodeAhead(1) === 123 /* OPEN_CURLY_BRACE */) {
1631
+ this.pos += 2;
1632
+ this.enterState(states_exports.EXPRESSION).terminator = 125 /* CLOSE_CURLY_BRACE */;
1633
+ this.pos--;
1634
+ } else if (isWhitespaceCode(code) || code === 61 /* EQUAL */ || code === 58 /* COLON */ && this.lookAtCharCodeAhead(1) === 61 /* EQUAL */ || code === 40 /* OPEN_PAREN */ || code === 47 /* FORWARD_SLASH */ || code === 124 /* PIPE */ || (this.isConcise ? code === 59 /* SEMICOLON */ : code === 62 /* CLOSE_ANGLE_BRACKET */)) {
1635
+ this.activeTag.shorthandEnd = this.pos;
1636
+ this.exitState();
1637
+ } else if (code === 46 /* PERIOD */ || code === 35 /* NUMBER_SIGN */) {
1638
+ this.exitState();
1639
+ const shorthand = this.enterState(TAG_NAME);
1640
+ shorthand.shorthandCode = code;
1641
+ shorthand.quasis[0].start = ++this.pos;
1642
+ }
1643
+ },
1644
+ eol() {
1645
+ this.activeTag.shorthandEnd = this.pos;
1646
+ this.exitState();
1647
+ },
1648
+ eof() {
1649
+ this.exitState();
1650
+ },
1651
+ return(child, tagName) {
1652
+ if (child.terminatedByEOL)
1653
+ return;
1654
+ if (child.start === child.end) {
1655
+ this.emitError(child, "PLACEHOLDER_EXPRESSION_REQUIRED", "Invalid placeholder, the expression cannot be missing");
1656
+ }
1657
+ const { quasis, expressions } = tagName;
1658
+ const start = child.start - 2;
1659
+ const end = ++this.pos;
1660
+ const nextStart = end + 1;
1661
+ expressions.push({
1662
+ start,
1663
+ end,
1664
+ value: {
1665
+ start: child.start,
1666
+ end: child.end
1667
+ }
1668
+ });
1669
+ quasis[quasis.length - 1].end = start;
1670
+ quasis.push({ start: nextStart, end: nextStart });
1671
+ }
1672
+ };
1673
+
1674
+ // src/states/TEMPLATE_STRING.ts
1675
+ var TEMPLATE_STRING = {
1676
+ name: "TEMPLATE_STRING",
1677
+ enter(parent, start) {
1678
+ return {
1679
+ state: TEMPLATE_STRING,
1680
+ parent,
1681
+ start,
1682
+ end: start
1683
+ };
1684
+ },
1685
+ exit() {
1686
+ },
1687
+ char(code) {
1688
+ if (code === 36 /* DOLLAR */ && this.lookAtCharCodeAhead(1) === 123 /* OPEN_CURLY_BRACE */) {
1689
+ this.pos++;
1690
+ const expr = this.enterState(states_exports.EXPRESSION);
1691
+ expr.skipOperators = true;
1692
+ expr.terminator = 125 /* CLOSE_CURLY_BRACE */;
1693
+ } else {
1694
+ if (code === 92 /* BACK_SLASH */) {
1695
+ this.pos++;
1696
+ } else if (code === 96 /* BACKTICK */) {
1697
+ this.pos++;
1698
+ this.exitState();
1699
+ }
1700
+ }
1701
+ },
1702
+ eof(templateString) {
1703
+ this.emitError(templateString, "INVALID_TEMPLATE_STRING", "EOF reached while parsing template string expression");
1704
+ },
1705
+ eol() {
1706
+ },
1707
+ return(child) {
1708
+ if (child.start === child.end) {
1709
+ this.emitError(child, "PLACEHOLDER_EXPRESSION_REQUIRED", "Invalid placeholder, the expression cannot be missing");
1710
+ }
1711
+ this.pos++;
1712
+ }
1713
+ };
1714
+
1715
+ // src/states/OPEN_TAG.ts
1716
+ var PARSED_TEXT_TAGS = ["script", "style", "textarea", "html-comment"];
1717
+ var CONCISE_TAG_VAR_TERMINATORS = [
1718
+ 59 /* SEMICOLON */,
1719
+ 40 /* OPEN_PAREN */,
1720
+ 124 /* PIPE */,
1721
+ 61 /* EQUAL */,
1722
+ [58 /* COLON */, 61 /* EQUAL */]
1723
+ ];
1724
+ var HTML_TAG_VAR_TERMINATORS = [
1725
+ 62 /* CLOSE_ANGLE_BRACKET */,
1726
+ 40 /* OPEN_PAREN */,
1727
+ 124 /* PIPE */,
1728
+ 61 /* EQUAL */,
1729
+ [58 /* COLON */, 61 /* EQUAL */],
1730
+ [47 /* FORWARD_SLASH */, 62 /* CLOSE_ANGLE_BRACKET */]
1731
+ ];
1732
+ var OPEN_TAG = {
1733
+ name: "OPEN_TAG",
1734
+ enter(parent, start) {
1735
+ const tag = this.activeTag = {
1736
+ state: OPEN_TAG,
1737
+ parent,
1738
+ start,
1739
+ end: start,
1740
+ stage: 0 /* UNKNOWN */,
1741
+ parentTag: this.activeTag,
1742
+ nestedIndent: void 0,
1743
+ indent: this.indent,
1744
+ hasShorthandId: false,
1745
+ hasArgs: false,
1746
+ hasAttrs: false,
1747
+ shorthandEnd: -1,
1748
+ tagName: void 0,
1749
+ ending: 0 /* tag */,
1750
+ concise: this.isConcise,
1751
+ bodyMode: 0 /* HTML */,
1752
+ beginMixedMode: this.beginMixedMode || this.endingMixedModeAtEOL
1753
+ };
1754
+ this.beginMixedMode = false;
1755
+ this.endingMixedModeAtEOL = false;
1756
+ this.endText();
1757
+ return tag;
1758
+ },
1759
+ exit(tag) {
1760
+ var _a, _b;
1761
+ const { tagName, ending } = tag;
1762
+ (_b = (_a = this.handlers).onOpenTagEnd) == null ? void 0 : _b.call(_a, {
1763
+ start: this.pos - (this.isConcise ? 0 : ending & 1 /* self */ ? 2 : 1),
1764
+ end: this.pos,
1765
+ ending
1766
+ });
1767
+ if (!this.isConcise && ending !== 0 /* tag */) {
1768
+ this.closeTag(this.pos, this.pos, void 0);
1769
+ } else if (tagName.expressions.length === 0 && this.matchAnyAtPos(tagName, PARSED_TEXT_TAGS)) {
1770
+ tag.bodyMode = 1 /* PARSED_TEXT */;
1771
+ if (this.isConcise) {
1772
+ this.enterState(states_exports.CONCISE_HTML_CONTENT);
1773
+ } else {
1774
+ this.enterState(states_exports.PARSED_TEXT_CONTENT);
1775
+ }
1776
+ }
1777
+ },
1778
+ eol(_, tag) {
1779
+ if (this.isConcise && tag.stage !== 4 /* ATTR_GROUP */) {
1780
+ this.exitState();
1781
+ }
1782
+ },
1783
+ eof(tag) {
1784
+ if (this.isConcise) {
1785
+ if (tag.stage === 4 /* ATTR_GROUP */) {
1786
+ this.emitError(tag, "MALFORMED_OPEN_TAG", 'EOF reached while within an attribute group (e.g. "[ ... ]").');
1787
+ return;
1788
+ }
1789
+ this.exitState();
1790
+ } else {
1791
+ this.emitError(tag, "MALFORMED_OPEN_TAG", "EOF reached while parsing open tag");
1792
+ }
1793
+ },
1794
+ char(code, tag) {
1795
+ if (this.isConcise) {
1796
+ if (code === 59 /* SEMICOLON */) {
1797
+ this.pos++;
1798
+ this.exitState();
1799
+ if (!this.consumeWhitespaceOnLine(0)) {
1800
+ switch (this.lookAtCharCodeAhead(0)) {
1801
+ case 47 /* FORWARD_SLASH */:
1802
+ switch (this.lookAtCharCodeAhead(1)) {
1803
+ case 47 /* FORWARD_SLASH */:
1804
+ this.enterState(states_exports.JS_COMMENT_LINE);
1805
+ this.pos += 2;
1806
+ return;
1807
+ case 42 /* ASTERISK */:
1808
+ this.enterState(states_exports.JS_COMMENT_BLOCK);
1809
+ this.pos += 2;
1810
+ return;
1811
+ }
1812
+ break;
1813
+ case 60 /* OPEN_ANGLE_BRACKET */:
1814
+ if (this.lookAheadFor("!--")) {
1815
+ this.enterState(states_exports.HTML_COMMENT);
1816
+ this.pos += 4;
1817
+ return;
1818
+ }
1819
+ break;
1820
+ }
1821
+ this.emitError(this.pos, "INVALID_CODE_AFTER_SEMICOLON", "A semicolon indicates the end of a line. Only comments may follow it.");
1822
+ }
1823
+ return;
1824
+ }
1825
+ if (code === 45 /* HTML_BLOCK_DELIMITER */) {
1826
+ if (this.lookAtCharCodeAhead(1) !== 45 /* HTML_BLOCK_DELIMITER */) {
1827
+ this.emitError(tag, "MALFORMED_OPEN_TAG", '"-" not allowed as first character of attribute name');
1828
+ return;
1829
+ }
1830
+ if (tag.stage === 4 /* ATTR_GROUP */) {
1831
+ this.emitError(this.pos, "MALFORMED_OPEN_TAG", "Attribute group was not properly ended");
1832
+ return;
1833
+ }
1834
+ this.exitState();
1835
+ const maxPos = this.maxPos;
1836
+ let curPos = this.pos + 1;
1837
+ while (curPos < maxPos && this.data.charCodeAt(++curPos) !== 10 /* NEWLINE */)
1838
+ ;
1839
+ const indentStart = ++curPos;
1840
+ while (curPos < maxPos) {
1841
+ const nextCode = this.data.charCodeAt(curPos);
1842
+ if (nextCode === 32 /* SPACE */ || nextCode === 9 /* TAB */) {
1843
+ curPos++;
1844
+ } else {
1845
+ break;
1846
+ }
1847
+ }
1848
+ const indentSize = curPos - indentStart;
1849
+ if (indentSize > this.indent.length) {
1850
+ this.indent = this.data.slice(indentStart, curPos);
1851
+ }
1852
+ this.enterState(states_exports.BEGIN_DELIMITED_HTML_BLOCK);
1853
+ return;
1854
+ } else if (code === 91 /* OPEN_SQUARE_BRACKET */) {
1855
+ if (tag.stage === 4 /* ATTR_GROUP */) {
1856
+ this.emitError(this.pos, "MALFORMED_OPEN_TAG", 'Unexpected "[" character within open tag.');
1857
+ return;
1858
+ }
1859
+ tag.stage = 4 /* ATTR_GROUP */;
1860
+ return;
1861
+ } else if (code === 93 /* CLOSE_SQUARE_BRACKET */) {
1862
+ if (tag.stage !== 4 /* ATTR_GROUP */) {
1863
+ this.emitError(this.pos, "MALFORMED_OPEN_TAG", 'Unexpected "]" character within open tag.');
1864
+ return;
1865
+ }
1866
+ tag.stage = 0 /* UNKNOWN */;
1867
+ return;
1868
+ }
1869
+ } else if (code === 62 /* CLOSE_ANGLE_BRACKET */) {
1870
+ this.pos++;
1871
+ this.exitState();
1872
+ return;
1873
+ } else if (code === 47 /* FORWARD_SLASH */ && this.lookAtCharCodeAhead(1) === 62 /* CLOSE_ANGLE_BRACKET */) {
1874
+ tag.ending |= 1 /* self */;
1875
+ this.pos += 2;
1876
+ this.exitState();
1877
+ return;
1878
+ }
1879
+ if (code === 60 /* OPEN_ANGLE_BRACKET */) {
1880
+ return this.emitError(this.pos, "ILLEGAL_ATTRIBUTE_NAME", 'Invalid attribute name. Attribute name cannot begin with the "<" character.');
1881
+ }
1882
+ if (code === 47 /* FORWARD_SLASH */ && this.lookAtCharCodeAhead(1) === 42 /* ASTERISK */) {
1883
+ this.enterState(states_exports.JS_COMMENT_BLOCK);
1884
+ this.pos++;
1885
+ return;
1886
+ }
1887
+ if (isWhitespaceCode(code)) {
1888
+ } else if (code === 44 /* COMMA */) {
1889
+ this.pos++;
1890
+ this.consumeWhitespace();
1891
+ this.pos--;
1892
+ } else if (code === 47 /* FORWARD_SLASH */ && !tag.hasAttrs) {
1893
+ tag.stage = 1 /* VAR */;
1894
+ this.pos++;
1895
+ const expr = this.enterState(states_exports.EXPRESSION);
1896
+ expr.skipOperators = true;
1897
+ expr.terminatedByWhitespace = true;
1898
+ expr.terminator = this.isConcise ? CONCISE_TAG_VAR_TERMINATORS : HTML_TAG_VAR_TERMINATORS;
1899
+ this.pos--;
1900
+ } else if (code === 40 /* OPEN_PAREN */ && !tag.hasAttrs) {
1901
+ if (tag.hasArgs) {
1902
+ this.emitError(this.pos, "ILLEGAL_TAG_ARGUMENT", "A tag can only have one argument");
1903
+ return;
1904
+ }
1905
+ tag.stage = 2 /* ARGUMENT */;
1906
+ this.pos++;
1907
+ const expr = this.enterState(states_exports.EXPRESSION);
1908
+ expr.skipOperators = true;
1909
+ expr.terminator = 41 /* CLOSE_PAREN */;
1910
+ this.pos--;
1911
+ } else if (code === 124 /* PIPE */ && !tag.hasAttrs) {
1912
+ tag.stage = 3 /* PARAMS */;
1913
+ this.pos++;
1914
+ const expr = this.enterState(states_exports.EXPRESSION);
1915
+ expr.skipOperators = true;
1916
+ expr.terminator = 124 /* PIPE */;
1917
+ this.pos--;
1918
+ } else {
1919
+ if (tag.tagName) {
1920
+ this.enterState(states_exports.ATTRIBUTE);
1921
+ tag.hasAttrs = true;
1922
+ } else {
1923
+ this.enterState(states_exports.TAG_NAME);
1924
+ }
1925
+ this.pos--;
1926
+ }
1927
+ },
1928
+ return(child, tag) {
1929
+ var _a, _b, _c, _d, _e, _f;
1930
+ switch (child.state) {
1931
+ case states_exports.JS_COMMENT_BLOCK: {
1932
+ break;
1933
+ }
1934
+ case states_exports.EXPRESSION: {
1935
+ switch (tag.stage) {
1936
+ case 1 /* VAR */: {
1937
+ if (child.start === child.end) {
1938
+ return this.emitError(child, "MISSING_TAG_VARIABLE", "A slash was found that was not followed by a variable name or lhs expression");
1939
+ }
1940
+ (_b = (_a = this.handlers).onTagVar) == null ? void 0 : _b.call(_a, {
1941
+ start: child.start - 1,
1942
+ end: child.end,
1943
+ value: {
1944
+ start: child.start,
1945
+ end: child.end
1946
+ }
1947
+ });
1948
+ break;
1949
+ }
1950
+ case 2 /* ARGUMENT */: {
1951
+ const start = child.start - 1;
1952
+ const end = ++this.pos;
1953
+ const value = {
1954
+ start: child.start,
1955
+ end: child.end
1956
+ };
1957
+ if (this.consumeWhitespaceIfBefore("{")) {
1958
+ const attr = this.enterState(states_exports.ATTRIBUTE);
1959
+ attr.start = start;
1960
+ attr.args = { start, end, value };
1961
+ tag.hasAttrs = true;
1962
+ this.pos--;
1963
+ } else {
1964
+ tag.hasArgs = true;
1965
+ (_d = (_c = this.handlers).onTagArgs) == null ? void 0 : _d.call(_c, {
1966
+ start,
1967
+ end,
1968
+ value
1969
+ });
1970
+ }
1971
+ break;
1972
+ }
1973
+ case 3 /* PARAMS */: {
1974
+ const end = ++this.pos;
1975
+ (_f = (_e = this.handlers).onTagParams) == null ? void 0 : _f.call(_e, {
1976
+ start: child.start - 1,
1977
+ end,
1978
+ value: {
1979
+ start: child.start,
1980
+ end: child.end
1981
+ }
1982
+ });
1983
+ break;
1984
+ }
1985
+ }
1986
+ break;
1987
+ }
1988
+ }
1989
+ }
1990
+ };
1991
+
1992
+ // src/index.ts
1993
+ function createParser(handlers) {
1994
+ const parser = new Parser(handlers);
1995
+ return {
1996
+ parse(code) {
1997
+ return parser.parse(code);
1998
+ },
1999
+ read(range) {
2000
+ return parser.read(range);
2001
+ },
2002
+ positionAt(index) {
2003
+ return parser.positionAt(index);
2004
+ },
2005
+ locationAt(range) {
2006
+ return parser.locationAt(range);
2007
+ }
2008
+ };
2009
+ }
2010
+ export {
2011
+ OpenTagEnding,
2012
+ createParser
2013
+ };