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.
- package/dist/cjs/cli.js +1 -1
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/core-browser.js +4 -4
- package/dist/cjs/core-browser.js.map +1 -1
- package/dist/cjs/core-nodejs.js +19 -19
- package/dist/cjs/core-nodejs.js.map +1 -1
- package/dist/cjs/core.js +177 -170
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/html-validate.js.map +1 -1
- package/dist/cjs/jest-diff.js.map +1 -1
- package/dist/cjs/jest.js +7 -6
- package/dist/cjs/jest.js.map +1 -1
- package/dist/cjs/matcher-utils.js +36 -0
- package/dist/cjs/matcher-utils.js.map +1 -1
- package/dist/cjs/matchers-jestonly.js +17 -39
- package/dist/cjs/matchers-jestonly.js.map +1 -1
- package/dist/cjs/matchers.js +14 -8
- package/dist/cjs/matchers.js.map +1 -1
- package/dist/cjs/tsdoc-metadata.json +1 -1
- package/dist/cjs/vitest.js +3 -3
- package/dist/esm/cli.js +1 -1
- package/dist/esm/cli.js.map +1 -1
- package/dist/esm/core-browser.js +4 -4
- package/dist/esm/core-browser.js.map +1 -1
- package/dist/esm/core-nodejs.js +19 -19
- package/dist/esm/core-nodejs.js.map +1 -1
- package/dist/esm/core.js +175 -170
- package/dist/esm/core.js.map +1 -1
- package/dist/esm/html-validate.js +1 -1
- package/dist/esm/html-validate.js.map +1 -1
- package/dist/esm/jest-diff.js.map +1 -1
- package/dist/esm/jest.js +3 -2
- package/dist/esm/jest.js.map +1 -1
- package/dist/esm/matcher-utils.js +36 -1
- package/dist/esm/matcher-utils.js.map +1 -1
- package/dist/esm/matchers-jestonly.js +18 -36
- package/dist/esm/matchers-jestonly.js.map +1 -1
- package/dist/esm/matchers.js +15 -9
- package/dist/esm/matchers.js.map +1 -1
- package/dist/esm/vitest.js +3 -3
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/types/browser.d.ts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/jest.d.ts +4 -4
- package/dist/types/vitest.d.ts +1 -1
- package/package.json +7 -3
package/dist/esm/core.js
CHANGED
|
@@ -1155,8 +1155,12 @@ const dynamicKeys = [
|
|
|
1155
1155
|
"submitButton"
|
|
1156
1156
|
];
|
|
1157
1157
|
const schemaCache = /* @__PURE__ */ new Map();
|
|
1158
|
-
function clone(
|
|
1159
|
-
|
|
1158
|
+
function clone(value) {
|
|
1159
|
+
if (globalThis.structuredClone) {
|
|
1160
|
+
return globalThis.structuredClone(value);
|
|
1161
|
+
} else {
|
|
1162
|
+
return JSON.parse(JSON.stringify(value));
|
|
1163
|
+
}
|
|
1160
1164
|
}
|
|
1161
1165
|
function overwriteMerge$1(_a, b) {
|
|
1162
1166
|
return b;
|
|
@@ -1521,82 +1525,6 @@ function sliceLocation(location, begin, end, wrap) {
|
|
|
1521
1525
|
return sliced;
|
|
1522
1526
|
}
|
|
1523
1527
|
|
|
1524
|
-
var State = /* @__PURE__ */ ((State2) => {
|
|
1525
|
-
State2[State2["INITIAL"] = 1] = "INITIAL";
|
|
1526
|
-
State2[State2["DOCTYPE"] = 2] = "DOCTYPE";
|
|
1527
|
-
State2[State2["TEXT"] = 3] = "TEXT";
|
|
1528
|
-
State2[State2["TAG"] = 4] = "TAG";
|
|
1529
|
-
State2[State2["ATTR"] = 5] = "ATTR";
|
|
1530
|
-
State2[State2["CDATA"] = 6] = "CDATA";
|
|
1531
|
-
State2[State2["SCRIPT"] = 7] = "SCRIPT";
|
|
1532
|
-
State2[State2["STYLE"] = 8] = "STYLE";
|
|
1533
|
-
State2[State2["TEXTAREA"] = 9] = "TEXTAREA";
|
|
1534
|
-
State2[State2["TITLE"] = 10] = "TITLE";
|
|
1535
|
-
return State2;
|
|
1536
|
-
})(State || {});
|
|
1537
|
-
|
|
1538
|
-
var ContentModel = /* @__PURE__ */ ((ContentModel2) => {
|
|
1539
|
-
ContentModel2[ContentModel2["TEXT"] = 1] = "TEXT";
|
|
1540
|
-
ContentModel2[ContentModel2["SCRIPT"] = 2] = "SCRIPT";
|
|
1541
|
-
ContentModel2[ContentModel2["STYLE"] = 3] = "STYLE";
|
|
1542
|
-
ContentModel2[ContentModel2["TEXTAREA"] = 4] = "TEXTAREA";
|
|
1543
|
-
ContentModel2[ContentModel2["TITLE"] = 5] = "TITLE";
|
|
1544
|
-
return ContentModel2;
|
|
1545
|
-
})(ContentModel || {});
|
|
1546
|
-
class Context {
|
|
1547
|
-
contentModel;
|
|
1548
|
-
state;
|
|
1549
|
-
string;
|
|
1550
|
-
filename;
|
|
1551
|
-
offset;
|
|
1552
|
-
line;
|
|
1553
|
-
column;
|
|
1554
|
-
constructor(source) {
|
|
1555
|
-
this.state = State.INITIAL;
|
|
1556
|
-
this.string = source.data;
|
|
1557
|
-
this.filename = source.filename;
|
|
1558
|
-
this.offset = source.offset;
|
|
1559
|
-
this.line = source.line;
|
|
1560
|
-
this.column = source.column;
|
|
1561
|
-
this.contentModel = 1 /* TEXT */;
|
|
1562
|
-
}
|
|
1563
|
-
getTruncatedLine(n = 13) {
|
|
1564
|
-
return JSON.stringify(this.string.length > n ? `${this.string.slice(0, 10)}...` : this.string);
|
|
1565
|
-
}
|
|
1566
|
-
consume(n, state) {
|
|
1567
|
-
let consumed = this.string.slice(0, n);
|
|
1568
|
-
let offset;
|
|
1569
|
-
while ((offset = consumed.indexOf("\n")) >= 0) {
|
|
1570
|
-
this.line++;
|
|
1571
|
-
this.column = 1;
|
|
1572
|
-
consumed = consumed.slice(offset + 1);
|
|
1573
|
-
}
|
|
1574
|
-
this.column += consumed.length;
|
|
1575
|
-
this.offset += n;
|
|
1576
|
-
this.string = this.string.slice(n);
|
|
1577
|
-
this.state = state;
|
|
1578
|
-
}
|
|
1579
|
-
getLocation(size) {
|
|
1580
|
-
return {
|
|
1581
|
-
filename: this.filename,
|
|
1582
|
-
offset: this.offset,
|
|
1583
|
-
line: this.line,
|
|
1584
|
-
column: this.column,
|
|
1585
|
-
size
|
|
1586
|
-
};
|
|
1587
|
-
}
|
|
1588
|
-
}
|
|
1589
|
-
|
|
1590
|
-
function normalizeSource(source) {
|
|
1591
|
-
return {
|
|
1592
|
-
filename: "",
|
|
1593
|
-
offset: 0,
|
|
1594
|
-
line: 1,
|
|
1595
|
-
column: 1,
|
|
1596
|
-
...source
|
|
1597
|
-
};
|
|
1598
|
-
}
|
|
1599
|
-
|
|
1600
1528
|
var NodeType = /* @__PURE__ */ ((NodeType2) => {
|
|
1601
1529
|
NodeType2[NodeType2["ELEMENT_NODE"] = 1] = "ELEMENT_NODE";
|
|
1602
1530
|
NodeType2[NodeType2["TEXT_NODE"] = 3] = "TEXT_NODE";
|
|
@@ -1881,7 +1809,7 @@ class DOMTokenList extends Array {
|
|
|
1881
1809
|
locations;
|
|
1882
1810
|
constructor(value, location) {
|
|
1883
1811
|
if (value && typeof value === "string") {
|
|
1884
|
-
const normalized = value.replaceAll(/[\t\r
|
|
1812
|
+
const normalized = value.replaceAll(/[\t\n\r]/g, " ");
|
|
1885
1813
|
const { tokens, locations } = parse(normalized, location);
|
|
1886
1814
|
super(...tokens);
|
|
1887
1815
|
this.locations = locations;
|
|
@@ -2026,7 +1954,7 @@ class AttributeCondition extends Condition {
|
|
|
2026
1954
|
value;
|
|
2027
1955
|
constructor(attr) {
|
|
2028
1956
|
super();
|
|
2029
|
-
const [, key, op, value] = /^(.+?)(?:([
|
|
1957
|
+
const [, key, op, value] = /^(.+?)(?:([$*^|~]?=)"([^"]+?)")?$/.exec(attr);
|
|
2030
1958
|
this.key = key;
|
|
2031
1959
|
this.op = op;
|
|
2032
1960
|
this.value = typeof value === "string" ? stripslashes(value) : value;
|
|
@@ -2066,10 +1994,10 @@ class PseudoClassCondition extends Condition {
|
|
|
2066
1994
|
}
|
|
2067
1995
|
|
|
2068
1996
|
function isDelimiter(ch) {
|
|
2069
|
-
return /[
|
|
1997
|
+
return /[#.:[]/.test(ch);
|
|
2070
1998
|
}
|
|
2071
1999
|
function isQuotationMark(ch) {
|
|
2072
|
-
return /['
|
|
2000
|
+
return /["']/.test(ch);
|
|
2073
2001
|
}
|
|
2074
2002
|
function isPseudoElement(ch, buffer) {
|
|
2075
2003
|
return ch === ":" && buffer === ":";
|
|
@@ -2121,7 +2049,7 @@ class Compound {
|
|
|
2121
2049
|
selector;
|
|
2122
2050
|
conditions;
|
|
2123
2051
|
constructor(pattern) {
|
|
2124
|
-
const match = /^([
|
|
2052
|
+
const match = /^([+>~-]?)((?:\*|[^#.:[]+)?)([^]*)$/.exec(pattern);
|
|
2125
2053
|
if (!match) {
|
|
2126
2054
|
throw new Error(`Failed to create selector pattern from "${pattern}"`);
|
|
2127
2055
|
}
|
|
@@ -2268,7 +2196,7 @@ function unescapeCodepoint(value) {
|
|
|
2268
2196
|
"\\d ": "\r"
|
|
2269
2197
|
};
|
|
2270
2198
|
return value.replaceAll(
|
|
2271
|
-
/(\\[
|
|
2199
|
+
/(\\[9ad] )/g,
|
|
2272
2200
|
(_, codepoint) => replacement[codepoint]
|
|
2273
2201
|
);
|
|
2274
2202
|
}
|
|
@@ -2278,7 +2206,7 @@ function escapeSelectorComponent(text) {
|
|
|
2278
2206
|
"\n": "\\a ",
|
|
2279
2207
|
"\r": "\\d "
|
|
2280
2208
|
};
|
|
2281
|
-
return text.toString().replaceAll(/([\t\n\r]|[
|
|
2209
|
+
return text.toString().replaceAll(/([\t\n\r]|[^\w-])/gi, (_, ch) => {
|
|
2282
2210
|
if (codepoints[ch]) {
|
|
2283
2211
|
return codepoints[ch];
|
|
2284
2212
|
} else {
|
|
@@ -2327,7 +2255,7 @@ class Selector {
|
|
|
2327
2255
|
}
|
|
2328
2256
|
}
|
|
2329
2257
|
static parse(selector) {
|
|
2330
|
-
selector = selector.replaceAll(/([
|
|
2258
|
+
selector = selector.replaceAll(/([+>~]) /g, "$1");
|
|
2331
2259
|
return Array.from(splitSelectorElements(selector), (element) => {
|
|
2332
2260
|
return new Compound(unescapeCodepoint(element));
|
|
2333
2261
|
});
|
|
@@ -3129,7 +3057,7 @@ class Validator {
|
|
|
3129
3057
|
if (typeof rule !== "string") {
|
|
3130
3058
|
return false;
|
|
3131
3059
|
}
|
|
3132
|
-
const [, category, quantifier] = /^(@?.*?)([
|
|
3060
|
+
const [, category, quantifier] = /^(@?.*?)([*?]?)$/.exec(rule);
|
|
3133
3061
|
const limit = category && quantifier && parseQuantifier(quantifier);
|
|
3134
3062
|
if (limit) {
|
|
3135
3063
|
const siblings = children.filter(
|
|
@@ -3297,7 +3225,7 @@ class Validator {
|
|
|
3297
3225
|
*/
|
|
3298
3226
|
/* eslint-disable-next-line complexity -- rule does not like switch */
|
|
3299
3227
|
static validatePermittedCategory(node, category, defaultMatch) {
|
|
3300
|
-
const [, rawCategory] = /^(@?.*?)([
|
|
3228
|
+
const [, rawCategory] = /^(@?.*?)([*?]?)$/.exec(category);
|
|
3301
3229
|
if (!rawCategory.startsWith("@")) {
|
|
3302
3230
|
return node.matches(rawCategory);
|
|
3303
3231
|
}
|
|
@@ -3438,7 +3366,7 @@ function isInputDisabledImpl(node) {
|
|
|
3438
3366
|
|
|
3439
3367
|
const patternCache = /* @__PURE__ */ new Map();
|
|
3440
3368
|
function compileStringPattern(pattern) {
|
|
3441
|
-
const regexp = pattern.replaceAll(
|
|
3369
|
+
const regexp = pattern.replaceAll(/\*+/g, ".+");
|
|
3442
3370
|
return new RegExp(`^${regexp}$`);
|
|
3443
3371
|
}
|
|
3444
3372
|
function compileRegExpPattern(pattern) {
|
|
@@ -4625,6 +4553,82 @@ class AttrCase extends Rule {
|
|
|
4625
4553
|
}
|
|
4626
4554
|
}
|
|
4627
4555
|
|
|
4556
|
+
var State = /* @__PURE__ */ ((State2) => {
|
|
4557
|
+
State2[State2["INITIAL"] = 1] = "INITIAL";
|
|
4558
|
+
State2[State2["DOCTYPE"] = 2] = "DOCTYPE";
|
|
4559
|
+
State2[State2["TEXT"] = 3] = "TEXT";
|
|
4560
|
+
State2[State2["TAG"] = 4] = "TAG";
|
|
4561
|
+
State2[State2["ATTR"] = 5] = "ATTR";
|
|
4562
|
+
State2[State2["CDATA"] = 6] = "CDATA";
|
|
4563
|
+
State2[State2["SCRIPT"] = 7] = "SCRIPT";
|
|
4564
|
+
State2[State2["STYLE"] = 8] = "STYLE";
|
|
4565
|
+
State2[State2["TEXTAREA"] = 9] = "TEXTAREA";
|
|
4566
|
+
State2[State2["TITLE"] = 10] = "TITLE";
|
|
4567
|
+
return State2;
|
|
4568
|
+
})(State || {});
|
|
4569
|
+
|
|
4570
|
+
var ContentModel = /* @__PURE__ */ ((ContentModel2) => {
|
|
4571
|
+
ContentModel2[ContentModel2["TEXT"] = 1] = "TEXT";
|
|
4572
|
+
ContentModel2[ContentModel2["SCRIPT"] = 2] = "SCRIPT";
|
|
4573
|
+
ContentModel2[ContentModel2["STYLE"] = 3] = "STYLE";
|
|
4574
|
+
ContentModel2[ContentModel2["TEXTAREA"] = 4] = "TEXTAREA";
|
|
4575
|
+
ContentModel2[ContentModel2["TITLE"] = 5] = "TITLE";
|
|
4576
|
+
return ContentModel2;
|
|
4577
|
+
})(ContentModel || {});
|
|
4578
|
+
class Context {
|
|
4579
|
+
contentModel;
|
|
4580
|
+
state;
|
|
4581
|
+
string;
|
|
4582
|
+
filename;
|
|
4583
|
+
offset;
|
|
4584
|
+
line;
|
|
4585
|
+
column;
|
|
4586
|
+
constructor(source) {
|
|
4587
|
+
this.state = State.INITIAL;
|
|
4588
|
+
this.string = source.data;
|
|
4589
|
+
this.filename = source.filename;
|
|
4590
|
+
this.offset = source.offset;
|
|
4591
|
+
this.line = source.line;
|
|
4592
|
+
this.column = source.column;
|
|
4593
|
+
this.contentModel = 1 /* TEXT */;
|
|
4594
|
+
}
|
|
4595
|
+
getTruncatedLine(n = 13) {
|
|
4596
|
+
return JSON.stringify(this.string.length > n ? `${this.string.slice(0, 10)}...` : this.string);
|
|
4597
|
+
}
|
|
4598
|
+
consume(n, state) {
|
|
4599
|
+
let consumed = this.string.slice(0, n);
|
|
4600
|
+
let offset;
|
|
4601
|
+
while ((offset = consumed.indexOf("\n")) >= 0) {
|
|
4602
|
+
this.line++;
|
|
4603
|
+
this.column = 1;
|
|
4604
|
+
consumed = consumed.slice(offset + 1);
|
|
4605
|
+
}
|
|
4606
|
+
this.column += consumed.length;
|
|
4607
|
+
this.offset += n;
|
|
4608
|
+
this.string = this.string.slice(n);
|
|
4609
|
+
this.state = state;
|
|
4610
|
+
}
|
|
4611
|
+
getLocation(size) {
|
|
4612
|
+
return {
|
|
4613
|
+
filename: this.filename,
|
|
4614
|
+
offset: this.offset,
|
|
4615
|
+
line: this.line,
|
|
4616
|
+
column: this.column,
|
|
4617
|
+
size
|
|
4618
|
+
};
|
|
4619
|
+
}
|
|
4620
|
+
}
|
|
4621
|
+
|
|
4622
|
+
function normalizeSource(source) {
|
|
4623
|
+
return {
|
|
4624
|
+
filename: "",
|
|
4625
|
+
offset: 0,
|
|
4626
|
+
line: 1,
|
|
4627
|
+
column: 1,
|
|
4628
|
+
...source
|
|
4629
|
+
};
|
|
4630
|
+
}
|
|
4631
|
+
|
|
4628
4632
|
var TokenType = /* @__PURE__ */ ((TokenType2) => {
|
|
4629
4633
|
TokenType2[TokenType2["UNICODE_BOM"] = 1] = "UNICODE_BOM";
|
|
4630
4634
|
TokenType2[TokenType2["WHITESPACE"] = 2] = "WHITESPACE";
|
|
@@ -4647,20 +4651,20 @@ var TokenType = /* @__PURE__ */ ((TokenType2) => {
|
|
|
4647
4651
|
})(TokenType || {});
|
|
4648
4652
|
|
|
4649
4653
|
const MATCH_UNICODE_BOM = /^\uFEFF/;
|
|
4650
|
-
const MATCH_WHITESPACE = /^(?:\r\n|\r|\n|[
|
|
4651
|
-
const MATCH_DOCTYPE_OPEN = /^<!(
|
|
4654
|
+
const MATCH_WHITESPACE = /^(?:\r\n|\r|\n|[\t ]+(?:\r\n|\r|\n)?)/;
|
|
4655
|
+
const MATCH_DOCTYPE_OPEN = /^<!(doctype)\s/i;
|
|
4652
4656
|
const MATCH_DOCTYPE_VALUE = /^[^>]+/;
|
|
4653
4657
|
const MATCH_DOCTYPE_CLOSE = /^>/;
|
|
4654
4658
|
const MATCH_XML_TAG = /^<\?xml.*?\?>\s+/;
|
|
4655
|
-
const MATCH_TAG_OPEN = /^<(\/?)([
|
|
4659
|
+
const MATCH_TAG_OPEN = /^<(\/?)([\w:\-]+)/;
|
|
4656
4660
|
const MATCH_TAG_CLOSE = /^\/?>/;
|
|
4657
|
-
const MATCH_TEXT = /^[^]*?(?=(?:[
|
|
4661
|
+
const MATCH_TEXT = /^[^]*?(?=(?:[\t ]*(?:\r\n|\r|\n)|<[^ ]|$))/;
|
|
4658
4662
|
const MATCH_TEMPLATING = /^(?:<%.*?%>|<\?.*?\?>|<\$.*?\$>)/s;
|
|
4659
4663
|
const MATCH_TAG_LOOKAHEAD = /^[^]*?(?=<|$)/;
|
|
4660
|
-
const MATCH_ATTR_START = /^([^\t\
|
|
4664
|
+
const MATCH_ATTR_START = /^([^\t\n\f\r "'/<=>]+)/;
|
|
4661
4665
|
const MATCH_ATTR_SINGLE = /^(\s*=\s*)'([^']*?)(')/;
|
|
4662
4666
|
const MATCH_ATTR_DOUBLE = /^(\s*=\s*)"([^"]*?)(")/;
|
|
4663
|
-
const MATCH_ATTR_UNQUOTED = /^(\s*=\s*)([^\t\
|
|
4667
|
+
const MATCH_ATTR_UNQUOTED = /^(\s*=\s*)([^\t\n\f\r "'<>][^\t\n\f\r <>]*)/;
|
|
4664
4668
|
const MATCH_CDATA_BEGIN = /^<!\[CDATA\[/;
|
|
4665
4669
|
const MATCH_CDATA_END = /^[^]*?]]>/;
|
|
4666
4670
|
const MATCH_SCRIPT_DATA = /^[^]*?(?=<\/script)/;
|
|
@@ -4671,9 +4675,9 @@ const MATCH_TEXTAREA_DATA = /^[^]*?(?=<\/textarea)/;
|
|
|
4671
4675
|
const MATCH_TEXTAREA_END = /^<(\/)(textarea)/;
|
|
4672
4676
|
const MATCH_TITLE_DATA = /^[^]*?(?=<\/title)/;
|
|
4673
4677
|
const MATCH_TITLE_END = /^<(\/)(title)/;
|
|
4674
|
-
const MATCH_DIRECTIVE = /^(<!--\s*\[?)(html-validate-)([
|
|
4678
|
+
const MATCH_DIRECTIVE = /^(<!--\s*\[?)(html-validate-)([\da-z-]+)(\s*)(.*?)(]?\s*-->)/;
|
|
4675
4679
|
const MATCH_COMMENT = /^<!--([^]*?)-->/;
|
|
4676
|
-
const MATCH_CONDITIONAL = /^<!\[([^\]]*?)
|
|
4680
|
+
const MATCH_CONDITIONAL = /^<!\[([^\]]*?)]>/;
|
|
4677
4681
|
class InvalidTokenError extends Error {
|
|
4678
4682
|
location;
|
|
4679
4683
|
constructor(location, message) {
|
|
@@ -5613,12 +5617,12 @@ function parsePattern(pattern) {
|
|
|
5613
5617
|
}
|
|
5614
5618
|
switch (pattern) {
|
|
5615
5619
|
case "kebabcase":
|
|
5616
|
-
return { regexp: /^[a-z][
|
|
5620
|
+
return { regexp: /^[a-z][\da-z]*(?:-[\da-z]+)*$/, description: pattern };
|
|
5617
5621
|
case "camelcase":
|
|
5618
|
-
return { regexp: /^[a-z][
|
|
5622
|
+
return { regexp: /^[a-z][\dA-Za-z]*$/, description: pattern };
|
|
5619
5623
|
case "snakecase":
|
|
5620
5624
|
case "underscore":
|
|
5621
|
-
return { regexp: /^[a-z][
|
|
5625
|
+
return { regexp: /^[a-z][\da-z]*(?:_[\da-z]+)*$/, description: pattern };
|
|
5622
5626
|
case "bem": {
|
|
5623
5627
|
const block = "[a-z][a-z0-9]*(?:-[a-z0-9]+)*";
|
|
5624
5628
|
const element = "(?:__[a-z0-9]+(?:-[a-z0-9]+)*)?";
|
|
@@ -5630,7 +5634,7 @@ function parsePattern(pattern) {
|
|
|
5630
5634
|
}
|
|
5631
5635
|
case "tailwind": {
|
|
5632
5636
|
return {
|
|
5633
|
-
regexp: /^!?(?:[
|
|
5637
|
+
regexp: /^!?(?:[[a-z-]|\d+xl:)[\w!#%&'(),./:=>[\\\]-]*$/,
|
|
5634
5638
|
description: "tailwind"
|
|
5635
5639
|
};
|
|
5636
5640
|
}
|
|
@@ -6616,7 +6620,7 @@ class ElementPermittedParent extends Rule {
|
|
|
6616
6620
|
}
|
|
6617
6621
|
|
|
6618
6622
|
function isTagnameOnly(value) {
|
|
6619
|
-
return /^[
|
|
6623
|
+
return /^[\dA-Za-z-]+$/.test(value);
|
|
6620
6624
|
}
|
|
6621
6625
|
function getRuleDescription(context) {
|
|
6622
6626
|
const escaped = context.ancestor.map((it) => `\`${it}\``);
|
|
@@ -7072,7 +7076,7 @@ function isRelevant$5(event) {
|
|
|
7072
7076
|
return Boolean(node.meta?.heading);
|
|
7073
7077
|
}
|
|
7074
7078
|
function extractLevel(node) {
|
|
7075
|
-
const match = /^[
|
|
7079
|
+
const match = /^[Hh](\d)$/.exec(node.tagName);
|
|
7076
7080
|
if (match) {
|
|
7077
7081
|
return Number.parseInt(match[1], 10);
|
|
7078
7082
|
} else {
|
|
@@ -8527,8 +8531,8 @@ class NoMultipleMain extends Rule {
|
|
|
8527
8531
|
const defaults$f = {
|
|
8528
8532
|
relaxed: false
|
|
8529
8533
|
};
|
|
8530
|
-
const textRegexp = /([<>]|&(?![
|
|
8531
|
-
const unquotedAttrRegexp = /([
|
|
8534
|
+
const textRegexp = /([<>]|&(?![\d#A-Za-z]+;))/g;
|
|
8535
|
+
const unquotedAttrRegexp = /(["'<=>`]|&(?![\d#A-Za-z]+;))/g;
|
|
8532
8536
|
const matchTemplate = /^(<%.*?%>|<\?.*?\?>|<\$.*?\$>)$/s;
|
|
8533
8537
|
const replacementTable = {
|
|
8534
8538
|
'"': """,
|
|
@@ -8861,7 +8865,7 @@ class NoTrailingWhitespace extends Rule {
|
|
|
8861
8865
|
}
|
|
8862
8866
|
setup() {
|
|
8863
8867
|
this.on("whitespace", (event) => {
|
|
8864
|
-
if (/^[
|
|
8868
|
+
if (/^[\t ]+\r?\n$/.test(event.text)) {
|
|
8865
8869
|
this.report(null, "Trailing whitespace", event.location);
|
|
8866
8870
|
}
|
|
8867
8871
|
});
|
|
@@ -9864,7 +9868,7 @@ const defaults$5 = {
|
|
|
9864
9868
|
ignoreCase: false,
|
|
9865
9869
|
requireSemicolon: true
|
|
9866
9870
|
};
|
|
9867
|
-
const regexp$1 = /&(?:[
|
|
9871
|
+
const regexp$1 = /&(?:[\da-z]+|#x?[\da-f]+)(;|[^\da-z]|$)/gi;
|
|
9868
9872
|
const lowercaseEntities = entities$1.map((it) => it.toLowerCase());
|
|
9869
9873
|
function isNumerical(entity) {
|
|
9870
9874
|
return entity.startsWith("&#");
|
|
@@ -9948,7 +9952,7 @@ class UnknownCharReference extends Rule {
|
|
|
9948
9952
|
}
|
|
9949
9953
|
}
|
|
9950
9954
|
findCharacterReferences(node, text, location, { isAttribute }) {
|
|
9951
|
-
const delimiter = text.search(/[
|
|
9955
|
+
const delimiter = text.search(/[#?]/);
|
|
9952
9956
|
for (const match of this.getMatches(text)) {
|
|
9953
9957
|
const allowUnterminated = isAttribute && isAfterQueryOrFragment(delimiter, match);
|
|
9954
9958
|
this.validateCharacterReference(node, location, match, {
|
|
@@ -10771,7 +10775,7 @@ class H30 extends Rule {
|
|
|
10771
10775
|
}
|
|
10772
10776
|
setup() {
|
|
10773
10777
|
this.on("dom:ready", (event) => {
|
|
10774
|
-
const links = event.document.
|
|
10778
|
+
const links = event.document.querySelectorAll("a");
|
|
10775
10779
|
for (const link of links) {
|
|
10776
10780
|
if (!link.hasAttribute("href")) {
|
|
10777
10781
|
continue;
|
|
@@ -11361,46 +11365,10 @@ var configurationSchema = {
|
|
|
11361
11365
|
properties: properties
|
|
11362
11366
|
};
|
|
11363
11367
|
|
|
11364
|
-
function dumpTree(root) {
|
|
11365
|
-
const lines = [];
|
|
11366
|
-
function decoration(node) {
|
|
11367
|
-
let output = "";
|
|
11368
|
-
if (node.id) {
|
|
11369
|
-
output += `#${node.id}`;
|
|
11370
|
-
}
|
|
11371
|
-
if (node.hasAttribute("class")) {
|
|
11372
|
-
output += `.${node.classList.join(".")}`;
|
|
11373
|
-
}
|
|
11374
|
-
return output;
|
|
11375
|
-
}
|
|
11376
|
-
function writeNode(node, level, indent, sibling) {
|
|
11377
|
-
const numSiblings = node.parent ? node.parent.childElements.length : 0;
|
|
11378
|
-
const lastSibling = sibling === numSiblings - 1;
|
|
11379
|
-
if (node.parent) {
|
|
11380
|
-
const b = lastSibling ? "\u2514" : "\u251C";
|
|
11381
|
-
lines.push(`${indent}${b}\u2500\u2500 ${node.tagName}${decoration(node)}`);
|
|
11382
|
-
} else {
|
|
11383
|
-
lines.push("(root)");
|
|
11384
|
-
}
|
|
11385
|
-
for (const [index, child] of node.childElements.entries()) {
|
|
11386
|
-
const s = lastSibling ? " " : "\u2502";
|
|
11387
|
-
const i = level > 0 ? `${indent}${s} ` : "";
|
|
11388
|
-
writeNode(child, level + 1, i, index);
|
|
11389
|
-
}
|
|
11390
|
-
}
|
|
11391
|
-
writeNode(root, 0, "", 0);
|
|
11392
|
-
return lines;
|
|
11393
|
-
}
|
|
11394
|
-
|
|
11395
11368
|
function isThenable(value) {
|
|
11396
11369
|
return value && typeof value === "object" && "then" in value && typeof value.then === "function";
|
|
11397
11370
|
}
|
|
11398
11371
|
|
|
11399
|
-
const ruleIds = new Set(Object.keys(bundledRules));
|
|
11400
|
-
function ruleExists(ruleId) {
|
|
11401
|
-
return ruleIds.has(ruleId);
|
|
11402
|
-
}
|
|
11403
|
-
|
|
11404
11372
|
var defaultConfig = {};
|
|
11405
11373
|
|
|
11406
11374
|
const config$5 = {
|
|
@@ -12487,6 +12455,7 @@ class EventHandler {
|
|
|
12487
12455
|
* @param event - Event name.
|
|
12488
12456
|
* @param data - Event data.
|
|
12489
12457
|
*/
|
|
12458
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any -- technical debt, should be made typesafe */
|
|
12490
12459
|
trigger(event, data) {
|
|
12491
12460
|
for (const listener of this.getCallbacks(event)) {
|
|
12492
12461
|
listener.call(null, event, data);
|
|
@@ -12501,7 +12470,7 @@ class EventHandler {
|
|
|
12501
12470
|
}
|
|
12502
12471
|
|
|
12503
12472
|
const name = "html-validate";
|
|
12504
|
-
const version = "10.
|
|
12473
|
+
const version = "10.12.1";
|
|
12505
12474
|
const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
|
|
12506
12475
|
|
|
12507
12476
|
function freeze(src) {
|
|
@@ -12666,7 +12635,7 @@ function definePlugin(plugin) {
|
|
|
12666
12635
|
return plugin;
|
|
12667
12636
|
}
|
|
12668
12637
|
|
|
12669
|
-
const regexp = /<!(?:--)?\[(.*?)
|
|
12638
|
+
const regexp = /<!(?:--)?\[(.*?)](?:--)?>/g;
|
|
12670
12639
|
function* parseConditionalComment(comment, commentLocation) {
|
|
12671
12640
|
let match;
|
|
12672
12641
|
while ((match = regexp.exec(comment)) !== null) {
|
|
@@ -13278,6 +13247,42 @@ class Parser {
|
|
|
13278
13247
|
}
|
|
13279
13248
|
}
|
|
13280
13249
|
|
|
13250
|
+
const ruleIds = new Set(Object.keys(bundledRules));
|
|
13251
|
+
function ruleExists(ruleId) {
|
|
13252
|
+
return ruleIds.has(ruleId);
|
|
13253
|
+
}
|
|
13254
|
+
|
|
13255
|
+
function dumpTree(root) {
|
|
13256
|
+
const lines = [];
|
|
13257
|
+
function decoration(node) {
|
|
13258
|
+
let output = "";
|
|
13259
|
+
if (node.id) {
|
|
13260
|
+
output += `#${node.id}`;
|
|
13261
|
+
}
|
|
13262
|
+
if (node.hasAttribute("class")) {
|
|
13263
|
+
output += `.${node.classList.join(".")}`;
|
|
13264
|
+
}
|
|
13265
|
+
return output;
|
|
13266
|
+
}
|
|
13267
|
+
function writeNode(node, level, indent, sibling) {
|
|
13268
|
+
const numSiblings = node.parent ? node.parent.childElements.length : 0;
|
|
13269
|
+
const lastSibling = sibling === numSiblings - 1;
|
|
13270
|
+
if (node.parent) {
|
|
13271
|
+
const b = lastSibling ? "\u2514" : "\u251C";
|
|
13272
|
+
lines.push(`${indent}${b}\u2500\u2500 ${node.tagName}${decoration(node)}`);
|
|
13273
|
+
} else {
|
|
13274
|
+
lines.push("(root)");
|
|
13275
|
+
}
|
|
13276
|
+
for (const [index, child] of node.childElements.entries()) {
|
|
13277
|
+
const s = lastSibling ? " " : "\u2502";
|
|
13278
|
+
const i = level > 0 ? `${indent}${s} ` : "";
|
|
13279
|
+
writeNode(child, level + 1, i, index);
|
|
13280
|
+
}
|
|
13281
|
+
}
|
|
13282
|
+
writeNode(root, 0, "", 0);
|
|
13283
|
+
return lines;
|
|
13284
|
+
}
|
|
13285
|
+
|
|
13281
13286
|
let blockerCounter = 1;
|
|
13282
13287
|
function createBlocker() {
|
|
13283
13288
|
const id = blockerCounter++;
|
|
@@ -13538,6 +13543,7 @@ class Engine {
|
|
|
13538
13543
|
* Initializes all rules from plugins and returns an object with a mapping
|
|
13539
13544
|
* between rule name and its constructor.
|
|
13540
13545
|
*/
|
|
13546
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any -- should explicitly accept anything */
|
|
13541
13547
|
initRules(config) {
|
|
13542
13548
|
const availableRules = {};
|
|
13543
13549
|
for (const plugin of config.getPlugins()) {
|
|
@@ -13837,7 +13843,7 @@ const entities = {
|
|
|
13837
13843
|
"&": "&"
|
|
13838
13844
|
};
|
|
13839
13845
|
function xmlescape(src) {
|
|
13840
|
-
return src.toString().replaceAll(/[
|
|
13846
|
+
return src.toString().replaceAll(/["&'<>]/g, (match) => {
|
|
13841
13847
|
return entities[match];
|
|
13842
13848
|
});
|
|
13843
13849
|
}
|
|
@@ -13880,11 +13886,6 @@ function checkstyleFormatter(results) {
|
|
|
13880
13886
|
}
|
|
13881
13887
|
const formatter$2 = checkstyleFormatter;
|
|
13882
13888
|
|
|
13883
|
-
const defaults = {
|
|
13884
|
-
showLink: true,
|
|
13885
|
-
showSummary: true,
|
|
13886
|
-
showSelector: false
|
|
13887
|
-
};
|
|
13888
13889
|
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
13889
13890
|
function getMarkerLines(loc, source) {
|
|
13890
13891
|
const startLoc = {
|
|
@@ -13960,15 +13961,7 @@ function codeFrameColumns(rawLines, loc) {
|
|
|
13960
13961
|
}
|
|
13961
13962
|
}).join("\n");
|
|
13962
13963
|
}
|
|
13963
|
-
|
|
13964
|
-
return count === 1 ? word : `${word}s`;
|
|
13965
|
-
}
|
|
13966
|
-
function formatFilePath(filePath, line, column) {
|
|
13967
|
-
if (line && column) {
|
|
13968
|
-
filePath += `:${String(line)}:${String(column)}`;
|
|
13969
|
-
}
|
|
13970
|
-
return kleur.green(filePath);
|
|
13971
|
-
}
|
|
13964
|
+
|
|
13972
13965
|
function getStartLocation(message) {
|
|
13973
13966
|
return {
|
|
13974
13967
|
line: message.line,
|
|
@@ -13988,18 +13981,30 @@ function getEndLocation(message, source) {
|
|
|
13988
13981
|
}
|
|
13989
13982
|
return { line, column };
|
|
13990
13983
|
}
|
|
13984
|
+
|
|
13985
|
+
const defaults = {
|
|
13986
|
+
showLink: true,
|
|
13987
|
+
showFilePath: true,
|
|
13988
|
+
showSummary: true,
|
|
13989
|
+
showSelector: false
|
|
13990
|
+
};
|
|
13991
|
+
function pluralize(word, count) {
|
|
13992
|
+
return count === 1 ? word : `${word}s`;
|
|
13993
|
+
}
|
|
13994
|
+
function formatFilePath(filePath, line, column) {
|
|
13995
|
+
if (line && column) {
|
|
13996
|
+
filePath += `:${String(line)}:${String(column)}`;
|
|
13997
|
+
}
|
|
13998
|
+
return kleur.green(filePath);
|
|
13999
|
+
}
|
|
13991
14000
|
function formatMessage(message, parentResult, options) {
|
|
13992
14001
|
const type = message.severity === 2 ? kleur.red("error") : kleur.yellow("warning");
|
|
13993
14002
|
const msg = kleur.bold(message.message.replace(/([^ ])\.$/, "$1"));
|
|
13994
14003
|
const ruleId = kleur.dim(`(${message.ruleId})`);
|
|
13995
14004
|
const filePath = formatFilePath(parentResult.filePath, message.line, message.column);
|
|
13996
14005
|
const sourceCode = parentResult.source;
|
|
13997
|
-
const
|
|
13998
|
-
|
|
13999
|
-
msg,
|
|
14000
|
-
ruleId ? ruleId : "",
|
|
14001
|
-
sourceCode ? `at ${filePath}:` : `at ${filePath}`
|
|
14002
|
-
].filter(String).join(" ");
|
|
14006
|
+
const filePathPart = options.showFilePath ? `at ${filePath}:` : null;
|
|
14007
|
+
const firstLine = [`${type}:`, msg, ruleId ? ruleId : "", filePathPart].filter(Boolean).join(" ");
|
|
14003
14008
|
const result = [firstLine];
|
|
14004
14009
|
if (sourceCode) {
|
|
14005
14010
|
const output = codeFrameColumns(sourceCode, {
|
|
@@ -14937,10 +14942,10 @@ var ignoreExports = /*@__PURE__*/ requireIgnore();
|
|
|
14937
14942
|
var ignore = /*@__PURE__*/getDefaultExportFromCjs(ignoreExports);
|
|
14938
14943
|
|
|
14939
14944
|
const engines = {
|
|
14940
|
-
node: "^20.19.0 ||
|
|
14945
|
+
node: "^20.19.0 || ^22.16.0 || >= 24.0.0"
|
|
14941
14946
|
};
|
|
14942
14947
|
|
|
14943
14948
|
var workerPath = "./jest-worker.js";
|
|
14944
14949
|
|
|
14945
|
-
export { engines as $, Attribute as A, TextContent$1 as B, ConfigLoader as C, DOMNode as D, Engine as E, TextNode as F, ariaNaming as G, HtmlElement as H, classifyNodeText as I, presets as J, defineConfig as K, definePlugin as L, MetaCopyableProperty as M, NestedError as N, isUserError as O, Parser as P, keywordPatternMatcher as Q, Reporter as R, StaticConfigLoader as S, TextClassification as T, UserError as U, Validator as V, WrappedError as W, ruleExists as X, sliceLocation as Y, staticResolver as Z, walk as _, transformSourceSync as a,
|
|
14950
|
+
export { engines as $, Attribute as A, TextContent$1 as B, ConfigLoader as C, DOMNode as D, Engine as E, TextNode as F, ariaNaming as G, HtmlElement as H, classifyNodeText as I, presets as J, defineConfig as K, definePlugin as L, MetaCopyableProperty as M, NestedError as N, isUserError as O, Parser as P, keywordPatternMatcher as Q, Reporter as R, StaticConfigLoader as S, TextClassification as T, UserError as U, Validator as V, WrappedError as W, ruleExists as X, sliceLocation as Y, staticResolver as Z, walk as _, transformSourceSync as a, codeFrameColumns as a0, getEndLocation as a1, getStartLocation as a2, workerPath as a3, name as a4, bugs as a5, transformFilename as b, transformFilenameSync as c, configurationSchema as d, ConfigError as e, Config as f, compatibilityCheckImpl as g, ensureError as h, isThenable as i, getFormatter as j, deepmerge as k, ignore as l, DOMTokenList as m, normalizeSource as n, DOMTree as o, DynamicValue as p, EventHandler as q, MetaTable as r, NodeClosed as s, transformSource as t, NodeType as u, version as v, ResolvedConfig as w, Rule as x, SchemaValidationError as y, Severity as z };
|
|
14946
14951
|
//# sourceMappingURL=core.js.map
|