html-validate 10.1.0 → 10.1.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/core.js +21 -2
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/tsdoc-metadata.json +1 -1
- package/dist/esm/core.js +21 -2
- package/dist/esm/core.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/types/browser.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/esm/core.js
CHANGED
|
@@ -2752,6 +2752,22 @@ class HtmlElement extends DOMNode {
|
|
|
2752
2752
|
}
|
|
2753
2753
|
return this.cacheSet(TABINDEX, parsed);
|
|
2754
2754
|
}
|
|
2755
|
+
/**
|
|
2756
|
+
* Read-only property with the type of the text content of this
|
|
2757
|
+
* element.
|
|
2758
|
+
*
|
|
2759
|
+
* @internal
|
|
2760
|
+
*/
|
|
2761
|
+
get textType() {
|
|
2762
|
+
const tagName = this.tagName.toLowerCase();
|
|
2763
|
+
if (tagName === "script") {
|
|
2764
|
+
return "script";
|
|
2765
|
+
} else if (tagName === "style") {
|
|
2766
|
+
return "css";
|
|
2767
|
+
} else {
|
|
2768
|
+
return "text";
|
|
2769
|
+
}
|
|
2770
|
+
}
|
|
2755
2771
|
/**
|
|
2756
2772
|
* Get a list of all attributes on this node.
|
|
2757
2773
|
*/
|
|
@@ -8168,7 +8184,7 @@ class NoRawCharacters extends Rule {
|
|
|
8168
8184
|
setup() {
|
|
8169
8185
|
this.on("element:ready", (event) => {
|
|
8170
8186
|
const node = event.target;
|
|
8171
|
-
if (node.
|
|
8187
|
+
if (node.textType !== "text") {
|
|
8172
8188
|
return;
|
|
8173
8189
|
}
|
|
8174
8190
|
for (const child of node.childNodes) {
|
|
@@ -9463,6 +9479,9 @@ class UnknownCharReference extends Rule {
|
|
|
9463
9479
|
setup() {
|
|
9464
9480
|
this.on("element:ready", (event) => {
|
|
9465
9481
|
const node = event.target;
|
|
9482
|
+
if (node.textType !== "text") {
|
|
9483
|
+
return;
|
|
9484
|
+
}
|
|
9466
9485
|
for (const child of node.childNodes) {
|
|
9467
9486
|
if (child.nodeType !== NodeType.TEXT_NODE) {
|
|
9468
9487
|
continue;
|
|
@@ -11823,7 +11842,7 @@ class EventHandler {
|
|
|
11823
11842
|
}
|
|
11824
11843
|
|
|
11825
11844
|
const name = "html-validate";
|
|
11826
|
-
const version = "10.1.
|
|
11845
|
+
const version = "10.1.1";
|
|
11827
11846
|
const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
|
|
11828
11847
|
|
|
11829
11848
|
function freeze(src) {
|