html-validate 10.11.3 → 10.12.1

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 (46) hide show
  1. package/dist/cjs/cli.js +1 -1
  2. package/dist/cjs/cli.js.map +1 -1
  3. package/dist/cjs/core-browser.js +4 -4
  4. package/dist/cjs/core-browser.js.map +1 -1
  5. package/dist/cjs/core-nodejs.js +19 -19
  6. package/dist/cjs/core-nodejs.js.map +1 -1
  7. package/dist/cjs/core.js +177 -170
  8. package/dist/cjs/core.js.map +1 -1
  9. package/dist/cjs/html-validate.js.map +1 -1
  10. package/dist/cjs/jest-diff.js.map +1 -1
  11. package/dist/cjs/jest.js +7 -6
  12. package/dist/cjs/jest.js.map +1 -1
  13. package/dist/cjs/matcher-utils.js +36 -0
  14. package/dist/cjs/matcher-utils.js.map +1 -1
  15. package/dist/cjs/matchers-jestonly.js +17 -39
  16. package/dist/cjs/matchers-jestonly.js.map +1 -1
  17. package/dist/cjs/matchers.js +14 -8
  18. package/dist/cjs/matchers.js.map +1 -1
  19. package/dist/cjs/tsdoc-metadata.json +1 -1
  20. package/dist/cjs/vitest.js +3 -3
  21. package/dist/esm/cli.js +1 -1
  22. package/dist/esm/cli.js.map +1 -1
  23. package/dist/esm/core-browser.js +4 -4
  24. package/dist/esm/core-browser.js.map +1 -1
  25. package/dist/esm/core-nodejs.js +19 -19
  26. package/dist/esm/core-nodejs.js.map +1 -1
  27. package/dist/esm/core.js +175 -170
  28. package/dist/esm/core.js.map +1 -1
  29. package/dist/esm/html-validate.js +1 -1
  30. package/dist/esm/html-validate.js.map +1 -1
  31. package/dist/esm/jest-diff.js.map +1 -1
  32. package/dist/esm/jest.js +3 -2
  33. package/dist/esm/jest.js.map +1 -1
  34. package/dist/esm/matcher-utils.js +36 -1
  35. package/dist/esm/matcher-utils.js.map +1 -1
  36. package/dist/esm/matchers-jestonly.js +18 -36
  37. package/dist/esm/matchers-jestonly.js.map +1 -1
  38. package/dist/esm/matchers.js +15 -9
  39. package/dist/esm/matchers.js.map +1 -1
  40. package/dist/esm/vitest.js +3 -3
  41. package/dist/tsdoc-metadata.json +1 -1
  42. package/dist/types/browser.d.ts +2 -2
  43. package/dist/types/index.d.ts +2 -2
  44. package/dist/types/jest.d.ts +4 -4
  45. package/dist/types/vitest.d.ts +1 -1
  46. package/package.json +7 -3
package/dist/cjs/core.js CHANGED
@@ -1164,8 +1164,12 @@ const dynamicKeys = [
1164
1164
  "submitButton"
1165
1165
  ];
1166
1166
  const schemaCache = /* @__PURE__ */ new Map();
