html-validate 10.0.0 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.52.10"
8
+ "packageVersion": "7.52.15"
9
9
  }
10
10
  ]
11
11
  }
package/dist/esm/core.js CHANGED
@@ -1508,6 +1508,7 @@ var State = /* @__PURE__ */ ((State2) => {
1508
1508
  State2[State2["CDATA"] = 6] = "CDATA";
1509
1509
  State2[State2["SCRIPT"] = 7] = "SCRIPT";
1510
1510
  State2[State2["STYLE"] = 8] = "STYLE";
1511
+ State2[State2["TEXTAREA"] = 9] = "TEXTAREA";
1511
1512
  return State2;
1512
1513
  })(State || {});
1513
1514
 
@@ -1515,6 +1516,7 @@ var ContentModel = /* @__PURE__ */ ((ContentModel2) => {
1515
1516
  ContentModel2[ContentModel2["TEXT"] = 1] = "TEXT";
1516
1517
  ContentModel2[ContentModel2["SCRIPT"] = 2] = "SCRIPT";
1517
1518
  ContentModel2[ContentModel2["STYLE"] = 3] = "STYLE";
1519
+ ContentModel2[ContentModel2["TEXTAREA"] = 4] = "TEXTAREA";
1518
1520
  return ContentModel2;
1519
1521
  })(ContentModel || {});
1520
1522
  class Context {
@@ -4693,6 +4695,8 @@ const MATCH_SCRIPT_DATA = /^[^]*?(?=<\/script)/;
4693
4695
  const MATCH_SCRIPT_END = /^<(\/)(script)/;
4694
4696
  const MATCH_STYLE_DATA = /^[^]*?(?=<\/style)/;
4695
4697
  const MATCH_STYLE_END = /^<(\/)(style)/;
4698
+ const MATCH_TEXTAREA_DATA = /^[^]*?(?=<\/textarea)/;
4699
+ const MATCH_TEXTAREA_END = /^<(\/)(textarea)/;
4696
4700
  const MATCH_DIRECTIVE = /^(<!--\s*\[html-validate-)([a-z0-9-]+)(\s*)(.*?)(]?\s*-->)/;
4697
4701
  const MATCH_COMMENT = /^<!--([^]*?)-->/;
4698
4702
  const MATCH_CONDITIONAL = /^<!\[([^\]]*?)\]>/;
@@ -4735,6 +4739,9 @@ class Lexer {
4735
4739
  case State.STYLE:
4736
4740
  yield* this.tokenizeStyle(context);
4737
4741
  break;
4742
+ case State.TEXTAREA:
4743
+ yield* this.tokenizeTextarea(context);
4744
+ break;
4738
4745
  /* istanbul ignore next: sanity check: should not happen unless adding new states */
4739
4746
  default:
4740
4747
  this.unhandled(context);
@@ -4807,6 +4814,8 @@ class Lexer {
4807
4814
  context.contentModel = ContentModel.SCRIPT;
4808
4815
  } else if (data[0] === "<style") {
4809
4816
  context.contentModel = ContentModel.STYLE;
4817
+ } else if (data[0] === "<textarea") {
4818
+ context.contentModel = ContentModel.TEXTAREA;
4810
4819
  } else {
4811
4820
  context.contentModel = ContentModel.TEXT;
4812
4821
  }
@@ -4842,21 +4851,28 @@ class Lexer {
4842
4851
  *tokenizeTag(context) {
4843
4852
  function nextState(token) {
4844
4853
  const tagCloseToken = token;
4854
+ const selfClosed = tagCloseToken && !tagCloseToken.data[0].startsWith("/");
4845
4855
  switch (context.contentModel) {
4846
4856
  case ContentModel.TEXT:
4847
4857
  return State.TEXT;
4848
4858
  case ContentModel.SCRIPT:
4849
- if (tagCloseToken && !tagCloseToken.data[0].startsWith("/")) {
4859
+ if (selfClosed) {
4850
4860
  return State.SCRIPT;
4851
4861
  } else {
4852
4862
  return State.TEXT;
4853
4863
  }
4854
4864
  case ContentModel.STYLE:
4855
- if (tagCloseToken && !tagCloseToken.data[0].startsWith("/")) {
4865
+ if (selfClosed) {
4856
4866
  return State.STYLE;
4857
4867
  } else {
4858
4868
  return State.TEXT;
4859
4869
  }
4870
+ case ContentModel.TEXTAREA:
4871
+ if (selfClosed) {
4872
+ return State.TEXTAREA;
4873
+ } else {
4874
+ return State.TEXT;
4875
+ }
4860
4876
  }
4861
4877
  }
4862
4878
  yield* this.match(
@@ -4921,6 +4937,16 @@ class Lexer {
4921
4937
  "expected </style>"
4922
4938
  );
4923
4939
  }
4940
+ *tokenizeTextarea(context) {
4941
+ yield* this.match(
4942
+ context,
4943
+ [
4944
+ [MATCH_TEXTAREA_END, State.TAG, TokenType.TAG_OPEN],
4945
+ [MATCH_TEXTAREA_DATA, State.TEXTAREA, TokenType.TEXT]
4946
+ ],
4947
+ "expected </textarea>"
4948
+ );
4949
+ }
4924
4950
  }
4925
4951
 
4926
4952
  const whitespace = /(\s+)/;
@@ -8142,6 +8168,9 @@ class NoRawCharacters extends Rule {
8142
8168
  setup() {
8143
8169
  this.on("element:ready", (event) => {
8144
8170
  const node = event.target;
8171
+ if (node.matches("script, style")) {
8172
+ return;
8173
+ }
8145
8174
  for (const child of node.childNodes) {
8146
8175
  if (child.nodeType !== NodeType.TEXT_NODE) {
8147
8176
  continue;
@@ -11794,7 +11823,7 @@ class EventHandler {
11794
11823
  }
11795
11824
 
11796
11825
  const name = "html-validate";
11797
- const version = "10.0.0";
11826
+ const version = "10.1.0";
11798
11827
  const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
11799
11828
 
11800
11829
  function freeze(src) {
@@ -12098,6 +12127,8 @@ class Parser {
12098
12127
  break;
12099
12128
  case TokenType.TEXT:
12100
12129
  case TokenType.TEMPLATING:
12130
+ case TokenType.SCRIPT:
12131
+ case TokenType.STYLE:
12101
12132
  this.appendText(token.data[0], token.location);
12102
12133
  break;
12103
12134
  case TokenType.EOF:
@@ -14191,7 +14222,7 @@ var ignoreExports = /*@__PURE__*/ requireIgnore();
14191
14222
  var ignore = /*@__PURE__*/getDefaultExportFromCjs(ignoreExports);
14192
14223
 
14193
14224
  const engines = {
14194
- node: ">= 20.6.0"
14225
+ node: "^20.19.0 || >= 22.12.0"
14195
14226
  };
14196
14227
 
14197
14228
  var workerPath = "./jest-worker.js";