html-validate 8.18.1 → 8.19.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.
- package/dist/cjs/cli.js +1 -1
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/core.js +103 -67
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/elements.js +1 -3
- package/dist/cjs/elements.js.map +1 -1
- package/dist/cjs/tsdoc-metadata.json +1 -1
- package/dist/es/cli.js +1 -1
- package/dist/es/cli.js.map +1 -1
- package/dist/es/core.js +103 -67
- package/dist/es/core.js.map +1 -1
- package/dist/es/elements.js +1 -3
- package/dist/es/elements.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +17 -17
package/dist/cjs/core.js
CHANGED
|
@@ -7,7 +7,7 @@ var utils_naturalJoin = require('./utils/natural-join.js');
|
|
|
7
7
|
var fs = require('fs');
|
|
8
8
|
var codeFrame = require('@babel/code-frame');
|
|
9
9
|
var kleur = require('kleur');
|
|
10
|
-
var stylish$
|
|
10
|
+
var stylish$1 = require('@html-validate/stylish');
|
|
11
11
|
var semver = require('semver');
|
|
12
12
|
|
|
13
13
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -1479,6 +1479,9 @@ class DynamicValue {
|
|
|
1479
1479
|
}
|
|
1480
1480
|
}
|
|
1481
1481
|
|
|
1482
|
+
function isDynamicAttribute(attr) {
|
|
1483
|
+
return Boolean(attr == null ? void 0 : attr.isDynamic);
|
|
1484
|
+
}
|
|
1482
1485
|
class Attribute {
|
|
1483
1486
|
/**
|
|
1484
1487
|
* @param key - Attribute name.
|
|
@@ -1720,7 +1723,8 @@ class DOMNode {
|
|
|
1720
1723
|
}
|
|
1721
1724
|
}
|
|
1722
1725
|
cacheExists(key) {
|
|
1723
|
-
|
|
1726
|
+
var _a;
|
|
1727
|
+
return Boolean((_a = this.cache) == null ? void 0 : _a.has(key));
|
|
1724
1728
|
}
|
|
1725
1729
|
/**
|
|
1726
1730
|
* Get the text (recursive) from all child nodes.
|
|
@@ -2820,7 +2824,7 @@ class HtmlElement extends DOMNode {
|
|
|
2820
2824
|
}
|
|
2821
2825
|
function isClosed(endToken, meta) {
|
|
2822
2826
|
let closed = 0 /* Open */;
|
|
2823
|
-
if (meta
|
|
2827
|
+
if (meta == null ? void 0 : meta.void) {
|
|
2824
2828
|
closed = 2 /* VoidOmitted */;
|
|
2825
2829
|
}
|
|
2826
2830
|
if (endToken.data[0] === "/>") {
|
|
@@ -3466,7 +3470,7 @@ function isAriaHidden(node, details) {
|
|
|
3466
3470
|
function isHTMLHiddenImpl(node) {
|
|
3467
3471
|
const getHiddenAttr = (node2) => {
|
|
3468
3472
|
const hidden = node2.getAttribute("hidden");
|
|
3469
|
-
return hidden
|
|
3473
|
+
return Boolean(hidden == null ? void 0 : hidden.isStatic);
|
|
3470
3474
|
};
|
|
3471
3475
|
return {
|
|
3472
3476
|
byParent: node.parent ? isHTMLHidden(node.parent) : false,
|
|
@@ -3484,7 +3488,7 @@ function isHTMLHidden(node, details) {
|
|
|
3484
3488
|
function isInertImpl(node) {
|
|
3485
3489
|
const getInertAttr = (node2) => {
|
|
3486
3490
|
const inert = node2.getAttribute("inert");
|
|
3487
|
-
return inert
|
|
3491
|
+
return Boolean(inert == null ? void 0 : inert.isStatic);
|
|
3488
3492
|
};
|
|
3489
3493
|
return {
|
|
3490
3494
|
byParent: node.parent ? isInert(node.parent) : false,
|
|
@@ -3521,7 +3525,7 @@ function isPresentation(node) {
|
|
|
3521
3525
|
return Boolean(node.cacheGet(ROLE_PRESENTATION_CACHE));
|
|
3522
3526
|
}
|
|
3523
3527
|
const meta = node.meta;
|
|
3524
|
-
if (meta
|
|
3528
|
+
if (meta == null ? void 0 : meta.interactive) {
|
|
3525
3529
|
return node.cacheSet(ROLE_PRESENTATION_CACHE, false);
|
|
3526
3530
|
}
|
|
3527
3531
|
const tabindex = node.getAttribute("tabindex");
|
|
@@ -3955,10 +3959,11 @@ function parseAllow(value) {
|
|
|
3955
3959
|
};
|
|
3956
3960
|
}
|
|
3957
3961
|
function matchList(value, list) {
|
|
3962
|
+
var _a;
|
|
3958
3963
|
if (list.include && !list.include.some((it) => it.test(value))) {
|
|
3959
3964
|
return false;
|
|
3960
3965
|
}
|
|
3961
|
-
if (list.exclude
|
|
3966
|
+
if ((_a = list.exclude) == null ? void 0 : _a.some((it) => it.test(value))) {
|
|
3962
3967
|
return false;
|
|
3963
3968
|
}
|
|
3964
3969
|
return true;
|
|
@@ -4188,7 +4193,7 @@ class AreaAlt extends Rule {
|
|
|
4188
4193
|
const href = area.getAttribute("href");
|
|
4189
4194
|
const alt = area.getAttribute("alt");
|
|
4190
4195
|
if (href) {
|
|
4191
|
-
if (alt
|
|
4196
|
+
if (isDynamicAttribute(alt)) {
|
|
4192
4197
|
return;
|
|
4193
4198
|
}
|
|
4194
4199
|
const target = area.getAttributeValue("href");
|
|
@@ -4227,7 +4232,7 @@ class AriaHiddenBody extends Rule {
|
|
|
4227
4232
|
this.on("tag:ready", this.isRelevant, (event) => {
|
|
4228
4233
|
const { target } = event;
|
|
4229
4234
|
const attr = target.getAttribute("aria-hidden");
|
|
4230
|
-
if (!attr
|
|
4235
|
+
if (!(attr == null ? void 0 : attr.valueMatches("true", true))) {
|
|
4231
4236
|
return;
|
|
4232
4237
|
}
|
|
4233
4238
|
this.report(target, "aria-hidden must not be used on <body>", attr.keyLocation);
|
|
@@ -4449,8 +4454,9 @@ class AttrCase extends Rule {
|
|
|
4449
4454
|
});
|
|
4450
4455
|
}
|
|
4451
4456
|
isIgnored(node) {
|
|
4457
|
+
var _a;
|
|
4452
4458
|
if (this.options.ignoreForeign) {
|
|
4453
|
-
return Boolean(node.meta
|
|
4459
|
+
return Boolean((_a = node.meta) == null ? void 0 : _a.foreign);
|
|
4454
4460
|
} else {
|
|
4455
4461
|
return false;
|
|
4456
4462
|
}
|
|
@@ -4606,7 +4612,7 @@ class Lexer {
|
|
|
4606
4612
|
* Called when entering a new state.
|
|
4607
4613
|
*/
|
|
4608
4614
|
enter(context, state, data) {
|
|
4609
|
-
if (state === State.TAG && data
|
|
4615
|
+
if (state === State.TAG && (data == null ? void 0 : data[0].startsWith("<"))) {
|
|
4610
4616
|
if (data[0] === "<script") {
|
|
4611
4617
|
context.contentModel = ContentModel.SCRIPT;
|
|
4612
4618
|
} else if (data[0] === "<style") {
|
|
@@ -4823,8 +4829,9 @@ class AttrPattern extends Rule {
|
|
|
4823
4829
|
});
|
|
4824
4830
|
}
|
|
4825
4831
|
isIgnored(node) {
|
|
4832
|
+
var _a;
|
|
4826
4833
|
if (this.options.ignoreForeign) {
|
|
4827
|
-
return Boolean(node.meta
|
|
4834
|
+
return Boolean((_a = node.meta) == null ? void 0 : _a.foreign);
|
|
4828
4835
|
} else {
|
|
4829
4836
|
return false;
|
|
4830
4837
|
}
|
|
@@ -5823,6 +5830,7 @@ class ElementPermittedContent extends Rule {
|
|
|
5823
5830
|
return this.validatePermittedContentImpl(cur, parent, rules);
|
|
5824
5831
|
}
|
|
5825
5832
|
validatePermittedContentImpl(cur, parent, rules) {
|
|
5833
|
+
var _a;
|
|
5826
5834
|
if (!Validator.validatePermitted(cur, rules)) {
|
|
5827
5835
|
const child = `<${cur.tagName}>`;
|
|
5828
5836
|
const message = `${child} element is not permitted as content under ${parent.annotatedName}`;
|
|
@@ -5834,7 +5842,7 @@ class ElementPermittedContent extends Rule {
|
|
|
5834
5842
|
this.report(cur, message, null, context);
|
|
5835
5843
|
return true;
|
|
5836
5844
|
}
|
|
5837
|
-
if (cur.meta
|
|
5845
|
+
if ((_a = cur.meta) == null ? void 0 : _a.transparent) {
|
|
5838
5846
|
const children = getTransparentChildren(cur, cur.meta.transparent);
|
|
5839
5847
|
return children.map((child) => {
|
|
5840
5848
|
return this.validatePermittedContentImpl(child, parent, rules);
|
|
@@ -6216,6 +6224,7 @@ class EmptyTitle extends Rule {
|
|
|
6216
6224
|
|
|
6217
6225
|
const defaults$k = {
|
|
6218
6226
|
allowArrayBrackets: true,
|
|
6227
|
+
allowCheckboxDefault: true,
|
|
6219
6228
|
shared: ["radio", "button", "reset", "submit"]
|
|
6220
6229
|
};
|
|
6221
6230
|
const UNIQUE_CACHE_KEY = Symbol("form-elements-unique");
|
|
@@ -6225,7 +6234,26 @@ function haveName(name) {
|
|
|
6225
6234
|
}
|
|
6226
6235
|
function allowSharedName(node, shared) {
|
|
6227
6236
|
const type = node.getAttribute("type");
|
|
6228
|
-
return Boolean(type
|
|
6237
|
+
return Boolean(type == null ? void 0 : type.valueMatches(shared, false));
|
|
6238
|
+
}
|
|
6239
|
+
function isInputHidden(element) {
|
|
6240
|
+
return element.is("input") && element.getAttributeValue("type") === "hidden";
|
|
6241
|
+
}
|
|
6242
|
+
function isInputCheckbox(element) {
|
|
6243
|
+
return element.is("input") && element.getAttributeValue("type") === "checkbox";
|
|
6244
|
+
}
|
|
6245
|
+
function isCheckboxWithDefault(control, previous, options) {
|
|
6246
|
+
const { allowCheckboxDefault } = options;
|
|
6247
|
+
if (!allowCheckboxDefault) {
|
|
6248
|
+
return false;
|
|
6249
|
+
}
|
|
6250
|
+
if (!previous.potentialHiddenDefault) {
|
|
6251
|
+
return false;
|
|
6252
|
+
}
|
|
6253
|
+
if (!isInputCheckbox(control)) {
|
|
6254
|
+
return false;
|
|
6255
|
+
}
|
|
6256
|
+
return true;
|
|
6229
6257
|
}
|
|
6230
6258
|
function getDocumentation(context) {
|
|
6231
6259
|
const trailer = "Each form control must have a unique name.";
|
|
@@ -6249,6 +6277,9 @@ class FormDupName extends Rule {
|
|
|
6249
6277
|
allowArrayBrackets: {
|
|
6250
6278
|
type: "boolean"
|
|
6251
6279
|
},
|
|
6280
|
+
allowCheckboxDefault: {
|
|
6281
|
+
type: "boolean"
|
|
6282
|
+
},
|
|
6252
6283
|
shared: {
|
|
6253
6284
|
type: "array",
|
|
6254
6285
|
items: {
|
|
@@ -6314,14 +6345,20 @@ class FormDupName extends Rule {
|
|
|
6314
6345
|
}
|
|
6315
6346
|
if (!details && isarray) {
|
|
6316
6347
|
elements.set(basename, {
|
|
6317
|
-
array: true
|
|
6348
|
+
array: true,
|
|
6349
|
+
potentialHiddenDefault: false
|
|
6318
6350
|
});
|
|
6319
6351
|
}
|
|
6320
6352
|
if (isarray) {
|
|
6321
6353
|
return;
|
|
6322
6354
|
}
|
|
6323
6355
|
}
|
|
6324
|
-
|
|
6356
|
+
const previous = elements.get(name);
|
|
6357
|
+
if (previous) {
|
|
6358
|
+
if (isCheckboxWithDefault(control, previous, this.options)) {
|
|
6359
|
+
previous.potentialHiddenDefault = false;
|
|
6360
|
+
return;
|
|
6361
|
+
}
|
|
6325
6362
|
const context = {
|
|
6326
6363
|
name,
|
|
6327
6364
|
kind: "duplicate"
|
|
@@ -6334,7 +6371,8 @@ class FormDupName extends Rule {
|
|
|
6334
6371
|
});
|
|
6335
6372
|
} else {
|
|
6336
6373
|
elements.set(name, {
|
|
6337
|
-
array: false
|
|
6374
|
+
array: false,
|
|
6375
|
+
potentialHiddenDefault: isInputHidden(control)
|
|
6338
6376
|
});
|
|
6339
6377
|
}
|
|
6340
6378
|
}
|
|
@@ -6397,8 +6435,9 @@ const defaults$j = {
|
|
|
6397
6435
|
sectioningRoots: ["dialog", '[role="dialog"]', '[role="alertdialog"]']
|
|
6398
6436
|
};
|
|
6399
6437
|
function isRelevant$6(event) {
|
|
6438
|
+
var _a;
|
|
6400
6439
|
const node = event.target;
|
|
6401
|
-
return Boolean(node.meta
|
|
6440
|
+
return Boolean((_a = node.meta) == null ? void 0 : _a.heading);
|
|
6402
6441
|
}
|
|
6403
6442
|
function extractLevel(node) {
|
|
6404
6443
|
const match = node.tagName.match(/^[hH](\d)$/);
|
|
@@ -6814,7 +6853,7 @@ class InputAttributes extends Rule {
|
|
|
6814
6853
|
const HAS_ACCESSIBLE_TEXT_CACHE = Symbol(hasAccessibleName.name);
|
|
6815
6854
|
function isHidden(node, context) {
|
|
6816
6855
|
const { reference } = context;
|
|
6817
|
-
if (reference
|
|
6856
|
+
if (reference == null ? void 0 : reference.isSameNode(node)) {
|
|
6818
6857
|
return false;
|
|
6819
6858
|
} else {
|
|
6820
6859
|
return !inAccessibilityTree(node);
|
|
@@ -6866,7 +6905,7 @@ function hasAccessibleNameImpl(current, context) {
|
|
|
6866
6905
|
if (isHidden(current, context)) {
|
|
6867
6906
|
return false;
|
|
6868
6907
|
}
|
|
6869
|
-
const ignoreHiddenRoot = Boolean(reference
|
|
6908
|
+
const ignoreHiddenRoot = Boolean(reference == null ? void 0 : reference.isSameNode(current));
|
|
6870
6909
|
const text = classifyNodeText(current, { accessible: true, ignoreHiddenRoot });
|
|
6871
6910
|
if (text !== TextClassification.EMPTY_TEXT) {
|
|
6872
6911
|
return true;
|
|
@@ -7187,20 +7226,23 @@ class MultipleLabeledControls extends Rule {
|
|
|
7187
7226
|
}
|
|
7188
7227
|
setup() {
|
|
7189
7228
|
this.labelable = this.getTagsWithProperty("labelable").join(",");
|
|
7190
|
-
this.on("
|
|
7191
|
-
const {
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7229
|
+
this.on("dom:ready", (event) => {
|
|
7230
|
+
const { document } = event;
|
|
7231
|
+
const labels = document.querySelectorAll("label");
|
|
7232
|
+
for (const label of labels) {
|
|
7233
|
+
const numControls = this.getNumLabledControls(label);
|
|
7234
|
+
if (numControls <= 1) {
|
|
7235
|
+
continue;
|
|
7236
|
+
}
|
|
7237
|
+
this.report(label, "<label> is associated with multiple controls", label.location);
|
|
7198
7238
|
}
|
|
7199
|
-
this.report(target, "<label> is associated with multiple controls", target.location);
|
|
7200
7239
|
});
|
|
7201
7240
|
}
|
|
7202
7241
|
getNumLabledControls(src) {
|
|
7203
|
-
const controls = src.querySelectorAll(this.labelable).
|
|
7242
|
+
const controls = src.querySelectorAll(this.labelable).filter((node) => {
|
|
7243
|
+
var _a;
|
|
7244
|
+
return (_a = node.meta) == null ? void 0 : _a.labelable;
|
|
7245
|
+
}).map((node) => node.id);
|
|
7204
7246
|
const attr = src.getAttribute("for");
|
|
7205
7247
|
if (!attr || attr.isDynamic || !attr.value) {
|
|
7206
7248
|
return controls.length;
|
|
@@ -7711,7 +7753,7 @@ class NoInlineStyle extends Rule {
|
|
|
7711
7753
|
if (include && !include.includes(key)) {
|
|
7712
7754
|
return false;
|
|
7713
7755
|
}
|
|
7714
|
-
if (exclude
|
|
7756
|
+
if (exclude == null ? void 0 : exclude.includes(key)) {
|
|
7715
7757
|
return false;
|
|
7716
7758
|
}
|
|
7717
7759
|
return true;
|
|
@@ -8766,7 +8808,7 @@ class TelNonBreaking extends Rule {
|
|
|
8766
8808
|
return false;
|
|
8767
8809
|
}
|
|
8768
8810
|
const attr = target.getAttribute("href");
|
|
8769
|
-
if (!attr
|
|
8811
|
+
if (!(attr == null ? void 0 : attr.valueMatches(/^tel:/, false))) {
|
|
8770
8812
|
return false;
|
|
8771
8813
|
}
|
|
8772
8814
|
return true;
|
|
@@ -8820,7 +8862,7 @@ class TelNonBreaking extends Rule {
|
|
|
8820
8862
|
|
|
8821
8863
|
function hasNonEmptyAttribute(node, key) {
|
|
8822
8864
|
const attr = node.getAttribute(key);
|
|
8823
|
-
return Boolean(attr
|
|
8865
|
+
return Boolean(attr == null ? void 0 : attr.valueMatches(/.+/, true));
|
|
8824
8866
|
}
|
|
8825
8867
|
function hasDefaultText(node) {
|
|
8826
8868
|
if (!node.is("input")) {
|
|
@@ -8830,7 +8872,7 @@ function hasDefaultText(node) {
|
|
|
8830
8872
|
return false;
|
|
8831
8873
|
}
|
|
8832
8874
|
const type = node.getAttribute("type");
|
|
8833
|
-
return Boolean(type
|
|
8875
|
+
return Boolean(type == null ? void 0 : type.valueMatches(/submit|reset/, false));
|
|
8834
8876
|
}
|
|
8835
8877
|
function isNonEmptyText(node) {
|
|
8836
8878
|
if (isTextNode(node)) {
|
|
@@ -9744,7 +9786,7 @@ class ValidID extends Rule {
|
|
|
9744
9786
|
const message = this.messages[context].replace("id", "ID").replace(/^(.)/, (m) => m.toUpperCase());
|
|
9745
9787
|
const relaxedDescription = relaxed ? [] : [
|
|
9746
9788
|
" - ID must begin with a letter",
|
|
9747
|
-
" - ID must only contain
|
|
9789
|
+
" - ID must only contain letters, digits, `-` and `_`"
|
|
9748
9790
|
];
|
|
9749
9791
|
return {
|
|
9750
9792
|
description: [
|
|
@@ -9779,12 +9821,12 @@ class ValidID extends Rule {
|
|
|
9779
9821
|
if (relaxed) {
|
|
9780
9822
|
return;
|
|
9781
9823
|
}
|
|
9782
|
-
if (value.match(/^[
|
|
9824
|
+
if (value.match(/^[^\p{L}]/u)) {
|
|
9783
9825
|
const context = 3 /* LEADING_CHARACTER */;
|
|
9784
9826
|
this.report(event.target, this.messages[context], event.valueLocation, context);
|
|
9785
9827
|
return;
|
|
9786
9828
|
}
|
|
9787
|
-
if (value.match(/[
|
|
9829
|
+
if (value.match(/[^\p{L}\p{N}_-]/u)) {
|
|
9788
9830
|
const context = 4 /* DISALLOWED_CHARACTER */;
|
|
9789
9831
|
this.report(event.target, this.messages[context], event.valueLocation, context);
|
|
9790
9832
|
}
|
|
@@ -9795,7 +9837,7 @@ class ValidID extends Rule {
|
|
|
9795
9837
|
[1 /* EMPTY */]: "element id must not be empty",
|
|
9796
9838
|
[2 /* WHITESPACE */]: "element id must not contain whitespace",
|
|
9797
9839
|
[3 /* LEADING_CHARACTER */]: "element id must begin with a letter",
|
|
9798
|
-
[4 /* DISALLOWED_CHARACTER */]: "element id must only contain
|
|
9840
|
+
[4 /* DISALLOWED_CHARACTER */]: "element id must only contain letters, digits, dash and underscore characters"
|
|
9799
9841
|
};
|
|
9800
9842
|
}
|
|
9801
9843
|
isRelevant(event) {
|
|
@@ -9922,7 +9964,7 @@ function styleDescription(style) {
|
|
|
9922
9964
|
class H30 extends Rule {
|
|
9923
9965
|
documentation() {
|
|
9924
9966
|
return {
|
|
9925
|
-
description: "WCAG 2.1 requires each `<a>` anchor link to have a text describing the purpose of the link using either plain text or an `<img>` with the `alt` attribute set.",
|
|
9967
|
+
description: "WCAG 2.1 requires each `<a href>` anchor link to have a text describing the purpose of the link using either plain text or an `<img>` with the `alt` attribute set.",
|
|
9926
9968
|
url: "https://html-validate.org/rules/wcag/h30.html"
|
|
9927
9969
|
};
|
|
9928
9970
|
}
|
|
@@ -9930,6 +9972,9 @@ class H30 extends Rule {
|
|
|
9930
9972
|
this.on("dom:ready", (event) => {
|
|
9931
9973
|
const links = event.document.getElementsByTagName("a");
|
|
9932
9974
|
for (const link of links) {
|
|
9975
|
+
if (!link.hasAttribute("href")) {
|
|
9976
|
+
continue;
|
|
9977
|
+
}
|
|
9933
9978
|
if (!inAccessibilityTree(link)) {
|
|
9934
9979
|
continue;
|
|
9935
9980
|
}
|
|
@@ -9982,7 +10027,7 @@ function isSubmit(node) {
|
|
|
9982
10027
|
}
|
|
9983
10028
|
function isAssociated(id, node) {
|
|
9984
10029
|
const form = node.getAttribute("form");
|
|
9985
|
-
return Boolean(form
|
|
10030
|
+
return Boolean(form == null ? void 0 : form.valueMatches(id, true));
|
|
9986
10031
|
}
|
|
9987
10032
|
function hasNestedSubmit(form) {
|
|
9988
10033
|
const matches = form.querySelectorAll("button,input").filter(isSubmit).filter((node) => !node.hasAttribute("form"));
|
|
@@ -10198,7 +10243,6 @@ const bundledRules$1 = {
|
|
|
10198
10243
|
"wcag/h67": H67,
|
|
10199
10244
|
"wcag/h71": H71
|
|
10200
10245
|
};
|
|
10201
|
-
var WCAG = bundledRules$1;
|
|
10202
10246
|
|
|
10203
10247
|
const bundledRules = {
|
|
10204
10248
|
"allowed-links": AllowedLinks,
|
|
@@ -10284,7 +10328,7 @@ const bundledRules = {
|
|
|
10284
10328
|
"valid-id": ValidID,
|
|
10285
10329
|
"void-content": VoidContent,
|
|
10286
10330
|
"void-style": VoidStyle,
|
|
10287
|
-
...
|
|
10331
|
+
...bundledRules$1
|
|
10288
10332
|
};
|
|
10289
10333
|
|
|
10290
10334
|
var defaultConfig = {};
|
|
@@ -10321,7 +10365,6 @@ const config$4 = {
|
|
|
10321
10365
|
"wcag/h71": "error"
|
|
10322
10366
|
}
|
|
10323
10367
|
};
|
|
10324
|
-
var a11y = config$4;
|
|
10325
10368
|
|
|
10326
10369
|
const config$3 = {
|
|
10327
10370
|
rules: {
|
|
@@ -10332,7 +10375,6 @@ const config$3 = {
|
|
|
10332
10375
|
"require-sri": "error"
|
|
10333
10376
|
}
|
|
10334
10377
|
};
|
|
10335
|
-
var document = config$3;
|
|
10336
10378
|
|
|
10337
10379
|
const config$2 = {
|
|
10338
10380
|
rules: {
|
|
@@ -10341,7 +10383,6 @@ const config$2 = {
|
|
|
10341
10383
|
"void-style": "off"
|
|
10342
10384
|
}
|
|
10343
10385
|
};
|
|
10344
|
-
var prettier = config$2;
|
|
10345
10386
|
|
|
10346
10387
|
const config$1 = {
|
|
10347
10388
|
rules: {
|
|
@@ -10425,7 +10466,6 @@ const config$1 = {
|
|
|
10425
10466
|
"wcag/h71": "error"
|
|
10426
10467
|
}
|
|
10427
10468
|
};
|
|
10428
|
-
var recommended = config$1;
|
|
10429
10469
|
|
|
10430
10470
|
const config = {
|
|
10431
10471
|
rules: {
|
|
@@ -10464,18 +10504,17 @@ const config = {
|
|
|
10464
10504
|
"void-content": "error"
|
|
10465
10505
|
}
|
|
10466
10506
|
};
|
|
10467
|
-
var standard = config;
|
|
10468
10507
|
|
|
10469
10508
|
const presets = {
|
|
10470
|
-
"html-validate:a11y":
|
|
10471
|
-
"html-validate:document":
|
|
10472
|
-
"html-validate:prettier":
|
|
10473
|
-
"html-validate:recommended":
|
|
10474
|
-
"html-validate:standard":
|
|
10509
|
+
"html-validate:a11y": config$4,
|
|
10510
|
+
"html-validate:document": config$3,
|
|
10511
|
+
"html-validate:prettier": config$2,
|
|
10512
|
+
"html-validate:recommended": config$1,
|
|
10513
|
+
"html-validate:standard": config,
|
|
10475
10514
|
/* @deprecated aliases */
|
|
10476
|
-
"htmlvalidate:recommended":
|
|
10477
|
-
"htmlvalidate:document":
|
|
10478
|
-
"html-validate:a17y":
|
|
10515
|
+
"htmlvalidate:recommended": config$1,
|
|
10516
|
+
"htmlvalidate:document": config$3,
|
|
10517
|
+
"html-validate:a17y": config$4
|
|
10479
10518
|
};
|
|
10480
10519
|
var Presets = presets;
|
|
10481
10520
|
|
|
@@ -11344,8 +11383,9 @@ class Parser {
|
|
|
11344
11383
|
/**
|
|
11345
11384
|
* @internal
|
|
11346
11385
|
*/
|
|
11347
|
-
/* eslint-disable-next-line complexity
|
|
11386
|
+
/* eslint-disable-next-line complexity -- technical debt, chould be refactored a bit */
|
|
11348
11387
|
consumeTag(source, startToken, tokenStream) {
|
|
11388
|
+
var _a;
|
|
11349
11389
|
const tokens = Array.from(
|
|
11350
11390
|
this.consumeUntil(tokenStream, TokenType.TAG_CLOSE, startToken.location)
|
|
11351
11391
|
);
|
|
@@ -11361,7 +11401,7 @@ class Parser {
|
|
|
11361
11401
|
);
|
|
11362
11402
|
const isStartTag = !startToken.data[1];
|
|
11363
11403
|
const isClosing = !isStartTag || node.closed !== NodeClosed.Open;
|
|
11364
|
-
const isForeign = node.meta
|
|
11404
|
+
const isForeign = (_a = node.meta) == null ? void 0 : _a.foreign;
|
|
11365
11405
|
if (closeOptional) {
|
|
11366
11406
|
const active = this.dom.getActive();
|
|
11367
11407
|
active.closed = NodeClosed.ImplicitClosed;
|
|
@@ -12689,7 +12729,7 @@ class HtmlValidate {
|
|
|
12689
12729
|
}
|
|
12690
12730
|
|
|
12691
12731
|
const name = "html-validate";
|
|
12692
|
-
const version = "8.
|
|
12732
|
+
const version = "8.19.0";
|
|
12693
12733
|
const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
|
|
12694
12734
|
|
|
12695
12735
|
function definePlugin(plugin) {
|
|
@@ -13375,7 +13415,6 @@ function checkstyleFormatter(results) {
|
|
|
13375
13415
|
return output;
|
|
13376
13416
|
}
|
|
13377
13417
|
const formatter$3 = checkstyleFormatter;
|
|
13378
|
-
var checkstyle = formatter$3;
|
|
13379
13418
|
|
|
13380
13419
|
const defaults = {
|
|
13381
13420
|
showLink: true,
|
|
@@ -13481,7 +13520,6 @@ function jsonFormatter(results) {
|
|
|
13481
13520
|
return JSON.stringify(results);
|
|
13482
13521
|
}
|
|
13483
13522
|
const formatter$2 = jsonFormatter;
|
|
13484
|
-
var json = formatter$2;
|
|
13485
13523
|
|
|
13486
13524
|
function linkSummary(results) {
|
|
13487
13525
|
const urls = results.reduce((result, it) => {
|
|
@@ -13500,7 +13538,7 @@ ${lines.join("")}
|
|
|
13500
13538
|
`;
|
|
13501
13539
|
}
|
|
13502
13540
|
function stylish(results) {
|
|
13503
|
-
const errors = stylish$
|
|
13541
|
+
const errors = stylish$1.stylish(
|
|
13504
13542
|
results.map((it) => ({
|
|
13505
13543
|
...it,
|
|
13506
13544
|
fixableErrorCount: 0,
|
|
@@ -13511,7 +13549,6 @@ function stylish(results) {
|
|
|
13511
13549
|
return `${errors}${links}`;
|
|
13512
13550
|
}
|
|
13513
13551
|
const formatter$1 = stylish;
|
|
13514
|
-
var stylish$1 = formatter$1;
|
|
13515
13552
|
|
|
13516
13553
|
function textFormatter(results) {
|
|
13517
13554
|
let output = "";
|
|
@@ -13539,14 +13576,13 @@ function textFormatter(results) {
|
|
|
13539
13576
|
return total > 0 ? output : "";
|
|
13540
13577
|
}
|
|
13541
13578
|
const formatter = textFormatter;
|
|
13542
|
-
var text = formatter;
|
|
13543
13579
|
|
|
13544
13580
|
const availableFormatters = {
|
|
13545
|
-
checkstyle,
|
|
13581
|
+
checkstyle: formatter$3,
|
|
13546
13582
|
codeframe,
|
|
13547
|
-
json,
|
|
13548
|
-
stylish:
|
|
13549
|
-
text
|
|
13583
|
+
json: formatter$2,
|
|
13584
|
+
stylish: formatter$1,
|
|
13585
|
+
text: formatter
|
|
13550
13586
|
};
|
|
13551
13587
|
function getFormatter(name) {
|
|
13552
13588
|
return availableFormatters[name] ?? null;
|