html-validate 9.5.2 → 9.5.3
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 -3
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/core-nodejs.js +1 -3
- package/dist/cjs/core-nodejs.js.map +1 -1
- package/dist/cjs/core.js +10 -12
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/tsdoc-metadata.json +1 -1
- package/dist/es/cli.js +1 -3
- package/dist/es/cli.js.map +1 -1
- package/dist/es/core-nodejs.js +1 -3
- package/dist/es/core-nodejs.js.map +1 -1
- package/dist/es/core.js +10 -12
- package/dist/es/core.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +1 -1
package/dist/cjs/core.js
CHANGED
|
@@ -1378,6 +1378,9 @@ class DynamicValue {
|
|
|
1378
1378
|
}
|
|
1379
1379
|
}
|
|
1380
1380
|
|
|
1381
|
+
function isStaticAttribute(attr) {
|
|
1382
|
+
return Boolean(attr?.isStatic);
|
|
1383
|
+
}
|
|
1381
1384
|
function isDynamicAttribute(attr) {
|
|
1382
1385
|
return Boolean(attr?.isDynamic);
|
|
1383
1386
|
}
|
|
@@ -2007,7 +2010,7 @@ class AttributeCondition extends Condition {
|
|
|
2007
2010
|
const [, key, op, value] = /^(.+?)(?:([~^$*|]?=)"([^"]+?)")?$/.exec(attr);
|
|
2008
2011
|
this.key = key;
|
|
2009
2012
|
this.op = op;
|
|
2010
|
-
this.value = value;
|
|
2013
|
+
this.value = typeof value === "string" ? stripslashes(value) : value;
|
|
2011
2014
|
}
|
|
2012
2015
|
match(node) {
|
|
2013
2016
|
const attr = node.getAttribute(this.key, true);
|
|
@@ -2640,9 +2643,7 @@ class HtmlElement extends DOMNode {
|
|
|
2640
2643
|
* the subsequent `dom:ready` event).
|
|
2641
2644
|
*/
|
|
2642
2645
|
loadMeta(meta) {
|
|
2643
|
-
|
|
2644
|
-
this.metaElement = {};
|
|
2645
|
-
}
|
|
2646
|
+
this.metaElement ??= {};
|
|
2646
2647
|
for (const key of MetaCopyableProperty) {
|
|
2647
2648
|
const value = meta[key];
|
|
2648
2649
|
if (typeof value !== "undefined") {
|
|
@@ -8020,7 +8021,7 @@ const ARIA = [
|
|
|
8020
8021
|
{ property: "aria-owns", isList: true }
|
|
8021
8022
|
];
|
|
8022
8023
|
function idMissing(document, id) {
|
|
8023
|
-
const nodes = document.querySelectorAll(
|
|
8024
|
+
const nodes = document.querySelectorAll(generateIdSelector(id));
|
|
8024
8025
|
return nodes.length === 0;
|
|
8025
8026
|
}
|
|
8026
8027
|
class NoMissingReferences extends Rule {
|
|
@@ -8238,15 +8239,14 @@ class NoRedundantFor extends Rule {
|
|
|
8238
8239
|
return;
|
|
8239
8240
|
}
|
|
8240
8241
|
const attr = target.getAttribute("for");
|
|
8241
|
-
if (!attr || attr
|
|
8242
|
+
if (!attr || !isStaticAttribute(attr)) {
|
|
8242
8243
|
return;
|
|
8243
8244
|
}
|
|
8244
8245
|
const id = attr.value;
|
|
8245
8246
|
if (!id) {
|
|
8246
8247
|
return;
|
|
8247
8248
|
}
|
|
8248
|
-
const
|
|
8249
|
-
const control = target.querySelector(`[id="${escaped}"]`);
|
|
8249
|
+
const control = target.querySelector(generateIdSelector(id));
|
|
8250
8250
|
if (!control) {
|
|
8251
8251
|
return;
|
|
8252
8252
|
}
|
|
@@ -11729,7 +11729,7 @@ class EventHandler {
|
|
|
11729
11729
|
}
|
|
11730
11730
|
|
|
11731
11731
|
const name = "html-validate";
|
|
11732
|
-
const version = "9.5.
|
|
11732
|
+
const version = "9.5.3";
|
|
11733
11733
|
const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
|
|
11734
11734
|
|
|
11735
11735
|
function freeze(src) {
|
|
@@ -12662,9 +12662,7 @@ class Engine {
|
|
|
12662
12662
|
rule.block(blocker);
|
|
12663
12663
|
}
|
|
12664
12664
|
const unregisterOpen = parser.on("tag:start", (_event, data) => {
|
|
12665
|
-
|
|
12666
|
-
directiveBlock = data.target.parent?.unique ?? null;
|
|
12667
|
-
}
|
|
12665
|
+
directiveBlock ??= data.target.parent?.unique ?? null;
|
|
12668
12666
|
data.target.blockRules(ruleIds, blocker);
|
|
12669
12667
|
});
|
|
12670
12668
|
const unregisterClose = parser.on("tag:end", (_event, data) => {
|