html-validate 9.5.2 → 9.5.4
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 +12 -14
- 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 +12 -14
- package/dist/es/core.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +1 -1
package/dist/es/core.js
CHANGED
|
@@ -1369,6 +1369,9 @@ class DynamicValue {
|
|
|
1369
1369
|
}
|
|
1370
1370
|
}
|
|
1371
1371
|
|
|
1372
|
+
function isStaticAttribute(attr) {
|
|
1373
|
+
return Boolean(attr?.isStatic);
|
|
1374
|
+
}
|
|
1372
1375
|
function isDynamicAttribute(attr) {
|
|
1373
1376
|
return Boolean(attr?.isDynamic);
|
|
1374
1377
|
}
|
|
@@ -1998,7 +2001,7 @@ class AttributeCondition extends Condition {
|
|
|
1998
2001
|
const [, key, op, value] = /^(.+?)(?:([~^$*|]?=)"([^"]+?)")?$/.exec(attr);
|
|
1999
2002
|
this.key = key;
|
|
2000
2003
|
this.op = op;
|
|
2001
|
-
this.value = value;
|
|
2004
|
+
this.value = typeof value === "string" ? stripslashes(value) : value;
|
|
2002
2005
|
}
|
|
2003
2006
|
match(node) {
|
|
2004
2007
|
const attr = node.getAttribute(this.key, true);
|
|
@@ -2631,9 +2634,7 @@ class HtmlElement extends DOMNode {
|
|
|
2631
2634
|
* the subsequent `dom:ready` event).
|
|
2632
2635
|
*/
|
|
2633
2636
|
loadMeta(meta) {
|
|
2634
|
-
|
|
2635
|
-
this.metaElement = {};
|
|
2636
|
-
}
|
|
2637
|
+
this.metaElement ??= {};
|
|
2637
2638
|
for (const key of MetaCopyableProperty) {
|
|
2638
2639
|
const value = meta[key];
|
|
2639
2640
|
if (typeof value !== "undefined") {
|
|
@@ -6092,7 +6093,7 @@ class ElementPermittedContent extends Rule {
|
|
|
6092
6093
|
return false;
|
|
6093
6094
|
}
|
|
6094
6095
|
validatePermittedDescendant(node, parent) {
|
|
6095
|
-
for (let cur = parent; cur && !cur.isRootElement(); cur = /* istanbul ignore next */
|
|
6096
|
+
for (let cur = parent; cur && !cur.isRootElement() && cur.tagName !== "template"; cur = /* istanbul ignore next */
|
|
6096
6097
|
cur.parent ?? null) {
|
|
6097
6098
|
const meta = cur.meta;
|
|
6098
6099
|
if (!meta) {
|
|
@@ -8011,7 +8012,7 @@ const ARIA = [
|
|
|
8011
8012
|
{ property: "aria-owns", isList: true }
|
|
8012
8013
|
];
|
|
8013
8014
|
function idMissing(document, id) {
|
|
8014
|
-
const nodes = document.querySelectorAll(
|
|
8015
|
+
const nodes = document.querySelectorAll(generateIdSelector(id));
|
|
8015
8016
|
return nodes.length === 0;
|
|
8016
8017
|
}
|
|
8017
8018
|
class NoMissingReferences extends Rule {
|
|
@@ -8229,15 +8230,14 @@ class NoRedundantFor extends Rule {
|
|
|
8229
8230
|
return;
|
|
8230
8231
|
}
|
|
8231
8232
|
const attr = target.getAttribute("for");
|
|
8232
|
-
if (!attr || attr
|
|
8233
|
+
if (!attr || !isStaticAttribute(attr)) {
|
|
8233
8234
|
return;
|
|
8234
8235
|
}
|
|
8235
8236
|
const id = attr.value;
|
|
8236
8237
|
if (!id) {
|
|
8237
8238
|
return;
|
|
8238
8239
|
}
|
|
8239
|
-
const
|
|
8240
|
-
const control = target.querySelector(`[id="${escaped}"]`);
|
|
8240
|
+
const control = target.querySelector(generateIdSelector(id));
|
|
8241
8241
|
if (!control) {
|
|
8242
8242
|
return;
|
|
8243
8243
|
}
|
|
@@ -11720,7 +11720,7 @@ class EventHandler {
|
|
|
11720
11720
|
}
|
|
11721
11721
|
|
|
11722
11722
|
const name = "html-validate";
|
|
11723
|
-
const version = "9.5.
|
|
11723
|
+
const version = "9.5.4";
|
|
11724
11724
|
const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
|
|
11725
11725
|
|
|
11726
11726
|
function freeze(src) {
|
|
@@ -12653,9 +12653,7 @@ class Engine {
|
|
|
12653
12653
|
rule.block(blocker);
|
|
12654
12654
|
}
|
|
12655
12655
|
const unregisterOpen = parser.on("tag:start", (_event, data) => {
|
|
12656
|
-
|
|
12657
|
-
directiveBlock = data.target.parent?.unique ?? null;
|
|
12658
|
-
}
|
|
12656
|
+
directiveBlock ??= data.target.parent?.unique ?? null;
|
|
12659
12657
|
data.target.blockRules(ruleIds, blocker);
|
|
12660
12658
|
});
|
|
12661
12659
|
const unregisterClose = parser.on("tag:end", (_event, data) => {
|
|
@@ -13351,7 +13349,7 @@ function requireIgnore () {
|
|
|
13351
13349
|
// - ..
|
|
13352
13350
|
// Valid:
|
|
13353
13351
|
// - .foo
|
|
13354
|
-
const REGEX_TEST_INVALID_PATH =
|
|
13352
|
+
const REGEX_TEST_INVALID_PATH = /^\.{0,2}\/|^\.{1,2}$/;
|
|
13355
13353
|
|
|
13356
13354
|
const REGEX_TEST_TRAILING_SLASH = /\/$/;
|
|
13357
13355
|
|