html-validate 10.10.0 → 10.11.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.
package/dist/esm/core.js CHANGED
@@ -999,10 +999,11 @@ function cyrb53(str) {
999
999
  const seed = 0;
1000
1000
  let h1 = 3735928559 ^ seed;
1001
1001
  let h2 = 1103547991 ^ seed;
1002
- for (let i = 0, ch; i < str.length; i++) {
1003
- ch = str.charCodeAt(i);
1002
+ for (let i = 0, ch; i < str.length; ) {
1003
+ ch = str.codePointAt(i);
1004
1004
  h1 = Math.imul(h1 ^ ch, a);
1005
1005
  h2 = Math.imul(h2 ^ ch, b);
1006
+ i += ch > 65535 ? 2 : 1;
1006
1007
  }
1007
1008
  h1 = Math.imul(h1 ^ h1 >>> 16, c) ^ Math.imul(h2 ^ h2 >>> 13, d);
1008
1009
  h2 = Math.imul(h2 ^ h2 >>> 16, c) ^ Math.imul(h1 ^ h1 >>> 13, d);
@@ -1844,7 +1845,7 @@ class DOMNode {
1844
1845
  }
1845
1846
  _removeChild(node) {
1846
1847
  const index = this.childNodes.findIndex((it) => it.isSameNode(node));
1847
- if (index >= 0) {
1848
+ if (index !== -1) {
1848
1849
  this.childNodes.splice(index, 1);
1849
1850
  } else {
1850
1851
  throw new Error("DOMException: _removeChild(..) could not find child to remove");
@@ -2287,7 +2288,7 @@ function escapeSelectorComponent(text) {
2287
2288
  }
2288
2289
  function generateIdSelector(id) {
2289
2290
  const escaped = escapeSelectorComponent(id);
2290
- return /^\d/.exec(escaped) ? `[id="${escaped}"]` : `#${escaped}`;
2291
+ return /^\d/.test(escaped) ? `[id="${escaped}"]` : `#${escaped}`;
2291
2292
  }
2292
2293
  class Selector {
2293
2294
  pattern;
@@ -2567,7 +2568,7 @@ class HtmlElement extends DOMNode {
2567
2568
  return attr.value;
2568
2569
  }
2569
2570
  const list = new DOMTokenList(attr.value, attr.valueLocation);
2570
- return list.length ? Array.from(list) : null;
2571
+ return list.length > 0 ? Array.from(list) : null;
2571
2572
  }
2572
2573
  /**
2573
2574
  * Similar to childNodes but only elements.
@@ -3254,7 +3255,7 @@ class Validator {
3254
3255
  const caseInsensitiveValue = value.toLowerCase();
3255
3256
  return rule.enum.some((entry) => {
3256
3257
  if (entry instanceof RegExp) {
3257
- return !!value.match(entry);
3258
+ return entry.test(value);
3258
3259
  } else {
3259
3260
  return caseInsensitiveValue === entry;
3260
3261
  }
@@ -4019,7 +4020,7 @@ class Rule {
4019
4020
  }
4020
4021
  }
4021
4022
 
4022
- const defaults$B = {
4023
+ const defaults$C = {
4023
4024
  allowExternal: true,
4024
4025
  allowRelative: true,
4025
4026
  allowAbsolute: true,
@@ -4063,7 +4064,7 @@ class AllowedLinks extends Rule {
4063
4064
  allowRelative;
4064
4065
  allowAbsolute;
4065
4066
  constructor(options) {
4066
- super({ ...defaults$B, ...options });
4067
+ super({ ...defaults$C, ...options });
4067
4068
  this.allowExternal = parseAllow(this.options.allowExternal);
4068
4069
  this.allowRelative = parseAllow(this.options.allowRelative);
4069
4070
  this.allowAbsolute = parseAllow(this.options.allowAbsolute);
@@ -4135,7 +4136,7 @@ class AllowedLinks extends Rule {
4135
4136
  return Boolean(attr && attr === key);
4136
4137
  }
4137
4138
  getStyle(value) {
4138
- if (value.match(/^([a-z]+:)?\/\//g)) {
4139
+ if (/^([a-z]+:)?\/\//g.test(value)) {
4139
4140
  return "external" /* EXTERNAL */;
4140
4141
  }
4141
4142
  switch (value[0]) {
@@ -4231,7 +4232,7 @@ class AllowedLinks extends Rule {
4231
4232
  }
4232
4233
  }
4233
4234
 
4234
- const defaults$A = {
4235
+ const defaults$B = {
4235
4236
  accessible: true
4236
4237
  };
4237
4238
  function findByTarget(target, siblings) {
@@ -4261,7 +4262,7 @@ function getDescription$1(context) {
4261
4262
  }
4262
4263
  class AreaAlt extends Rule {
4263
4264
  constructor(options) {
4264
- super({ ...defaults$A, ...options });
4265
+ super({ ...defaults$B, ...options });
4265
4266
  }
4266
4267
  static schema() {
4267
4268
  return {
@@ -4340,7 +4341,7 @@ class AriaHiddenBody extends Rule {
4340
4341
  }
4341
4342
  }
4342
4343
 
4343
- const defaults$z = {
4344
+ const defaults$A = {
4344
4345
  allowAnyNamable: false,
4345
4346
  elements: {
4346
4347
  include: null,
@@ -4388,7 +4389,7 @@ function isValidUsage(target, meta) {
4388
4389
  }
4389
4390
  class AriaLabelMisuse extends Rule {
4390
4391
  constructor(options) {
4391
- super({ ...defaults$z, ...options });
4392
+ super({ ...defaults$A, ...options });
4392
4393
  }
4393
4394
  static schema() {
4394
4395
  return {
@@ -4556,14 +4557,14 @@ class CaseStyle {
4556
4557
  }
4557
4558
  }
4558
4559
 
4559
- const defaults$y = {
4560
+ const defaults$z = {
4560
4561
  style: "lowercase",
4561
4562
  ignoreForeign: true
4562
4563
  };
4563
4564
  class AttrCase extends Rule {
4564
4565
  style;
4565
4566
  constructor(options) {
4566
- super({ ...defaults$y, ...options });
4567
+ super({ ...defaults$z, ...options });
4567
4568
  this.style = new CaseStyle(this.options.style, "attr-case");
4568
4569
  }
4569
4570
  static schema() {
@@ -4979,7 +4980,7 @@ class AttrDelimiter extends Rule {
4979
4980
  }
4980
4981
 
4981
4982
  const DEFAULT_PATTERN = "[a-z0-9-:]+";
4982
- const defaults$x = {
4983
+ const defaults$y = {
4983
4984
  pattern: DEFAULT_PATTERN,
4984
4985
  ignoreForeign: true
4985
4986
  };
@@ -5012,7 +5013,7 @@ function generateDescription(name, pattern) {
5012
5013
  class AttrPattern extends Rule {
5013
5014
  pattern;
5014
5015
  constructor(options) {
5015
- super({ ...defaults$x, ...options });
5016
+ super({ ...defaults$y, ...options });
5016
5017
  this.pattern = generateRegexp(this.options.pattern);
5017
5018
  }
5018
5019
  static schema() {
@@ -5059,7 +5060,7 @@ class AttrPattern extends Rule {
5059
5060
  }
5060
5061
  }
5061
5062
 
5062
- const defaults$w = {
5063
+ const defaults$x = {
5063
5064
  style: "auto",
5064
5065
  unquoted: false
5065
5066
  };
@@ -5125,7 +5126,7 @@ class AttrQuotes extends Rule {
5125
5126
  };
5126
5127
  }
5127
5128
  constructor(options) {
5128
- super({ ...defaults$w, ...options });
5129
+ super({ ...defaults$x, ...options });
5129
5130
  this.style = parseStyle$3(this.options.style);
5130
5131
  }
5131
5132
  setup() {
@@ -5281,13 +5282,13 @@ class AttributeAllowedValues extends Rule {
5281
5282
  }
5282
5283
  }
5283
5284
 
5284
- const defaults$v = {
5285
+ const defaults$w = {
5285
5286
  style: "omit"
5286
5287
  };
5287
5288
  class AttributeBooleanStyle extends Rule {
5288
5289
  hasInvalidStyle;
5289
5290
  constructor(options) {
5290
- super({ ...defaults$v, ...options });
5291
+ super({ ...defaults$w, ...options });
5291
5292
  this.hasInvalidStyle = parseStyle$2(this.options.style);
5292
5293
  }
5293
5294
  static schema() {
@@ -5357,13 +5358,13 @@ function reportMessage$1(attr, style) {
5357
5358
  return "";
5358
5359
  }
5359
5360
 
5360
- const defaults$u = {
5361
+ const defaults$v = {
5361
5362
  style: "omit"
5362
5363
  };
5363
5364
  class AttributeEmptyStyle extends Rule {
5364
5365
  hasInvalidStyle;
5365
5366
  constructor(options) {
5366
- super({ ...defaults$u, ...options });
5367
+ super({ ...defaults$v, ...options });
5367
5368
  this.hasInvalidStyle = parseStyle$1(this.options.style);
5368
5369
  }
5369
5370
  static schema() {
@@ -5480,7 +5481,7 @@ class AttributeMisuse extends Rule {
5480
5481
  }
5481
5482
  }
5482
5483
 
5483
- const defaults$t = {
5484
+ const defaults$u = {
5484
5485
  preferred: void 0
5485
5486
  };
5486
5487
  function isPasswordInput(event) {
@@ -5497,7 +5498,7 @@ function isGroupingToken(token) {
5497
5498
  class AutocompletePassword extends Rule {
5498
5499
  preferred;
5499
5500
  constructor(options) {
5500
- super({ ...defaults$t, ...options });
5501
+ super({ ...defaults$u, ...options });
5501
5502
  this.preferred = options.preferred?.toLowerCase();
5502
5503
  }
5503
5504
  static schema() {
@@ -5576,21 +5577,19 @@ class AutocompletePassword extends Rule {
5576
5577
  });
5577
5578
  return;
5578
5579
  }
5579
- if (preferred) {
5580
- if (value !== preferred) {
5581
- const context = {
5582
- kind: "preferred-mismatch",
5583
- value,
5584
- preferred
5585
- };
5586
- this.report({
5587
- node: target,
5588
- message: `<input type="password"> should use autocomplete="${preferred}"`,
5589
- /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- location must be present if value is */
5590
- location,
5591
- context
5592
- });
5593
- }
5580
+ if (preferred && value !== preferred) {
5581
+ const context = {
5582
+ kind: "preferred-mismatch",
5583
+ value,
5584
+ preferred
5585
+ };
5586
+ this.report({
5587
+ node: target,
5588
+ message: `<input type="password"> should use autocomplete="${preferred}"`,
5589
+ /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- location must be present if value is */
5590
+ location,
5591
+ context
5592
+ });
5594
5593
  }
5595
5594
  });
5596
5595
  }
@@ -5727,7 +5726,7 @@ class BasePatternRule extends Rule {
5727
5726
  }
5728
5727
  }
5729
5728
 
5730
- const defaults$s = {
5729
+ const defaults$t = {
5731
5730
  pattern: "kebabcase"
5732
5731
  };
5733
5732
  class ClassPattern extends BasePatternRule {
@@ -5735,7 +5734,7 @@ class ClassPattern extends BasePatternRule {
5735
5734
  super({
5736
5735
  ruleId: "class-pattern",
5737
5736
  attr: "class",
5738
- options: { ...defaults$s, ...options },
5737
+ options: { ...defaults$t, ...options },
5739
5738
  allowedPatterns: patternNames
5740
5739
  // allow all patterns
5741
5740
  });
@@ -5885,13 +5884,13 @@ class CloseOrder extends Rule {
5885
5884
  }
5886
5885
  }
5887
5886
 
5888
- const defaults$r = {
5887
+ const defaults$s = {
5889
5888
  include: null,
5890
5889
  exclude: null
5891
5890
  };
5892
5891
  class Deprecated extends Rule {
5893
5892
  constructor(options) {
5894
- super({ ...defaults$r, ...options });
5893
+ super({ ...defaults$s, ...options });
5895
5894
  }
5896
5895
  static schema() {
5897
5896
  return {
@@ -6003,7 +6002,7 @@ function quote(value, char = '"') {
6003
6002
  return `${char}${value}${char}`;
6004
6003
  }
6005
6004
 
6006
- const defaults$q = {
6005
+ const defaults$r = {
6007
6006
  classes: []
6008
6007
  };
6009
6008
  function isRelevant$6(event) {
@@ -6057,7 +6056,7 @@ ${listItems.join("\n")}`);
6057
6056
  class DeprecatedClass extends Rule {
6058
6057
  deprecatedMap;
6059
6058
  constructor(options) {
6060
- super({ ...defaults$q, ...options });
6059
+ super({ ...defaults$r, ...options });
6061
6060
  const { classes } = this.options;
6062
6061
  this.deprecatedMap = new Map(classes.map((entry) => [entry.class, normalizeEntry(entry)]));
6063
6062
  }
@@ -6176,12 +6175,12 @@ let NoStyleTag$1 = class NoStyleTag extends Rule {
6176
6175
  }
6177
6176
  };
6178
6177
 
6179
- const defaults$p = {
6178
+ const defaults$q = {
6180
6179
  style: "uppercase"
6181
6180
  };
6182
6181
  class DoctypeStyle extends Rule {
6183
6182
  constructor(options) {
6184
- super({ ...defaults$p, ...options });
6183
+ super({ ...defaults$q, ...options });
6185
6184
  }
6186
6185
  static schema() {
6187
6186
  return {
@@ -6209,13 +6208,13 @@ class DoctypeStyle extends Rule {
6209
6208
  }
6210
6209
  }
6211
6210
 
6212
- const defaults$o = {
6211
+ const defaults$p = {
6213
6212
  style: "lowercase"
6214
6213
  };
6215
6214
  class ElementCase extends Rule {
6216
6215
  style;
6217
6216
  constructor(options) {
6218
- super({ ...defaults$o, ...options });
6217
+ super({ ...defaults$p, ...options });
6219
6218
  this.style = new CaseStyle(this.options.style, "element-case");
6220
6219
  }
6221
6220
  static schema() {
@@ -6275,7 +6274,7 @@ class ElementCase extends Rule {
6275
6274
  }
6276
6275
  }
6277
6276
 
6278
- const defaults$n = {
6277
+ const defaults$o = {
6279
6278
  pattern: "^[a-z][a-z0-9\\-._]*-[a-z0-9\\-._]*$",
6280
6279
  whitelist: [],
6281
6280
  blacklist: []
@@ -6283,7 +6282,7 @@ const defaults$n = {
6283
6282
  class ElementName extends Rule {
6284
6283
  pattern;
6285
6284
  constructor(options) {
6286
- super({ ...defaults$n, ...options });
6285
+ super({ ...defaults$o, ...options });
6287
6286
  this.pattern = new RegExp(this.options.pattern);
6288
6287
  }
6289
6288
  static schema() {
@@ -6320,7 +6319,7 @@ class ElementName extends Rule {
6320
6319
  ...context.blacklist.map((cur) => `- ${cur}`)
6321
6320
  ];
6322
6321
  }
6323
- if (context.pattern !== defaults$n.pattern) {
6322
+ if (context.pattern !== defaults$o.pattern) {
6324
6323
  return [
6325
6324
  `<${context.tagName}> is not a valid element name. This project is configured to only allow names matching the following regular expression:`,
6326
6325
  "",
@@ -6352,13 +6351,13 @@ class ElementName extends Rule {
6352
6351
  if (target.meta) {
6353
6352
  return;
6354
6353
  }
6355
- if (xmlns.exec(tagName)) {
6354
+ if (xmlns.test(tagName)) {
6356
6355
  return;
6357
6356
  }
6358
6357
  if (this.options.whitelist.includes(tagName)) {
6359
6358
  return;
6360
6359
  }
6361
- if (!tagName.match(this.pattern)) {
6360
+ if (!this.pattern.test(tagName)) {
6362
6361
  this.report(target, `<${tagName}> is not a valid element name`, location, context);
6363
6362
  }
6364
6363
  });
@@ -6617,7 +6616,7 @@ class ElementPermittedParent extends Rule {
6617
6616
  }
6618
6617
 
6619
6618
  function isTagnameOnly(value) {
6620
- return Boolean(/^[a-zA-Z0-9-]+$/.exec(value));
6619
+ return /^[a-zA-Z0-9-]+$/.test(value);
6621
6620
  }
6622
6621
  function getRuleDescription(context) {
6623
6622
  const escaped = context.ancestor.map((it) => `\`${it}\``);
@@ -6837,7 +6836,7 @@ class EmptyTitle extends Rule {
6837
6836
  }
6838
6837
  }
6839
6838
 
6840
- const defaults$m = {
6839
+ const defaults$n = {
6841
6840
  allowArrayBrackets: true,
6842
6841
  allowCheckboxDefault: true,
6843
6842
  shared: ["radio", "button", "reset", "submit"]
@@ -6904,7 +6903,7 @@ function getDocumentation(context) {
6904
6903
  }
6905
6904
  class FormDupName extends Rule {
6906
6905
  constructor(options) {
6907
- super({ ...defaults$m, ...options });
6906
+ super({ ...defaults$n, ...options });
6908
6907
  }
6909
6908
  static schema() {
6910
6909
  return {
@@ -7063,7 +7062,7 @@ class FormDupName extends Rule {
7063
7062
  }
7064
7063
  }
7065
7064
 
7066
- const defaults$l = {
7065
+ const defaults$m = {
7067
7066
  allowMultipleH1: false,
7068
7067
  minInitialRank: "h1",
7069
7068
  sectioningRoots: ["dialog", '[role="dialog"]', '[role="alertdialog"]']
@@ -7095,7 +7094,7 @@ class HeadingLevel extends Rule {
7095
7094
  sectionRoots;
7096
7095
  stack = [];
7097
7096
  constructor(options) {
7098
- super({ ...defaults$l, ...options });
7097
+ super({ ...defaults$m, ...options });
7099
7098
  this.minInitialRank = parseMaxInitial(this.options.minInitialRank);
7100
7099
  this.sectionRoots = this.options.sectioningRoots.map((it) => new Compound(it));
7101
7100
  this.stack.push({
@@ -7334,7 +7333,7 @@ class HiddenFocusable extends Rule {
7334
7333
  }
7335
7334
  }
7336
7335
 
7337
- const defaults$k = {
7336
+ const defaults$l = {
7338
7337
  pattern: "kebabcase"
7339
7338
  };
7340
7339
  function exclude$1(set, ...values) {
@@ -7350,7 +7349,7 @@ class IdPattern extends BasePatternRule {
7350
7349
  super({
7351
7350
  ruleId: "id-pattern",
7352
7351
  attr: "id",
7353
- options: { ...defaults$k, ...options },
7352
+ options: { ...defaults$l, ...options },
7354
7353
  allowedPatterns
7355
7354
  });
7356
7355
  }
@@ -7672,13 +7671,13 @@ function findLabelByParent(el) {
7672
7671
  return [];
7673
7672
  }
7674
7673
 
7675
- const defaults$j = {
7674
+ const defaults$k = {
7676
7675
  maxlength: 70
7677
7676
  };
7678
7677
  class LongTitle extends Rule {
7679
7678
  maxlength;
7680
7679
  constructor(options) {
7681
- super({ ...defaults$j, ...options });
7680
+ super({ ...defaults$k, ...options });
7682
7681
  this.maxlength = this.options.maxlength;
7683
7682
  }
7684
7683
  static schema() {
@@ -7782,12 +7781,12 @@ class MapIdName extends Rule {
7782
7781
  }
7783
7782
  }
7784
7783
 
7785
- const defaults$i = {
7784
+ const defaults$j = {
7786
7785
  allowLongDelay: false
7787
7786
  };
7788
7787
  class MetaRefresh extends Rule {
7789
7788
  constructor(options) {
7790
- super({ ...defaults$i, ...options });
7789
+ super({ ...defaults$j, ...options });
7791
7790
  }
7792
7791
  documentation() {
7793
7792
  return {
@@ -7898,7 +7897,7 @@ class MultipleLabeledControls extends Rule {
7898
7897
  }
7899
7898
  }
7900
7899
 
7901
- const defaults$h = {
7900
+ const defaults$i = {
7902
7901
  pattern: "camelcase"
7903
7902
  };
7904
7903
  function exclude(set, ...values) {
@@ -7914,7 +7913,7 @@ class NamePattern extends BasePatternRule {
7914
7913
  super({
7915
7914
  ruleId: "name-pattern",
7916
7915
  attr: "name",
7917
- options: { ...defaults$h, ...options },
7916
+ options: { ...defaults$i, ...options },
7918
7917
  allowedPatterns
7919
7918
  });
7920
7919
  }
@@ -8005,13 +8004,13 @@ class NoAbstractRole extends Rule {
8005
8004
  }
8006
8005
  }
8007
8006
 
8008
- const defaults$g = {
8007
+ const defaults$h = {
8009
8008
  include: null,
8010
8009
  exclude: null
8011
8010
  };
8012
8011
  class NoAutoplay extends Rule {
8013
8012
  constructor(options) {
8014
- super({ ...defaults$g, ...options });
8013
+ super({ ...defaults$h, ...options });
8015
8014
  }
8016
8015
  documentation(context) {
8017
8016
  return {
@@ -8332,14 +8331,14 @@ class NoImplicitInputType extends Rule {
8332
8331
  }
8333
8332
  }
8334
8333
 
8335
- const defaults$f = {
8334
+ const defaults$g = {
8336
8335
  include: null,
8337
8336
  exclude: null,
8338
8337
  allowedProperties: ["display"]
8339
8338
  };
8340
8339
  class NoInlineStyle extends Rule {
8341
8340
  constructor(options) {
8342
- super({ ...defaults$f, ...options });
8341
+ super({ ...defaults$g, ...options });
8343
8342
  }
8344
8343
  static schema() {
8345
8344
  return {
@@ -8525,7 +8524,7 @@ class NoMultipleMain extends Rule {
8525
8524
  }
8526
8525
  }
8527
8526
 
8528
- const defaults$e = {
8527
+ const defaults$f = {
8529
8528
  relaxed: false
8530
8529
  };
8531
8530
  const textRegexp = /([<>]|&(?![a-zA-Z0-9#]+;))/g;
@@ -8543,7 +8542,7 @@ const replacementTable = {
8543
8542
  class NoRawCharacters extends Rule {
8544
8543
  relaxed;
8545
8544
  constructor(options) {
8546
- super({ ...defaults$e, ...options });
8545
+ super({ ...defaults$f, ...options });
8547
8546
  this.relaxed = this.options.relaxed;
8548
8547
  }
8549
8548
  static schema() {
@@ -8569,7 +8568,7 @@ class NoRawCharacters extends Rule {
8569
8568
  if (child.nodeType !== NodeType.TEXT_NODE) {
8570
8569
  continue;
8571
8570
  }
8572
- if (matchTemplate.exec(child.textContent)) {
8571
+ if (matchTemplate.test(child.textContent)) {
8573
8572
  continue;
8574
8573
  }
8575
8574
  this.findRawChars(node, child.textContent, child.location, textRegexp);
@@ -8682,7 +8681,14 @@ class NoRedundantFor extends Rule {
8682
8681
  }
8683
8682
  }
8684
8683
 
8684
+ const defaults$e = {
8685
+ include: null,
8686
+ exclude: null
8687
+ };
8685
8688
  class NoRedundantRole extends Rule {
8689
+ constructor(options) {
8690
+ super({ ...defaults$e, ...options });
8691
+ }
8686
8692
  documentation(context) {
8687
8693
  const { role, tagName } = context;
8688
8694
  return {
@@ -8690,6 +8696,36 @@ class NoRedundantRole extends Rule {
8690
8696
  url: "https://html-validate.org/rules/no-redundant-role.html"
8691
8697
  };
8692
8698
  }
8699
+ static schema() {
8700
+ return {
8701
+ exclude: {
8702
+ anyOf: [
8703
+ {
8704
+ items: {
8705
+ type: "string"
8706
+ },
8707
+ type: "array"
8708
+ },
8709
+ {
8710
+ type: "null"
8711
+ }
8712
+ ]
8713
+ },
8714
+ include: {
8715
+ anyOf: [
8716
+ {
8717
+ items: {
8718
+ type: "string"
8719
+ },
8720
+ type: "array"
8721
+ },
8722
+ {
8723
+ type: "null"
8724
+ }
8725
+ ]
8726
+ }
8727
+ };
8728
+ }
8693
8729
  setup() {
8694
8730
  this.on("tag:ready", (event) => {
8695
8731
  const { target } = event;
@@ -8708,6 +8744,9 @@ class NoRedundantRole extends Rule {
8708
8744
  if (role.value !== implicitRole) {
8709
8745
  return;
8710
8746
  }
8747
+ if (this.isKeywordIgnored(role.value)) {
8748
+ return;
8749
+ }
8711
8750
  const context = {
8712
8751
  tagName: target.tagName,
8713
8752
  role: role.value
@@ -8764,7 +8803,7 @@ class NoSelfClosing extends Rule {
8764
8803
  }
8765
8804
  }
8766
8805
  function isRelevant(node, options) {
8767
- if (xmlns.exec(node.tagName)) {
8806
+ if (xmlns.test(node.tagName)) {
8768
8807
  return !options.ignoreXML;
8769
8808
  }
8770
8809
  if (!node.meta) {
@@ -8822,7 +8861,7 @@ class NoTrailingWhitespace extends Rule {
8822
8861
  }
8823
8862
  setup() {
8824
8863
  this.on("whitespace", (event) => {
8825
- if (/^[ \t]+\r?\n$/.exec(event.text)) {
8864
+ if (/^[ \t]+\r?\n$/.test(event.text)) {
8826
8865
  this.report(null, "Trailing whitespace", event.location);
8827
8866
  }
8828
8867
  });
@@ -8901,7 +8940,7 @@ class NoUnusedDisable extends Rule {
8901
8940
  const tokens = new DOMTokenList(options.replaceAll(",", " "), location);
8902
8941
  for (const ruleId of unused) {
8903
8942
  const index = tokens.indexOf(ruleId);
8904
- const tokenLocation = index >= 0 ? tokens.location(index) : location;
8943
+ const tokenLocation = index !== -1 ? tokens.location(index) : location;
8905
8944
  this.report({
8906
8945
  node: null,
8907
8946
  message: '"{{ ruleId }}" rule is disabled but no error was reported',
@@ -9149,7 +9188,7 @@ class PreferTbody extends Rule {
9149
9188
  continue;
9150
9189
  }
9151
9190
  const tr = table.querySelectorAll("> tr");
9152
- if (tr.length >= 1) {
9191
+ if (tr.length > 0) {
9153
9192
  this.report(tr[0], "Prefer to wrap <tr> elements in <tbody>");
9154
9193
  }
9155
9194
  }
@@ -10558,7 +10597,7 @@ class ValidID extends Rule {
10558
10597
  this.report(event.target, this.messages[context.kind], event.location, context);
10559
10598
  return;
10560
10599
  }
10561
- if (/\s/.exec(value)) {
10600
+ if (/\s/.test(value)) {
10562
10601
  const context = { kind: 2 /* WHITESPACE */, id: value };
10563
10602
  this.report(event.target, this.messages[context.kind], event.valueLocation, context);
10564
10603
  return;
@@ -10567,12 +10606,12 @@ class ValidID extends Rule {
10567
10606
  if (relaxed) {
10568
10607
  return;
10569
10608
  }
10570
- if (/^[^\p{L}]/u.exec(value)) {
10609
+ if (/^[^\p{L}]/u.test(value)) {
10571
10610
  const context = { kind: 3 /* LEADING_CHARACTER */, id: value };
10572
10611
  this.report(event.target, this.messages[context.kind], event.valueLocation, context);
10573
10612
  return;
10574
10613
  }
10575
- if (/[^\p{L}\p{N}_-]/u.exec(value)) {
10614
+ if (/[^\p{L}\p{N}_-]/u.test(value)) {
10576
10615
  const context = { kind: 4 /* DISALLOWED_CHARACTER */, id: value };
10577
10616
  this.report(event.target, this.messages[context.kind], event.valueLocation, context);
10578
10617
  }
@@ -10933,7 +10972,7 @@ function isSimpleTable(table) {
10933
10972
  }
10934
10973
  const shape = getShape(cells);
10935
10974
  const headersPerRow = cells.map((row) => row.reduce((sum, cell) => sum + cell, 0));
10936
- const headersPerColumn = Array(shape.cols).fill(0).map((_, index) => {
10975
+ const headersPerColumn = new Array(shape.cols).fill(0).map((_, index) => {
10937
10976
  return cells.reduce((sum, it) => sum + it[index], 0);
10938
10977
  });
10939
10978
  const [firstRow, ...otherRows] = headersPerRow;
@@ -12455,7 +12494,7 @@ class EventHandler {
12455
12494
  }
12456
12495
 
12457
12496
  const name = "html-validate";
12458
- const version = "10.10.0";
12497
+ const version = "10.11.1";
12459
12498
  const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
12460
12499
 
12461
12500
  function freeze(src) {
@@ -13696,7 +13735,7 @@ async function transformSource(resolvers, config, source, filename) {
13696
13735
  }
13697
13736
  };
13698
13737
  if (!transformer) {
13699
- return Promise.resolve([source]);
13738
+ return [source];
13700
13739
  }
13701
13740
  const fn = transformer.kind === "import" ? await getCachedTransformerFunction(cache, resolvers, transformer.name, config.getPlugins()) : transformer.function;
13702
13741
  const name = transformer.kind === "import" ? transformer.name : transformer.function.name;