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 CHANGED
@@ -2761,6 +2761,22 @@ class HtmlElement extends DOMNode {
2761
2761
  }
2762
2762
  return this.cacheSet(TABINDEX, parsed);
2763
2763
  }
2764
+ /**
2765
+ * Read-only property with the type of the text content of this
2766
+ * element.
2767
+ *
2768
+ * @internal
2769
+ */
2770
+ get textType() {
2771
+ const tagName = this.tagName.toLowerCase();
2772
+ if (tagName === "script") {
2773
+ return "script";
2774
+ } else if (tagName === "style") {
2775
+ return "css";
2776
+ } else {
2777
+ return "text";
2778
+ }
2779
+ }
2764
2780
  /**
2765
2781
  * Get a list of all attributes on this node.
2766
2782
  */
@@ -8177,7 +8193,7 @@ class NoRawCharacters extends Rule {
8177
8193
  setup() {
8178
8194
  this.on("element:ready", (event) => {
8179
8195
  const node = event.target;
8180
- if (node.matches("script, style")) {
8196
+ if (node.textType !== "text") {
8181
8197
  return;
8182
8198
  }
8183
8199
  for (const child of node.childNodes) {
@@ -9472,6 +9488,9 @@ class UnknownCharReference extends Rule {
9472
9488
  setup() {
9473
9489
  this.on("element:ready", (event) => {
9474
9490
  const node = event.target;
9491
+ if (node.textType !== "text") {
9492
+ return;
9493
+ }
9475
9494
  for (const child of node.childNodes) {
9476
9495
  if (child.nodeType !== NodeType.TEXT_NODE) {
9477
9496
  continue;
@@ -11832,7 +11851,7 @@ class EventHandler {
11832
11851
  }
11833
11852
 
11834
11853
  const name = "html-validate";
11835
- const version = "10.1.0";
11854
+ const version = "10.1.1";
11836
11855
  const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
11837
11856
 
11838
11857
  function freeze(src) {