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/cjs/cli.js +3 -3
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/core-browser.js +1 -1
- package/dist/cjs/core-browser.js.map +1 -1
- package/dist/cjs/core-nodejs.js +14 -3
- package/dist/cjs/core-nodejs.js.map +1 -1
- package/dist/cjs/core.js +124 -85
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/matchers.js +1 -1
- package/dist/cjs/matchers.js.map +1 -1
- package/dist/esm/cli.js +3 -3
- package/dist/esm/cli.js.map +1 -1
- package/dist/esm/core-browser.js +1 -1
- package/dist/esm/core-browser.js.map +1 -1
- package/dist/esm/core-nodejs.js +14 -3
- package/dist/esm/core-nodejs.js.map +1 -1
- package/dist/esm/core.js +124 -85
- package/dist/esm/core.js.map +1 -1
- package/dist/esm/matchers.js +1 -1
- package/dist/esm/matchers.js.map +1 -1
- package/dist/types/index.d.ts +3 -0
- package/package.json +1 -1
package/dist/cjs/core.js
CHANGED
|
@@ -1008,10 +1008,11 @@ function cyrb53(str) {
|
|
|
1008
1008
|
const seed = 0;
|
|
1009
1009
|
let h1 = 3735928559 ^ seed;
|
|
1010
1010
|
let h2 = 1103547991 ^ seed;
|
|
1011
|
-
for (let i = 0, ch; i < str.length;
|
|
1012
|
-
ch = str.
|
|
1011
|
+
for (let i = 0, ch; i < str.length; ) {
|
|
1012
|
+
ch = str.codePointAt(i);
|
|
1013
1013
|
h1 = Math.imul(h1 ^ ch, a);
|
|
1014
1014
|
h2 = Math.imul(h2 ^ ch, b);
|
|
1015
|
+
i += ch > 65535 ? 2 : 1;
|
|
1015
1016
|
}
|
|
1016
1017
|
h1 = Math.imul(h1 ^ h1 >>> 16, c) ^ Math.imul(h2 ^ h2 >>> 13, d);
|
|
1017
1018
|
h2 = Math.imul(h2 ^ h2 >>> 16, c) ^ Math.imul(h1 ^ h1 >>> 13, d);
|
|
@@ -1853,7 +1854,7 @@ class DOMNode {
|
|
|
1853
1854
|
}
|
|
1854
1855
|
_removeChild(node) {
|
|
1855
1856
|
const index = this.childNodes.findIndex((it) => it.isSameNode(node));
|
|
1856
|
-
if (index
|
|
1857
|
+
if (index !== -1) {
|
|
1857
1858
|
this.childNodes.splice(index, 1);
|
|
1858
1859
|
} else {
|
|
1859
1860
|
throw new Error("DOMException: _removeChild(..) could not find child to remove");
|
|
@@ -2296,7 +2297,7 @@ function escapeSelectorComponent(text) {
|
|
|
2296
2297
|
}
|
|
2297
2298
|
function generateIdSelector(id) {
|
|
2298
2299
|
const escaped = escapeSelectorComponent(id);
|
|
2299
|
-
return /^\d/.
|
|
2300
|
+
return /^\d/.test(escaped) ? `[id="${escaped}"]` : `#${escaped}`;
|
|
2300
2301
|
}
|
|
2301
2302
|
class Selector {
|
|
2302
2303
|
pattern;
|
|
@@ -2576,7 +2577,7 @@ class HtmlElement extends DOMNode {
|
|
|
2576
2577
|
return attr.value;
|
|
2577
2578
|
}
|
|
2578
2579
|
const list = new DOMTokenList(attr.value, attr.valueLocation);
|
|
2579
|
-
return list.length ? Array.from(list) : null;
|
|
2580
|
+
return list.length > 0 ? Array.from(list) : null;
|
|
2580
2581
|
}
|
|
2581
2582
|
/**
|
|
2582
2583
|
* Similar to childNodes but only elements.
|
|
@@ -3263,7 +3264,7 @@ class Validator {
|
|
|
3263
3264
|
const caseInsensitiveValue = value.toLowerCase();
|
|
3264
3265
|
return rule.enum.some((entry) => {
|
|
3265
3266
|
if (entry instanceof RegExp) {
|
|
3266
|
-
return
|
|
3267
|
+
return entry.test(value);
|
|
3267
3268
|
} else {
|
|
3268
3269
|
return caseInsensitiveValue === entry;
|
|
3269
3270
|
}
|
|
@@ -4028,7 +4029,7 @@ class Rule {
|
|
|
4028
4029
|
}
|
|
4029
4030
|
}
|
|
4030
4031
|
|
|
4031
|
-
const defaults$
|
|
4032
|
+
const defaults$C = {
|
|
4032
4033
|
allowExternal: true,
|
|
4033
4034
|
allowRelative: true,
|
|
4034
4035
|
allowAbsolute: true,
|
|
@@ -4072,7 +4073,7 @@ class AllowedLinks extends Rule {
|
|
|
4072
4073
|
allowRelative;
|
|
4073
4074
|
allowAbsolute;
|
|
4074
4075
|
constructor(options) {
|
|
4075
|
-
super({ ...defaults$
|
|
4076
|
+
super({ ...defaults$C, ...options });
|
|
4076
4077
|
this.allowExternal = parseAllow(this.options.allowExternal);
|
|
4077
4078
|
this.allowRelative = parseAllow(this.options.allowRelative);
|
|
4078
4079
|
this.allowAbsolute = parseAllow(this.options.allowAbsolute);
|
|
@@ -4144,7 +4145,7 @@ class AllowedLinks extends Rule {
|
|
|
4144
4145
|
return Boolean(attr && attr === key);
|
|
4145
4146
|
}
|
|
4146
4147
|
getStyle(value) {
|
|
4147
|
-
if (
|
|
4148
|
+
if (/^([a-z]+:)?\/\//g.test(value)) {
|
|
4148
4149
|
return "external" /* EXTERNAL */;
|
|
4149
4150
|
}
|
|
4150
4151
|
switch (value[0]) {
|
|
@@ -4240,7 +4241,7 @@ class AllowedLinks extends Rule {
|
|
|
4240
4241
|
}
|
|
4241
4242
|
}
|
|
4242
4243
|
|
|
4243
|
-
const defaults$
|
|
4244
|
+
const defaults$B = {
|
|
4244
4245
|
accessible: true
|
|
4245
4246
|
};
|
|
4246
4247
|
function findByTarget(target, siblings) {
|
|
@@ -4270,7 +4271,7 @@ function getDescription$1(context) {
|
|
|
4270
4271
|
}
|
|
4271
4272
|
class AreaAlt extends Rule {
|
|
4272
4273
|
constructor(options) {
|
|
4273
|
-
super({ ...defaults$
|
|
4274
|
+
super({ ...defaults$B, ...options });
|
|
4274
4275
|
}
|
|
4275
4276
|
static schema() {
|
|
4276
4277
|
return {
|
|
@@ -4349,7 +4350,7 @@ class AriaHiddenBody extends Rule {
|
|
|
4349
4350
|
}
|
|
4350
4351
|
}
|
|
4351
4352
|
|
|
4352
|
-
const defaults$
|
|
4353
|
+
const defaults$A = {
|
|
4353
4354
|
allowAnyNamable: false,
|
|
4354
4355
|
elements: {
|
|
4355
4356
|
include: null,
|
|
@@ -4397,7 +4398,7 @@ function isValidUsage(target, meta) {
|
|
|
4397
4398
|
}
|
|
4398
4399
|
class AriaLabelMisuse extends Rule {
|
|
4399
4400
|
constructor(options) {
|
|
4400
|
-
super({ ...defaults$
|
|
4401
|
+
super({ ...defaults$A, ...options });
|
|
4401
4402
|
}
|
|
4402
4403
|
static schema() {
|
|
4403
4404
|
return {
|
|
@@ -4565,14 +4566,14 @@ class CaseStyle {
|
|
|
4565
4566
|
}
|
|
4566
4567
|
}
|
|
4567
4568
|
|
|
4568
|
-
const defaults$
|
|
4569
|
+
const defaults$z = {
|
|
4569
4570
|
style: "lowercase",
|
|
4570
4571
|
ignoreForeign: true
|
|
4571
4572
|
};
|
|
4572
4573
|
class AttrCase extends Rule {
|
|
4573
4574
|
style;
|
|
4574
4575
|
constructor(options) {
|
|
4575
|
-
super({ ...defaults$
|
|
4576
|
+
super({ ...defaults$z, ...options });
|
|
4576
4577
|
this.style = new CaseStyle(this.options.style, "attr-case");
|
|
4577
4578
|
}
|
|
4578
4579
|
static schema() {
|
|
@@ -4988,7 +4989,7 @@ class AttrDelimiter extends Rule {
|
|
|
4988
4989
|
}
|
|
4989
4990
|
|
|
4990
4991
|
const DEFAULT_PATTERN = "[a-z0-9-:]+";
|
|
4991
|
-
const defaults$
|
|
4992
|
+
const defaults$y = {
|
|
4992
4993
|
pattern: DEFAULT_PATTERN,
|
|
4993
4994
|
ignoreForeign: true
|
|
4994
4995
|
};
|
|
@@ -5021,7 +5022,7 @@ function generateDescription(name, pattern) {
|
|
|
5021
5022
|
class AttrPattern extends Rule {
|
|
5022
5023
|
pattern;
|
|
5023
5024
|
constructor(options) {
|
|
5024
|
-
super({ ...defaults$
|
|
5025
|
+
super({ ...defaults$y, ...options });
|
|
5025
5026
|
this.pattern = generateRegexp(this.options.pattern);
|
|
5026
5027
|
}
|
|
5027
5028
|
static schema() {
|
|
@@ -5068,7 +5069,7 @@ class AttrPattern extends Rule {
|
|
|
5068
5069
|
}
|
|
5069
5070
|
}
|
|
5070
5071
|
|
|
5071
|
-
const defaults$
|
|
5072
|
+
const defaults$x = {
|
|
5072
5073
|
style: "auto",
|
|
5073
5074
|
unquoted: false
|
|
5074
5075
|
};
|
|
@@ -5134,7 +5135,7 @@ class AttrQuotes extends Rule {
|
|
|
5134
5135
|
};
|
|
5135
5136
|
}
|
|
5136
5137
|
constructor(options) {
|
|
5137
|
-
super({ ...defaults$
|
|
5138
|
+
super({ ...defaults$x, ...options });
|
|
5138
5139
|
this.style = parseStyle$3(this.options.style);
|
|
5139
5140
|
}
|
|
5140
5141
|
setup() {
|
|
@@ -5290,13 +5291,13 @@ class AttributeAllowedValues extends Rule {
|
|
|
5290
5291
|
}
|
|
5291
5292
|
}
|
|
5292
5293
|
|
|
5293
|
-
const defaults$
|
|
5294
|
+
const defaults$w = {
|
|
5294
5295
|
style: "omit"
|
|
5295
5296
|
};
|
|
5296
5297
|
class AttributeBooleanStyle extends Rule {
|
|
5297
5298
|
hasInvalidStyle;
|
|
5298
5299
|
constructor(options) {
|
|
5299
|
-
super({ ...defaults$
|
|
5300
|
+
super({ ...defaults$w, ...options });
|
|
5300
5301
|
this.hasInvalidStyle = parseStyle$2(this.options.style);
|
|
5301
5302
|
}
|
|
5302
5303
|
static schema() {
|
|
@@ -5366,13 +5367,13 @@ function reportMessage$1(attr, style) {
|
|
|
5366
5367
|
return "";
|
|
5367
5368
|
}
|
|
5368
5369
|
|
|
5369
|
-
const defaults$
|
|
5370
|
+
const defaults$v = {
|
|
5370
5371
|
style: "omit"
|
|
5371
5372
|
};
|
|
5372
5373
|
class AttributeEmptyStyle extends Rule {
|
|
5373
5374
|
hasInvalidStyle;
|
|
5374
5375
|
constructor(options) {
|
|
5375
|
-
super({ ...defaults$
|
|
5376
|
+
super({ ...defaults$v, ...options });
|
|
5376
5377
|
this.hasInvalidStyle = parseStyle$1(this.options.style);
|
|
5377
5378
|
}
|
|
5378
5379
|
static schema() {
|
|
@@ -5489,7 +5490,7 @@ class AttributeMisuse extends Rule {
|
|
|
5489
5490
|
}
|
|
5490
5491
|
}
|
|
5491
5492
|
|
|
5492
|
-
const defaults$
|
|
5493
|
+
const defaults$u = {
|
|
5493
5494
|
preferred: void 0
|
|
5494
5495
|
};
|
|
5495
5496
|
function isPasswordInput(event) {
|
|
@@ -5506,7 +5507,7 @@ function isGroupingToken(token) {
|
|
|
5506
5507
|
class AutocompletePassword extends Rule {
|
|
5507
5508
|
preferred;
|
|
5508
5509
|
constructor(options) {
|
|
5509
|
-
super({ ...defaults$
|
|
5510
|
+
super({ ...defaults$u, ...options });
|
|
5510
5511
|
this.preferred = options.preferred?.toLowerCase();
|
|
5511
5512
|
}
|
|
5512
5513
|
static schema() {
|
|
@@ -5585,21 +5586,19 @@ class AutocompletePassword extends Rule {
|
|
|
5585
5586
|
});
|
|
5586
5587
|
return;
|
|
5587
5588
|
}
|
|
5588
|
-
if (preferred) {
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
});
|
|
5602
|
-
}
|
|
5589
|
+
if (preferred && value !== preferred) {
|
|
5590
|
+
const context = {
|
|
5591
|
+
kind: "preferred-mismatch",
|
|
5592
|
+
value,
|
|
5593
|
+
preferred
|
|
5594
|
+
};
|
|
5595
|
+
this.report({
|
|
5596
|
+
node: target,
|
|
5597
|
+
message: `<input type="password"> should use autocomplete="${preferred}"`,
|
|
5598
|
+
/* eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- location must be present if value is */
|
|
5599
|
+
location,
|
|
5600
|
+
context
|
|
5601
|
+
});
|
|
5603
5602
|
}
|
|
5604
5603
|
});
|
|
5605
5604
|
}
|
|
@@ -5736,7 +5735,7 @@ class BasePatternRule extends Rule {
|
|
|
5736
5735
|
}
|
|
5737
5736
|
}
|
|
5738
5737
|
|
|
5739
|
-
const defaults$
|
|
5738
|
+
const defaults$t = {
|
|
5740
5739
|
pattern: "kebabcase"
|
|
5741
5740
|
};
|
|
5742
5741
|
class ClassPattern extends BasePatternRule {
|
|
@@ -5744,7 +5743,7 @@ class ClassPattern extends BasePatternRule {
|
|
|
5744
5743
|
super({
|
|
5745
5744
|
ruleId: "class-pattern",
|
|
5746
5745
|
attr: "class",
|
|
5747
|
-
options: { ...defaults$
|
|
5746
|
+
options: { ...defaults$t, ...options },
|
|
5748
5747
|
allowedPatterns: patternNames
|
|
5749
5748
|
// allow all patterns
|
|
5750
5749
|
});
|
|
@@ -5894,13 +5893,13 @@ class CloseOrder extends Rule {
|
|
|
5894
5893
|
}
|
|
5895
5894
|
}
|
|
5896
5895
|
|
|
5897
|
-
const defaults$
|
|
5896
|
+
const defaults$s = {
|
|
5898
5897
|
include: null,
|
|
5899
5898
|
exclude: null
|
|
5900
5899
|
};
|
|
5901
5900
|
class Deprecated extends Rule {
|
|
5902
5901
|
constructor(options) {
|
|
5903
|
-
super({ ...defaults$
|
|
5902
|
+
super({ ...defaults$s, ...options });
|
|
5904
5903
|
}
|
|
5905
5904
|
static schema() {
|
|
5906
5905
|
return {
|
|
@@ -6012,7 +6011,7 @@ function quote(value, char = '"') {
|
|
|
6012
6011
|
return `${char}${value}${char}`;
|
|
6013
6012
|
}
|
|
6014
6013
|
|
|
6015
|
-
const defaults$
|
|
6014
|
+
const defaults$r = {
|
|
6016
6015
|
classes: []
|
|
6017
6016
|
};
|
|
6018
6017
|
function isRelevant$6(event) {
|
|
@@ -6066,7 +6065,7 @@ ${listItems.join("\n")}`);
|
|
|
6066
6065
|
class DeprecatedClass extends Rule {
|
|
6067
6066
|
deprecatedMap;
|
|
6068
6067
|
constructor(options) {
|
|
6069
|
-
super({ ...defaults$
|
|
6068
|
+
super({ ...defaults$r, ...options });
|
|
6070
6069
|
const { classes } = this.options;
|
|
6071
6070
|
this.deprecatedMap = new Map(classes.map((entry) => [entry.class, normalizeEntry(entry)]));
|
|
6072
6071
|
}
|
|
@@ -6185,12 +6184,12 @@ let NoStyleTag$1 = class NoStyleTag extends Rule {
|
|
|
6185
6184
|
}
|
|
6186
6185
|
};
|
|
6187
6186
|
|
|
6188
|
-
const defaults$
|
|
6187
|
+
const defaults$q = {
|
|
6189
6188
|
style: "uppercase"
|
|
6190
6189
|
};
|
|
6191
6190
|
class DoctypeStyle extends Rule {
|
|
6192
6191
|
constructor(options) {
|
|
6193
|
-
super({ ...defaults$
|
|
6192
|
+
super({ ...defaults$q, ...options });
|
|
6194
6193
|
}
|
|
6195
6194
|
static schema() {
|
|
6196
6195
|
return {
|
|
@@ -6218,13 +6217,13 @@ class DoctypeStyle extends Rule {
|
|
|
6218
6217
|
}
|
|
6219
6218
|
}
|
|
6220
6219
|
|
|
6221
|
-
const defaults$
|
|
6220
|
+
const defaults$p = {
|
|
6222
6221
|
style: "lowercase"
|
|
6223
6222
|
};
|
|
6224
6223
|
class ElementCase extends Rule {
|
|
6225
6224
|
style;
|
|
6226
6225
|
constructor(options) {
|
|
6227
|
-
super({ ...defaults$
|
|
6226
|
+
super({ ...defaults$p, ...options });
|
|
6228
6227
|
this.style = new CaseStyle(this.options.style, "element-case");
|
|
6229
6228
|
}
|
|
6230
6229
|
static schema() {
|
|
@@ -6284,7 +6283,7 @@ class ElementCase extends Rule {
|
|
|
6284
6283
|
}
|
|
6285
6284
|
}
|
|
6286
6285
|
|
|
6287
|
-
const defaults$
|
|
6286
|
+
const defaults$o = {
|
|
6288
6287
|
pattern: "^[a-z][a-z0-9\\-._]*-[a-z0-9\\-._]*$",
|
|
6289
6288
|
whitelist: [],
|
|
6290
6289
|
blacklist: []
|
|
@@ -6292,7 +6291,7 @@ const defaults$n = {
|
|
|
6292
6291
|
class ElementName extends Rule {
|
|
6293
6292
|
pattern;
|
|
6294
6293
|
constructor(options) {
|
|
6295
|
-
super({ ...defaults$
|
|
6294
|
+
super({ ...defaults$o, ...options });
|
|
6296
6295
|
this.pattern = new RegExp(this.options.pattern);
|
|
6297
6296
|
}
|
|
6298
6297
|
static schema() {
|
|
@@ -6329,7 +6328,7 @@ class ElementName extends Rule {
|
|
|
6329
6328
|
...context.blacklist.map((cur) => `- ${cur}`)
|
|
6330
6329
|
];
|
|
6331
6330
|
}
|
|
6332
|
-
if (context.pattern !== defaults$
|
|
6331
|
+
if (context.pattern !== defaults$o.pattern) {
|
|
6333
6332
|
return [
|
|
6334
6333
|
`<${context.tagName}> is not a valid element name. This project is configured to only allow names matching the following regular expression:`,
|
|
6335
6334
|
"",
|
|
@@ -6361,13 +6360,13 @@ class ElementName extends Rule {
|
|
|
6361
6360
|
if (target.meta) {
|
|
6362
6361
|
return;
|
|
6363
6362
|
}
|
|
6364
|
-
if (xmlns.
|
|
6363
|
+
if (xmlns.test(tagName)) {
|
|
6365
6364
|
return;
|
|
6366
6365
|
}
|
|
6367
6366
|
if (this.options.whitelist.includes(tagName)) {
|
|
6368
6367
|
return;
|
|
6369
6368
|
}
|
|
6370
|
-
if (!
|
|
6369
|
+
if (!this.pattern.test(tagName)) {
|
|
6371
6370
|
this.report(target, `<${tagName}> is not a valid element name`, location, context);
|
|
6372
6371
|
}
|
|
6373
6372
|
});
|
|
@@ -6626,7 +6625,7 @@ class ElementPermittedParent extends Rule {
|
|
|
6626
6625
|
}
|
|
6627
6626
|
|
|
6628
6627
|
function isTagnameOnly(value) {
|
|
6629
|
-
return
|
|
6628
|
+
return /^[a-zA-Z0-9-]+$/.test(value);
|
|
6630
6629
|
}
|
|
6631
6630
|
function getRuleDescription(context) {
|
|
6632
6631
|
const escaped = context.ancestor.map((it) => `\`${it}\``);
|
|
@@ -6846,7 +6845,7 @@ class EmptyTitle extends Rule {
|
|
|
6846
6845
|
}
|
|
6847
6846
|
}
|
|
6848
6847
|
|
|
6849
|
-
const defaults$
|
|
6848
|
+
const defaults$n = {
|
|
6850
6849
|
allowArrayBrackets: true,
|
|
6851
6850
|
allowCheckboxDefault: true,
|
|
6852
6851
|
shared: ["radio", "button", "reset", "submit"]
|
|
@@ -6913,7 +6912,7 @@ function getDocumentation(context) {
|
|
|
6913
6912
|
}
|
|
6914
6913
|
class FormDupName extends Rule {
|
|
6915
6914
|
constructor(options) {
|
|
6916
|
-
super({ ...defaults$
|
|
6915
|
+
super({ ...defaults$n, ...options });
|
|
6917
6916
|
}
|
|
6918
6917
|
static schema() {
|
|
6919
6918
|
return {
|
|
@@ -7072,7 +7071,7 @@ class FormDupName extends Rule {
|
|
|
7072
7071
|
}
|
|
7073
7072
|
}
|
|
7074
7073
|
|
|
7075
|
-
const defaults$
|
|
7074
|
+
const defaults$m = {
|
|
7076
7075
|
allowMultipleH1: false,
|
|
7077
7076
|
minInitialRank: "h1",
|
|
7078
7077
|
sectioningRoots: ["dialog", '[role="dialog"]', '[role="alertdialog"]']
|
|
@@ -7104,7 +7103,7 @@ class HeadingLevel extends Rule {
|
|
|
7104
7103
|
sectionRoots;
|
|
7105
7104
|
stack = [];
|
|
7106
7105
|
constructor(options) {
|
|
7107
|
-
super({ ...defaults$
|
|
7106
|
+
super({ ...defaults$m, ...options });
|
|
7108
7107
|
this.minInitialRank = parseMaxInitial(this.options.minInitialRank);
|
|
7109
7108
|
this.sectionRoots = this.options.sectioningRoots.map((it) => new Compound(it));
|
|
7110
7109
|
this.stack.push({
|
|
@@ -7343,7 +7342,7 @@ class HiddenFocusable extends Rule {
|
|
|
7343
7342
|
}
|
|
7344
7343
|
}
|
|
7345
7344
|
|
|
7346
|
-
const defaults$
|
|
7345
|
+
const defaults$l = {
|
|
7347
7346
|
pattern: "kebabcase"
|
|
7348
7347
|
};
|
|
7349
7348
|
function exclude$1(set, ...values) {
|
|
@@ -7359,7 +7358,7 @@ class IdPattern extends BasePatternRule {
|
|
|
7359
7358
|
super({
|
|
7360
7359
|
ruleId: "id-pattern",
|
|
7361
7360
|
attr: "id",
|
|
7362
|
-
options: { ...defaults$
|
|
7361
|
+
options: { ...defaults$l, ...options },
|
|
7363
7362
|
allowedPatterns
|
|
7364
7363
|
});
|
|
7365
7364
|
}
|
|
@@ -7681,13 +7680,13 @@ function findLabelByParent(el) {
|
|
|
7681
7680
|
return [];
|
|
7682
7681
|
}
|
|
7683
7682
|
|
|
7684
|
-
const defaults$
|
|
7683
|
+
const defaults$k = {
|
|
7685
7684
|
maxlength: 70
|
|
7686
7685
|
};
|
|
7687
7686
|
class LongTitle extends Rule {
|
|
7688
7687
|
maxlength;
|
|
7689
7688
|
constructor(options) {
|
|
7690
|
-
super({ ...defaults$
|
|
7689
|
+
super({ ...defaults$k, ...options });
|
|
7691
7690
|
this.maxlength = this.options.maxlength;
|
|
7692
7691
|
}
|
|
7693
7692
|
static schema() {
|
|
@@ -7791,12 +7790,12 @@ class MapIdName extends Rule {
|
|
|
7791
7790
|
}
|
|
7792
7791
|
}
|
|
7793
7792
|
|
|
7794
|
-
const defaults$
|
|
7793
|
+
const defaults$j = {
|
|
7795
7794
|
allowLongDelay: false
|
|
7796
7795
|
};
|
|
7797
7796
|
class MetaRefresh extends Rule {
|
|
7798
7797
|
constructor(options) {
|
|
7799
|
-
super({ ...defaults$
|
|
7798
|
+
super({ ...defaults$j, ...options });
|
|
7800
7799
|
}
|
|
7801
7800
|
documentation() {
|
|
7802
7801
|
return {
|
|
@@ -7907,7 +7906,7 @@ class MultipleLabeledControls extends Rule {
|
|
|
7907
7906
|
}
|
|
7908
7907
|
}
|
|
7909
7908
|
|
|
7910
|
-
const defaults$
|
|
7909
|
+
const defaults$i = {
|
|
7911
7910
|
pattern: "camelcase"
|
|
7912
7911
|
};
|
|
7913
7912
|
function exclude(set, ...values) {
|
|
@@ -7923,7 +7922,7 @@ class NamePattern extends BasePatternRule {
|
|
|
7923
7922
|
super({
|
|
7924
7923
|
ruleId: "name-pattern",
|
|
7925
7924
|
attr: "name",
|
|
7926
|
-
options: { ...defaults$
|
|
7925
|
+
options: { ...defaults$i, ...options },
|
|
7927
7926
|
allowedPatterns
|
|
7928
7927
|
});
|
|
7929
7928
|
}
|
|
@@ -8014,13 +8013,13 @@ class NoAbstractRole extends Rule {
|
|
|
8014
8013
|
}
|
|
8015
8014
|
}
|
|
8016
8015
|
|
|
8017
|
-
const defaults$
|
|
8016
|
+
const defaults$h = {
|
|
8018
8017
|
include: null,
|
|
8019
8018
|
exclude: null
|
|
8020
8019
|
};
|
|
8021
8020
|
class NoAutoplay extends Rule {
|
|
8022
8021
|
constructor(options) {
|
|
8023
|
-
super({ ...defaults$
|
|
8022
|
+
super({ ...defaults$h, ...options });
|
|
8024
8023
|
}
|
|
8025
8024
|
documentation(context) {
|
|
8026
8025
|
return {
|
|
@@ -8341,14 +8340,14 @@ class NoImplicitInputType extends Rule {
|
|
|
8341
8340
|
}
|
|
8342
8341
|
}
|
|
8343
8342
|
|
|
8344
|
-
const defaults$
|
|
8343
|
+
const defaults$g = {
|
|
8345
8344
|
include: null,
|
|
8346
8345
|
exclude: null,
|
|
8347
8346
|
allowedProperties: ["display"]
|
|
8348
8347
|
};
|
|
8349
8348
|
class NoInlineStyle extends Rule {
|
|
8350
8349
|
constructor(options) {
|
|
8351
|
-
super({ ...defaults$
|
|
8350
|
+
super({ ...defaults$g, ...options });
|
|
8352
8351
|
}
|
|
8353
8352
|
static schema() {
|
|
8354
8353
|
return {
|
|
@@ -8534,7 +8533,7 @@ class NoMultipleMain extends Rule {
|
|
|
8534
8533
|
}
|
|
8535
8534
|
}
|
|
8536
8535
|
|
|
8537
|
-
const defaults$
|
|
8536
|
+
const defaults$f = {
|
|
8538
8537
|
relaxed: false
|
|
8539
8538
|
};
|
|
8540
8539
|
const textRegexp = /([<>]|&(?![a-zA-Z0-9#]+;))/g;
|
|
@@ -8552,7 +8551,7 @@ const replacementTable = {
|
|
|
8552
8551
|
class NoRawCharacters extends Rule {
|
|
8553
8552
|
relaxed;
|
|
8554
8553
|
constructor(options) {
|
|
8555
|
-
super({ ...defaults$
|
|
8554
|
+
super({ ...defaults$f, ...options });
|
|
8556
8555
|
this.relaxed = this.options.relaxed;
|
|
8557
8556
|
}
|
|
8558
8557
|
static schema() {
|
|
@@ -8578,7 +8577,7 @@ class NoRawCharacters extends Rule {
|
|
|
8578
8577
|
if (child.nodeType !== NodeType.TEXT_NODE) {
|
|
8579
8578
|
continue;
|
|
8580
8579
|
}
|
|
8581
|
-
if (matchTemplate.
|
|
8580
|
+
if (matchTemplate.test(child.textContent)) {
|
|
8582
8581
|
continue;
|
|
8583
8582
|
}
|
|
8584
8583
|
this.findRawChars(node, child.textContent, child.location, textRegexp);
|
|
@@ -8691,7 +8690,14 @@ class NoRedundantFor extends Rule {
|
|
|
8691
8690
|
}
|
|
8692
8691
|
}
|
|
8693
8692
|
|
|
8693
|
+
const defaults$e = {
|
|
8694
|
+
include: null,
|
|
8695
|
+
exclude: null
|
|
8696
|
+
};
|
|
8694
8697
|
class NoRedundantRole extends Rule {
|
|
8698
|
+
constructor(options) {
|
|
8699
|
+
super({ ...defaults$e, ...options });
|
|
8700
|
+
}
|
|
8695
8701
|
documentation(context) {
|
|
8696
8702
|
const { role, tagName } = context;
|
|
8697
8703
|
return {
|
|
@@ -8699,6 +8705,36 @@ class NoRedundantRole extends Rule {
|
|
|
8699
8705
|
url: "https://html-validate.org/rules/no-redundant-role.html"
|
|
8700
8706
|
};
|
|
8701
8707
|
}
|
|
8708
|
+
static schema() {
|
|
8709
|
+
return {
|
|
8710
|
+
exclude: {
|
|
8711
|
+
anyOf: [
|
|
8712
|
+
{
|
|
8713
|
+
items: {
|
|
8714
|
+
type: "string"
|
|
8715
|
+
},
|
|
8716
|
+
type: "array"
|
|
8717
|
+
},
|
|
8718
|
+
{
|
|
8719
|
+
type: "null"
|
|
8720
|
+
}
|
|
8721
|
+
]
|
|
8722
|
+
},
|
|
8723
|
+
include: {
|
|
8724
|
+
anyOf: [
|
|
8725
|
+
{
|
|
8726
|
+
items: {
|
|
8727
|
+
type: "string"
|
|
8728
|
+
},
|
|
8729
|
+
type: "array"
|
|
8730
|
+
},
|
|
8731
|
+
{
|
|
8732
|
+
type: "null"
|
|
8733
|
+
}
|
|
8734
|
+
]
|
|
8735
|
+
}
|
|
8736
|
+
};
|
|
8737
|
+
}
|
|
8702
8738
|
setup() {
|
|
8703
8739
|
this.on("tag:ready", (event) => {
|
|
8704
8740
|
const { target } = event;
|
|
@@ -8717,6 +8753,9 @@ class NoRedundantRole extends Rule {
|
|
|
8717
8753
|
if (role.value !== implicitRole) {
|
|
8718
8754
|
return;
|
|
8719
8755
|
}
|
|
8756
|
+
if (this.isKeywordIgnored(role.value)) {
|
|
8757
|
+
return;
|
|
8758
|
+
}
|
|
8720
8759
|
const context = {
|
|
8721
8760
|
tagName: target.tagName,
|
|
8722
8761
|
role: role.value
|
|
@@ -8773,7 +8812,7 @@ class NoSelfClosing extends Rule {
|
|
|
8773
8812
|
}
|
|
8774
8813
|
}
|
|
8775
8814
|
function isRelevant(node, options) {
|
|
8776
|
-
if (xmlns.
|
|
8815
|
+
if (xmlns.test(node.tagName)) {
|
|
8777
8816
|
return !options.ignoreXML;
|
|
8778
8817
|
}
|
|
8779
8818
|
if (!node.meta) {
|
|
@@ -8831,7 +8870,7 @@ class NoTrailingWhitespace extends Rule {
|
|
|
8831
8870
|
}
|
|
8832
8871
|
setup() {
|
|
8833
8872
|
this.on("whitespace", (event) => {
|
|
8834
|
-
if (/^[ \t]+\r?\n$/.
|
|
8873
|
+
if (/^[ \t]+\r?\n$/.test(event.text)) {
|
|
8835
8874
|
this.report(null, "Trailing whitespace", event.location);
|
|
8836
8875
|
}
|
|
8837
8876
|
});
|
|
@@ -8910,7 +8949,7 @@ class NoUnusedDisable extends Rule {
|
|
|
8910
8949
|
const tokens = new DOMTokenList(options.replaceAll(",", " "), location);
|
|
8911
8950
|
for (const ruleId of unused) {
|
|
8912
8951
|
const index = tokens.indexOf(ruleId);
|
|
8913
|
-
const tokenLocation = index
|
|
8952
|
+
const tokenLocation = index !== -1 ? tokens.location(index) : location;
|
|
8914
8953
|
this.report({
|
|
8915
8954
|
node: null,
|
|
8916
8955
|
message: '"{{ ruleId }}" rule is disabled but no error was reported',
|
|
@@ -9158,7 +9197,7 @@ class PreferTbody extends Rule {
|
|
|
9158
9197
|
continue;
|
|
9159
9198
|
}
|
|
9160
9199
|
const tr = table.querySelectorAll("> tr");
|
|
9161
|
-
if (tr.length
|
|
9200
|
+
if (tr.length > 0) {
|
|
9162
9201
|
this.report(tr[0], "Prefer to wrap <tr> elements in <tbody>");
|
|
9163
9202
|
}
|
|
9164
9203
|
}
|
|
@@ -10567,7 +10606,7 @@ class ValidID extends Rule {
|
|
|
10567
10606
|
this.report(event.target, this.messages[context.kind], event.location, context);
|
|
10568
10607
|
return;
|
|
10569
10608
|
}
|
|
10570
|
-
if (/\s/.
|
|
10609
|
+
if (/\s/.test(value)) {
|
|
10571
10610
|
const context = { kind: 2 /* WHITESPACE */, id: value };
|
|
10572
10611
|
this.report(event.target, this.messages[context.kind], event.valueLocation, context);
|
|
10573
10612
|
return;
|
|
@@ -10576,12 +10615,12 @@ class ValidID extends Rule {
|
|
|
10576
10615
|
if (relaxed) {
|
|
10577
10616
|
return;
|
|
10578
10617
|
}
|
|
10579
|
-
if (/^[^\p{L}]/u.
|
|
10618
|
+
if (/^[^\p{L}]/u.test(value)) {
|
|
10580
10619
|
const context = { kind: 3 /* LEADING_CHARACTER */, id: value };
|
|
10581
10620
|
this.report(event.target, this.messages[context.kind], event.valueLocation, context);
|
|
10582
10621
|
return;
|
|
10583
10622
|
}
|
|
10584
|
-
if (/[^\p{L}\p{N}_-]/u.
|
|
10623
|
+
if (/[^\p{L}\p{N}_-]/u.test(value)) {
|
|
10585
10624
|
const context = { kind: 4 /* DISALLOWED_CHARACTER */, id: value };
|
|
10586
10625
|
this.report(event.target, this.messages[context.kind], event.valueLocation, context);
|
|
10587
10626
|
}
|
|
@@ -10942,7 +10981,7 @@ function isSimpleTable(table) {
|
|
|
10942
10981
|
}
|
|
10943
10982
|
const shape = getShape(cells);
|
|
10944
10983
|
const headersPerRow = cells.map((row) => row.reduce((sum, cell) => sum + cell, 0));
|
|
10945
|
-
const headersPerColumn = Array(shape.cols).fill(0).map((_, index) => {
|
|
10984
|
+
const headersPerColumn = new Array(shape.cols).fill(0).map((_, index) => {
|
|
10946
10985
|
return cells.reduce((sum, it) => sum + it[index], 0);
|
|
10947
10986
|
});
|
|
10948
10987
|
const [firstRow, ...otherRows] = headersPerRow;
|
|
@@ -12464,7 +12503,7 @@ class EventHandler {
|
|
|
12464
12503
|
}
|
|
12465
12504
|
|
|
12466
12505
|
const name = "html-validate";
|
|
12467
|
-
const version = "10.
|
|
12506
|
+
const version = "10.11.1";
|
|
12468
12507
|
const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
|
|
12469
12508
|
|
|
12470
12509
|
function freeze(src) {
|
|
@@ -13705,7 +13744,7 @@ async function transformSource(resolvers, config, source, filename) {
|
|
|
13705
13744
|
}
|
|
13706
13745
|
};
|
|
13707
13746
|
if (!transformer) {
|
|
13708
|
-
return
|
|
13747
|
+
return [source];
|
|
13709
13748
|
}
|
|
13710
13749
|
const fn = transformer.kind === "import" ? await getCachedTransformerFunction(cache, resolvers, transformer.name, config.getPlugins()) : transformer.function;
|
|
13711
13750
|
const name = transformer.kind === "import" ? transformer.name : transformer.function.name;
|