1167
- function clone(src) {
1168
- return JSON.parse(JSON.stringify(src));
1167
+ function clone(value) {
1168
+ if (globalThis.structuredClone) {
1169
+ return globalThis.structuredClone(value);
1170
+ } else {
1171
+ return JSON.parse(JSON.stringify(value));
1172
+ }
1169
1173
  }
1170
1174
  function overwriteMerge$1(_a, b) {
1171
1175
  return b;
@@ -1530,82 +1534,6 @@ function sliceLocation(location, begin, end, wrap) {
1530
1534
  return sliced;
1531
1535
  }
1532
1536
 
1533
- var State = /* @__PURE__ */ ((State2) => {
1534
- State2[State2["INITIAL"] = 1] = "INITIAL";
1535
- State2[State2["DOCTYPE"] = 2] = "DOCTYPE";
1536
- State2[State2["TEXT"] = 3] = "TEXT";
1537
- State2[State2["TAG"] = 4] = "TAG";
1538
- State2[State2["ATTR"] = 5] = "ATTR";
1539
- State2[State2["CDATA"] = 6] = "CDATA";
1540
- State2[State2["SCRIPT"] = 7] = "SCRIPT";
1541
- State2[State2["STYLE"] = 8] = "STYLE";
1542
- State2[State2["TEXTAREA"] = 9] = "TEXTAREA";
1543
- State2[State2["TITLE"] = 10] = "TITLE";
1544
- return State2;
1545
- })(State || {});
1546
-
1547
- var ContentModel = /* @__PURE__ */ ((ContentModel2) => {
1548
- ContentModel2[ContentModel2["TEXT"] = 1] = "TEXT";
1549
- ContentModel2[ContentModel2["SCRIPT"] = 2] = "SCRIPT";
1550
- ContentModel2[ContentModel2["STYLE"] = 3] = "STYLE";
1551
- ContentModel2[ContentModel2["TEXTAREA"] = 4] = "TEXTAREA";
1552
- ContentModel2[ContentModel2["TITLE"] = 5] = "TITLE";
1553
- return ContentModel2;
1554
- })(ContentModel || {});
1555
- class Context {
1556
- contentModel;
1557
- state;
1558
- string;
1559
- filename;
1560
- offset;
1561
- line;
1562
- column;
1563
- constructor(source) {
1564
- this.state = State.INITIAL;
1565
- this.string = source.data;
1566
- this.filename = source.filename;
1567
- this.offset = source.offset;
1568
- this.line = source.line;
1569
- this.column = source.column;
1570
- this.contentModel = 1 /* TEXT */;
1571
- }
1572
- getTruncatedLine(n = 13) {
1573
- return JSON.stringify(this.string.length > n ? `${this.string.slice(0, 10)}...` : this.string);
1574
- }
1575
- consume(n, state) {
1576
- let consumed = this.string.slice(0, n);
1577
- let offset;
1578
- while ((offset = consumed.indexOf("\n")) >= 0) {
1579
- this.line++;
1580
- this.column = 1;
1581
- consumed = consumed.slice(offset + 1);
1582
- }
1583
- this.column += consumed.length;
1584
- this.offset += n;
1585
- this.string = this.string.slice(n);
1586
- this.state = state;
1587
- }
1588
- getLocation(size) {
1589
- return {
1590
- filename: this.filename,
1591
- offset: this.offset,
1592
- line: this.line,
1593
- column: this.column,
1594
- size
1595
- };
1596
- }
1597
- }
1598
-
1599
- function normalizeSource(source) {
1600
- return {
1601
- filename: "",
1602
- offset: 0,
1603
- line: 1,
1604
- column: 1,
1605
- ...source
1606
- };
1607
- }
1608
-
1609
1537
  var NodeType = /* @__PURE__ */ ((NodeType2) => {
1610
1538
  NodeType2[NodeType2["ELEMENT_NODE"] = 1] = "ELEMENT_NODE";
1611
1539
  NodeType2[NodeType2["TEXT_NODE"] = 3] = "TEXT_NODE";
@@ -1890,7 +1818,7 @@ class DOMTokenList extends Array {
1890
1818
  locations;
1891
1819
  constructor(value, location) {
1892
1820
  if (value && typeof value === "string") {
1893
- const normalized = value.replaceAll(/[\t\r\n]/g, " ");
1821
+ const normalized = value.replaceAll(/[\t\n\r]/g, " ");
1894
1822
  const { tokens, locations } = parse(normalized, location);
1895
1823
  super(...tokens);
1896
1824
  this.locations = locations;
@@ -2035,7 +1963,7 @@ class AttributeCondition extends Condition {
2035
1963
  value;
2036
1964
  constructor(attr) {
2037
1965
  super();
2038
- const [, key, op, value] = /^(.+?)(?:([~^$*|]?=)"([^"]+?)")?$/.exec(attr);
1966
+ const [, key, op, value] = /^(.+?)(?:([$*^|~]?=)"([^"]+?)")?$/.exec(attr);
2039
1967
  this.key = key;
2040
1968
  this.op = op;
2041
1969
  this.value = typeof value === "string" ? stripslashes(value) : value;
@@ -2075,10 +2003,10 @@ class PseudoClassCondition extends Condition {
2075
2003
  }
2076
2004
 
2077
2005
  function isDelimiter(ch) {
2078
- return /[.#[:]/.test(ch);
2006
+ return /[#.:[]/.test(ch);
2079
2007
  }
2080
2008
  function isQuotationMark(ch) {
2081
- return /['"]/.test(ch);
2009
+ return /["']/.test(ch);
2082
2010
  }
2083
2011
  function isPseudoElement(ch, buffer) {
2084
2012
  return ch === ":" && buffer === ":";
@@ -2130,7 +2058,7 @@ class Compound {
2130
2058
  selector;
2131
2059
  conditions;
2132
2060
  constructor(pattern) {
2133
- const match = /^([~+\->]?)((?:[*]|[^.#[:]+)?)([^]*)$/.exec(pattern);
2061
+ const match = /^([+>~-]?)((?:\*|[^#.:[]+)?)([^]*)$/.exec(pattern);
2134
2062
  if (!match) {
2135
2063
  throw new Error(`Failed to create selector pattern from "${pattern}"`);
2136
2064
  }
@@ -2277,7 +2205,7 @@ function unescapeCodepoint(value) {
2277
2205
  "\\d ": "\r"
2278
2206
  };
2279
2207
  return value.replaceAll(
2280
- /(\\[\u0039\u0061\u0064] )/g,
2208
+ /(\\[9ad] )/g,
2281
2209
  (_, codepoint) => replacement[codepoint]
2282
2210
  );
2283
2211
  }
@@ -2287,7 +2215,7 @@ function escapeSelectorComponent(text) {
2287
2215
  "\n": "\\a ",
2288
2216
  "\r": "\\d "
2289
2217
  };
2290
- return text.toString().replaceAll(/([\t\n\r]|[^a-z0-9_-])/gi, (_, ch) => {
2218
+ return text.toString().replaceAll(/([\t\n\r]|[^\w-])/gi, (_, ch) => {
2291
2219
  if (codepoints[ch]) {
2292
2220
  return codepoints[ch];
2293
2221
  } else {
@@ -2336,7 +2264,7 @@ class Selector {
2336
2264
  }
2337
2265
  }
2338
2266
  static parse(selector) {
2339
- selector = selector.replaceAll(/([+~>]) /g, "$1");
2267
+ selector = selector.replaceAll(/([+>~]) /g, "$1");
2340
2268
  return Array.from(splitSelectorElements(selector), (element) => {
2341
2269
  return new Compound(unescapeCodepoint(element));
2342
2270
  });
@@ -3138,7 +3066,7 @@ class Validator {
3138
3066
  if (typeof rule !== "string") {
3139
3067
  return false;
3140
3068
  }
3141
- const [, category, quantifier] = /^(@?.*?)([?*]?)$/.exec(rule);
3069
+ const [, category, quantifier] = /^(@?.*?)([*?]?)$/.exec(rule);
3142
3070
  const limit = category && quantifier && parseQuantifier(quantifier);
3143
3071
  if (limit) {
3144
3072
  const siblings = children.filter(
@@ -3306,7 +3234,7 @@ class Validator {
3306
3234
  */
3307
3235
  /* eslint-disable-next-line complexity -- rule does not like switch */
3308
3236
  static validatePermittedCategory(node, category, defaultMatch) {
3309
- const [, rawCategory] = /^(@?.*?)([?*]?)$/.exec(category);
3237
+ const [, rawCategory] = /^(@?.*?)([*?]?)$/.exec(category);
3310
3238
  if (!rawCategory.startsWith("@")) {
3311
3239
  return node.matches(rawCategory);
3312
3240
  }
@@ -3447,7 +3375,7 @@ function isInputDisabledImpl(node) {
3447
3375
 
3448
3376
  const patternCache = /* @__PURE__ */ new Map();
3449
3377
  function compileStringPattern(pattern) {
3450
- const regexp = pattern.replaceAll(/[*]+/g, ".+");
3378
+ const regexp = pattern.replaceAll(/\*+/g, ".+");
3451
3379
  return new RegExp(`^${regexp}$`);
3452
3380
  }
3453
3381
  function compileRegExpPattern(pattern) {
@@ -4634,6 +4562,82 @@ class AttrCase extends Rule {
4634
4562
  }
4635
4563
  }
4636
4564
 
4565
+ var State = /* @__PURE__ */ ((State2) => {
4566
+ State2[State2["INITIAL"] = 1] = "INITIAL";
4567
+ State2[State2["DOCTYPE"] = 2] = "DOCTYPE";
4568
+ State2[State2["TEXT"] = 3] = "TEXT";
4569
+ State2[State2["TAG"] = 4] = "TAG";
4570
+ State2[State2["ATTR"] = 5] = "ATTR";
4571
+ State2[State2["CDATA"] = 6] = "CDATA";
4572
+ State2[State2["SCRIPT"] = 7] = "SCRIPT";
4573
+ State2[State2["STYLE"] = 8] = "STYLE";
4574
+ State2[State2["TEXTAREA"] = 9] = "TEXTAREA";
4575
+ State2[State2["TITLE"] = 10] = "TITLE";
4576
+ return State2;
4577
+ })(State || {});
4578
+
4579
+ var ContentModel = /* @__PURE__ */ ((ContentModel2) => {
4580
+ ContentModel2[ContentModel2["TEXT"] = 1] = "TEXT";
4581
+ ContentModel2[ContentModel2["SCRIPT"] = 2] = "SCRIPT";
4582
+ ContentModel2[ContentModel2["STYLE"] = 3] = "STYLE";
4583
+ ContentModel2[ContentModel2["TEXTAREA"] = 4] = "TEXTAREA";
4584
+ ContentModel2[ContentModel2["TITLE"] = 5] = "TITLE";
4585
+ return ContentModel2;
4586
+ })(ContentModel || {});
4587
+ class Context {
4588
+ contentModel;
4589
+ state;
4590
+ string;
4591
+ filename;
4592
+ offset;
4593
+ line;
4594
+ column;
4595
+ constructor(source) {
4596
+ this.state = State.INITIAL;
4597
+ this.string = source.data;
4598
+ this.filename = source.filename;
4599
+ this.offset = source.offset;
4600
+ this.line = source.line;
4601
+ this.column = source.column;
4602
+ this.contentModel = 1 /* TEXT */;
4603
+ }
4604
+ getTruncatedLine(n = 13) {
4605
+ return JSON.stringify(this.string.length > n ? `${this.string.slice(0, 10)}...` : this.string);
4606
+ }
4607
+ consume(n, state) {
4608
+ let consumed = this.string.slice(0, n);
4609
+ let offset;
4610
+ while ((offset = consumed.indexOf("\n")) >= 0) {
4611
+ this.line++;
4612
+ this.column = 1;
4613
+ consumed = consumed.slice(offset + 1);
4614
+ }
4615
+ this.column += consumed.length;
4616
+ this.offset += n;
4617
+ this.string = this.string.slice(n);
4618
+ this.state = state;
4619
+ }
4620
+ getLocation(size) {
4621
+ return {
4622
+ filename: this.filename,
4623
+ offset: this.offset,
4624
+ line: this.line,
4625
+ column: this.column,
4626
+ size
4627
+ };
4628
+ }
4629
+ }
4630
+
4631
+ function normalizeSource(source) {
4632
+ return {
4633
+ filename: "",
4634
+ offset: 0,
4635
+ line: 1,
4636
+ column: 1,
4637
+ ...source
4638
+ };
4639
+ }
4640
+
4637
4641
  var TokenType = /* @__PURE__ */ ((TokenType2) => {
4638
4642
  TokenType2[TokenType2["UNICODE_BOM"] = 1] = "UNICODE_BOM";
4639
4643
  TokenType2[TokenType2["WHITESPACE"] = 2] = "WHITESPACE";
@@ -4656,20 +4660,20 @@ var TokenType = /* @__PURE__ */ ((TokenType2) => {
4656
4660
  })(TokenType || {});
4657
4661
 
4658
4662
  const MATCH_UNICODE_BOM = /^\uFEFF/;
4659
- const MATCH_WHITESPACE = /^(?:\r\n|\r|\n|[ \t]+(?:\r\n|\r|\n)?)/;
4660
- const MATCH_DOCTYPE_OPEN = /^<!(DOCTYPE)\s/i;
4663
+ const MATCH_WHITESPACE = /^(?:\r\n|\r|\n|[\t ]+(?:\r\n|\r|\n)?)/;
4664
+ const MATCH_DOCTYPE_OPEN = /^<!(doctype)\s/i;
4661
4665
  const MATCH_DOCTYPE_VALUE = /^[^>]+/;
4662
4666
  const MATCH_DOCTYPE_CLOSE = /^>/;
4663
4667
  const MATCH_XML_TAG = /^<\?xml.*?\?>\s+/;
4664
- const MATCH_TAG_OPEN = /^<(\/?)([a-zA-Z0-9\-_:]+)/;
4668
+ const MATCH_TAG_OPEN = /^<(\/?)([\w:\-]+)/;
4665
4669
  const MATCH_TAG_CLOSE = /^\/?>/;
4666
- const MATCH_TEXT = /^[^]*?(?=(?:[ \t]*(?:\r\n|\r|\n)|<[^ ]|$))/;
4670
+ const MATCH_TEXT = /^[^]*?(?=(?:[\t ]*(?:\r\n|\r|\n)|<[^ ]|$))/;
4667
4671
  const MATCH_TEMPLATING = /^(?:<%.*?%>|<\?.*?\?>|<\$.*?\$>)/s;
4668
4672
  const MATCH_TAG_LOOKAHEAD = /^[^]*?(?=<|$)/;
4669
- const MATCH_ATTR_START = /^([^\t\r\n\f \/><"'=]+)/;
4673
+ const MATCH_ATTR_START = /^([^\t\n\f\r "'/<=>]+)/;
4670
4674
  const MATCH_ATTR_SINGLE = /^(\s*=\s*)'([^']*?)(')/;
4671
4675
  const MATCH_ATTR_DOUBLE = /^(\s*=\s*)"([^"]*?)(")/;
4672
- const MATCH_ATTR_UNQUOTED = /^(\s*=\s*)([^\t\r\n\f "'<>][^\t\r\n\f <>]*)/;
4676
+ const MATCH_ATTR_UNQUOTED = /^(\s*=\s*)([^\t\n\f\r "'<>][^\t\n\f\r <>]*)/;
4673
4677
  const MATCH_CDATA_BEGIN = /^<!\[CDATA\[/;
4674
4678
  const MATCH_CDATA_END = /^[^]*?]]>/;
4675
4679
  const MATCH_SCRIPT_DATA = /^[^]*?(?=<\/script)/;
@@ -4680,9 +4684,9 @@ const MATCH_TEXTAREA_DATA = /^[^]*?(?=<\/textarea)/;
4680
4684
  const MATCH_TEXTAREA_END = /^<(\/)(textarea)/;
4681
4685
  const MATCH_TITLE_DATA = /^[^]*?(?=<\/title)/;
4682
4686
  const MATCH_TITLE_END = /^<(\/)(title)/;
4683
- const MATCH_DIRECTIVE = /^(<!--\s*\[?)(html-validate-)([a-z0-9-]+)(\s*)(.*?)(]?\s*-->)/;
4687
+ const MATCH_DIRECTIVE = /^(<!--\s*\[?)(html-validate-)([\da-z-]+)(\s*)(.*?)(]?\s*-->)/;
4684
4688
  const MATCH_COMMENT = /^<!--([^]*?)-->/;
4685
- const MATCH_CONDITIONAL = /^<!\[([^\]]*?)\]>/;
4689
+ const MATCH_CONDITIONAL = /^<!\[([^\]]*?)]>/;
4686
4690
  class InvalidTokenError extends Error {
4687
4691
  location;
4688
4692
  constructor(location, message) {
@@ -5622,12 +5626,12 @@ function parsePattern(pattern) {
5622
5626
  }
5623
5627
  switch (pattern) {
5624
5628
  case "kebabcase":
5625
- return { regexp: /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/, description: pattern };
5629
+ return { regexp: /^[a-z][\da-z]*(?:-[\da-z]+)*$/, description: pattern };
5626
5630
  case "camelcase":
5627
- return { regexp: /^[a-z][a-zA-Z0-9]*$/, description: pattern };
5631
+ return { regexp: /^[a-z][\dA-Za-z]*$/, description: pattern };
5628
5632
  case "snakecase":
5629
5633
  case "underscore":
5630
- return { regexp: /^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/, description: pattern };
5634
+ return { regexp: /^[a-z][\da-z]*(?:_[\da-z]+)*$/, description: pattern };
5631
5635
  case "bem": {
5632
5636
  const block = "[a-z][a-z0-9]*(?:-[a-z0-9]+)*";
5633
5637
  const element = "(?:__[a-z0-9]+(?:-[a-z0-9]+)*)?";
@@ -5639,7 +5643,7 @@ function parsePattern(pattern) {
5639
5643
  }
5640
5644
  case "tailwind": {
5641
5645
  return {
5642
- regexp: /^!?(?:[-a-z[]|\d+xl:)[\w\-:./\\[\]()#'&>,!=%]*$/,
5646
+ regexp: /^!?(?:[[a-z-]|\d+xl:)[\w!#%&'(),./:=>[\\\]-]*$/,
5643
5647
  description: "tailwind"
5644
5648
  };
5645
5649
  }
@@ -6625,7 +6629,7 @@ class ElementPermittedParent extends Rule {
6625
6629
  }
6626
6630
 
6627
6631
  function isTagnameOnly(value) {
6628
- return /^[a-zA-Z0-9-]+$/.test(value);
6632
+ return /^[\dA-Za-z-]+$/.test(value);
6629
6633
  }
6630
6634
  function getRuleDescription(context) {
6631
6635
  const escaped = context.ancestor.map((it) => `\`${it}\``);
@@ -7081,7 +7085,7 @@ function isRelevant$5(event) {
7081
7085
  return Boolean(node.meta?.heading);
7082
7086
  }
7083
7087
  function extractLevel(node) {
7084
- const match = /^[hH](\d)$/.exec(node.tagName);
7088
+ const match = /^[Hh](\d)$/.exec(node.tagName);
7085
7089
  if (match) {
7086
7090
  return Number.parseInt(match[1], 10);
7087
7091
  } else {
@@ -8536,8 +8540,8 @@ class NoMultipleMain extends Rule {
8536
8540
  const defaults$f = {
8537
8541
  relaxed: false
8538
8542
  };
8539
- const textRegexp = /([<>]|&(?![a-zA-Z0-9#]+;))/g;
8540
- const unquotedAttrRegexp = /([<>"'=`]|&(?![a-zA-Z0-9#]+;))/g;
8543
+ const textRegexp = /([<>]|&(?![\d#A-Za-z]+;))/g;
8544
+ const unquotedAttrRegexp = /(["'<=>`]|&(?![\d#A-Za-z]+;))/g;
8541
8545
  const matchTemplate = /^(<%.*?%>|<\?.*?\?>|<\$.*?\$>)$/s;
8542
8546
  const replacementTable = {
8543
8547
  '"': "&quot;",
@@ -8870,7 +8874,7 @@ class NoTrailingWhitespace extends Rule {
8870
8874
  }
8871
8875
  setup() {
8872
8876
  this.on("whitespace", (event) => {
8873
- if (/^[ \t]+\r?\n$/.test(event.text)) {
8877
+ if (/^[\t ]+\r?\n$/.test(event.text)) {
8874
8878
  this.report(null, "Trailing whitespace", event.location);
8875
8879
  }
8876
8880
  });
@@ -9873,7 +9877,7 @@ const defaults$5 = {
9873
9877
  ignoreCase: false,
9874
9878
  requireSemicolon: true
9875
9879
  };
9876
- const regexp$1 = /&(?:[a-z0-9]+|#x?[0-9a-f]+)(;|[^a-z0-9]|$)/gi;
9880
+ const regexp$1 = /&(?:[\da-z]+|#x?[\da-f]+)(;|[^\da-z]|$)/gi;
9877
9881
  const lowercaseEntities = elements.entities.map((it) => it.toLowerCase());
9878
9882
  function isNumerical(entity) {
9879
9883
  return entity.startsWith("&#");
@@ -9957,7 +9961,7 @@ class UnknownCharReference extends Rule {
9957
9961
  }
9958
9962
  }
9959
9963
  findCharacterReferences(node, text, location, { isAttribute }) {
9960
- const delimiter = text.search(/[?#]/);
9964
+ const delimiter = text.search(/[#?]/);
9961
9965
  for (const match of this.getMatches(text)) {
9962
9966
  const allowUnterminated = isAttribute && isAfterQueryOrFragment(delimiter, match);
9963
9967
  this.validateCharacterReference(node, location, match, {
@@ -10780,7 +10784,7 @@ class H30 extends Rule {
10780
10784
  }
10781
10785
  setup() {
10782
10786
  this.on("dom:ready", (event) => {
10783
- const links = event.document.getElementsByTagName("a");
10787
+ const links = event.document.querySelectorAll("a");
10784
10788
  for (const link of links) {
10785
10789
  if (!link.hasAttribute("href")) {
10786
10790
  continue;
@@ -11370,46 +11374,10 @@ var configurationSchema = {
11370
11374
  properties: properties
11371
11375
  };
11372
11376
 
11373
- function dumpTree(root) {
11374
- const lines = [];
11375
- function decoration(node) {
11376
- let output = "";
11377
- if (node.id) {
11378
- output += `#${node.id}`;
11379
- }
11380
- if (node.hasAttribute("class")) {
11381
- output += `.${node.classList.join(".")}`;
11382
- }
11383
- return output;
11384
- }
11385
- function writeNode(node, level, indent, sibling) {
11386
- const numSiblings = node.parent ? node.parent.childElements.length : 0;
11387
- const lastSibling = sibling === numSiblings - 1;
11388
- if (node.parent) {
11389
- const b = lastSibling ? "\u2514" : "\u251C";
11390
- lines.push(`${indent}${b}\u2500\u2500 ${node.tagName}${decoration(node)}`);
11391
- } else {
11392
- lines.push("(root)");
11393
- }
11394
- for (const [index, child] of node.childElements.entries()) {
11395
- const s = lastSibling ? " " : "\u2502";
11396
- const i = level > 0 ? `${indent}${s} ` : "";
11397
- writeNode(child, level + 1, i, index);
11398
- }
11399
- }
11400
- writeNode(root, 0, "", 0);
11401
- return lines;
11402
- }
11403
-
11404
11377
  function isThenable(value) {
11405
11378
  return value && typeof value === "object" && "then" in value && typeof value.then === "function";
11406
11379
  }
11407
11380
 
11408
- const ruleIds = new Set(Object.keys(bundledRules));
11409
- function ruleExists(ruleId) {
11410
- return ruleIds.has(ruleId);
11411
- }
11412
-
11413
11381
  var defaultConfig = {};
11414
11382
 
11415
11383
  const config$5 = {
@@ -12496,6 +12464,7 @@ class EventHandler {
12496
12464
  * @param event - Event name.
12497
12465
  * @param data - Event data.
12498
12466
  */
12467
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any -- technical debt, should be made typesafe */
12499
12468
  trigger(event, data) {
12500
12469
  for (const listener of this.getCallbacks(event)) {
12501
12470
  listener.call(null, event, data);
@@ -12510,7 +12479,7 @@ class EventHandler {
12510
12479
  }
12511
12480
 
12512
12481
  const name = "html-validate";
12513
- const version = "10.11.3";
12482
+ const version = "10.12.1";
12514
12483
  const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
12515
12484
 
12516
12485
  function freeze(src) {
@@ -12675,7 +12644,7 @@ function definePlugin(plugin) {
12675
12644
  return plugin;
12676
12645
  }
12677
12646
 
12678
- const regexp = /<!(?:--)?\[(.*?)\](?:--)?>/g;
12647
+ const regexp = /<!(?:--)?\[(.*?)](?:--)?>/g;
12679
12648
  function* parseConditionalComment(comment, commentLocation) {
12680
12649
  let match;
12681
12650
  while ((match = regexp.exec(comment)) !== null) {
@@ -13287,6 +13256,42 @@ class Parser {
13287
13256
  }
13288
13257
  }
13289
13258
 
13259
+ const ruleIds = new Set(Object.keys(bundledRules));
13260
+ function ruleExists(ruleId) {
13261
+ return ruleIds.has(ruleId);
13262
+ }
13263
+
13264
+ function dumpTree(root) {
13265
+ const lines = [];
13266
+ function decoration(node) {
13267
+ let output = "";
13268
+ if (node.id) {
13269
+ output += `#${node.id}`;
13270
+ }
13271
+ if (node.hasAttribute("class")) {
13272
+ output += `.${node.classList.join(".")}`;
13273
+ }
13274
+ return output;
13275
+ }
13276
+ function writeNode(node, level, indent, sibling) {
13277
+ const numSiblings = node.parent ? node.parent.childElements.length : 0;
13278
+ const lastSibling = sibling === numSiblings - 1;
13279
+ if (node.parent) {
13280
+ const b = lastSibling ? "\u2514" : "\u251C";
13281
+ lines.push(`${indent}${b}\u2500\u2500 ${node.tagName}${decoration(node)}`);
13282
+ } else {
13283
+ lines.push("(root)");
13284
+ }
13285
+ for (const [index, child] of node.childElements.entries()) {
13286
+ const s = lastSibling ? " " : "\u2502";
13287
+ const i = level > 0 ? `${indent}${s} ` : "";
13288
+ writeNode(child, level + 1, i, index);
13289
+ }
13290
+ }
13291
+ writeNode(root, 0, "", 0);
13292
+ return lines;
13293
+ }
13294
+
13290
13295
  let blockerCounter = 1;
13291
13296
  function createBlocker() {
13292
13297
  const id = blockerCounter++;
@@ -13547,6 +13552,7 @@ class Engine {
13547
13552
  * Initializes all rules from plugins and returns an object with a mapping
13548
13553
  * between rule name and its constructor.
13549
13554
  */
13555
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any -- should explicitly accept anything */
13550
13556
  initRules(config) {
13551
13557
  const availableRules = {};
13552
13558
  for (const plugin of config.getPlugins()) {
@@ -13846,7 +13852,7 @@ const entities = {
13846
13852
  "&": "&amp;"
13847
13853
  };
13848
13854
  function xmlescape(src) {
13849
- return src.toString().replaceAll(/[><'"&]/g, (match) => {
13855
+ return src.toString().replaceAll(/["&'<>]/g, (match) => {
13850
13856
  return entities[match];
13851
13857
  });
13852
13858
  }
@@ -13889,11 +13895,6 @@ function checkstyleFormatter(results) {
13889
13895
  }
13890
13896
  const formatter$2 = checkstyleFormatter;
13891
13897
 
13892
- const defaults = {
13893
- showLink: true,
13894
- showSummary: true,
13895
- showSelector: false
13896
- };
13897
13898
  const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
13898
13899
  function getMarkerLines(loc, source) {
13899
13900
  const startLoc = {
@@ -13969,15 +13970,7 @@ function codeFrameColumns(rawLines, loc) {
13969
13970
  }
13970
13971
  }).join("\n");
13971
13972
  }
13972
- function pluralize(word, count) {
13973
- return count === 1 ? word : `${word}s`;
13974
- }
13975
- function formatFilePath(filePath, line, column) {
13976
- if (line && column) {
13977
- filePath += `:${String(line)}:${String(column)}`;
13978
- }
13979
- return kleur__default.default.green(filePath);
13980
- }
13973
+
13981
13974
  function getStartLocation(message) {
13982
13975
  return {
13983
13976
  line: message.line,
@@ -13997,18 +13990,30 @@ function getEndLocation(message, source) {
13997
13990
  }
13998
13991
  return { line, column };
13999
13992
  }
13993
+
13994
+ const defaults = {
13995
+ showLink: true,
13996
+ showFilePath: true,
13997
+ showSummary: true,
13998
+ showSelector: false
13999
+ };
14000
+ function pluralize(word, count) {
14001
+ return count === 1 ? word : `${word}s`;
14002
+ }
14003
+ function formatFilePath(filePath, line, column) {
14004
+ if (line && column) {
14005
+ filePath += `:${String(line)}:${String(column)}`;
14006
+ }
14007
+ return kleur__default.default.green(filePath);
14008
+ }
14000
14009
  function formatMessage(message, parentResult, options) {
14001
14010
  const type = message.severity === 2 ? kleur__default.default.red("error") : kleur__default.default.yellow("warning");
14002
14011
  const msg = kleur__default.default.bold(message.message.replace(/([^ ])\.$/, "$1"));
14003
14012
  const ruleId = kleur__default.default.dim(`(${message.ruleId})`);
14004
14013
  const filePath = formatFilePath(parentResult.filePath, message.line, message.column);
14005
14014
  const sourceCode = parentResult.source;
14006
- const firstLine = [
14007
- `${type}:`,
14008
- msg,
14009
- ruleId ? ruleId : "",
14010
- sourceCode ? `at ${filePath}:` : `at ${filePath}`
14011
- ].filter(String).join(" ");
14015
+ const filePathPart = options.showFilePath ? `at ${filePath}:` : null;
14016
+ const firstLine = [`${type}:`, msg, ruleId ? ruleId : "", filePathPart].filter(Boolean).join(" ");
14012
14017
  const result = [firstLine];
14013
14018
  if (sourceCode) {
14014
14019
  const output = codeFrameColumns(sourceCode, {
@@ -14946,7 +14951,7 @@ var ignoreExports = /*@__PURE__*/ requireIgnore();
14946
14951
  var ignore = /*@__PURE__*/getDefaultExportFromCjs(ignoreExports);
14947
14952
 
14948
14953
  const engines = {
14949
- node: "^20.19.0 || >= 22.16.0"
14954
+ node: "^20.19.0 || ^22.16.0 || >= 24.0.0"
14950
14955
  };
14951
14956
 
14952
14957
  var workerPath = "./jest-worker.js";
@@ -14983,7 +14988,7 @@ exports.WrappedError = WrappedError;
14983
14988
  exports.ariaNaming = ariaNaming;
14984
14989
  exports.bugs = bugs;
14985
14990
  exports.classifyNodeText = classifyNodeText;
14986
- exports.codeframe = codeframe;
14991
+ exports.codeFrameColumns = codeFrameColumns;
14987
14992
  exports.compatibilityCheckImpl = compatibilityCheckImpl;
14988
14993
  exports.configurationSchema = configurationSchema;
14989
14994
  exports.deepmerge = deepmerge;
@@ -14991,7 +14996,9 @@ exports.defineConfig = defineConfig;
14991
14996
  exports.definePlugin = definePlugin;
14992
14997
  exports.engines = engines;
14993
14998
  exports.ensureError = ensureError;
14999
+ exports.getEndLocation = getEndLocation;
14994
15000
  exports.getFormatter = getFormatter;
15001
+ exports.getStartLocation = getStartLocation;
14995
15002
  exports.ignore = ignore;
14996
15003
  exports.isThenable = isThenable;
14997
15004
  exports.isUserError = isUserError;