html-validate 6.7.0 → 6.7.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/es/core.js CHANGED
@@ -2955,7 +2955,7 @@ var TRANSFORMER_API;
2955
2955
  /** @public */
2956
2956
  const name = "html-validate";
2957
2957
  /** @public */
2958
- const version = "6.7.0";
2958
+ const version = "6.7.1";
2959
2959
  /** @public */
2960
2960
  const homepage = "https://html-validate.org";
2961
2961
  /** @public */
@@ -7241,7 +7241,7 @@ class TelNonBreaking extends Rule {
7241
7241
  if (isIgnored) {
7242
7242
  return;
7243
7243
  }
7244
- this.walk(target);
7244
+ this.walk(target, target);
7245
7245
  });
7246
7246
  }
7247
7247
  isRelevant(event) {
@@ -7257,17 +7257,17 @@ class TelNonBreaking extends Rule {
7257
7257
  }
7258
7258
  return true;
7259
7259
  }
7260
- walk(node) {
7260
+ walk(anchor, node) {
7261
7261
  for (const child of node.childNodes) {
7262
7262
  if (isTextNode(child)) {
7263
- this.detectDisallowed(child);
7263
+ this.detectDisallowed(anchor, child);
7264
7264
  }
7265
7265
  else if (isElementNode(child)) {
7266
- this.walk(child);
7266
+ this.walk(anchor, child);
7267
7267
  }
7268
7268
  }
7269
7269
  }
7270
- detectDisallowed(node) {
7270
+ detectDisallowed(anchor, node) {
7271
7271
  const [offset, text] = getText(node);
7272
7272
  const matches = matchAll(text, this.regex);
7273
7273
  for (const match of matches) {
@@ -7277,12 +7277,12 @@ class TelNonBreaking extends Rule {
7277
7277
  if (!entry) {
7278
7278
  throw new Error(`Failed to find entry for "${detected}" when searching text "${text}"`);
7279
7279
  }
7280
- const message = `"${detected}" should be replaced with "${entry.replacement}" in telephone number`;
7280
+ const message = `"${detected}" should be replaced with "${entry.replacement}" (${entry.description}) in telephone number`;
7281
7281
  const begin = offset + match.index;
7282
7282
  const end = begin + detected.length;
7283
7283
  const location = sliceLocation(node.location, begin, end);
7284
7284
  const context = entry;
7285
- this.report(node, message, location, context);
7285
+ this.report(anchor, message, location, context);
7286
7286
  }
7287
7287
  }
7288
7288
  }
@@ -12160,6 +12160,7 @@ const formatter$4 = checkstyleFormatter;
12160
12160
 
12161
12161
  const defaults = {
12162
12162
  showLink: true,
12163
+ showSummary: true,
12163
12164
  };
12164
12165
  /**
12165
12166
  * Codeframe formatter based on ESLint codeframe.
@@ -12274,9 +12275,11 @@ function codeframe(results, options) {
12274
12275
  return resultsOutput.concat(messages);
12275
12276
  }, [])
12276
12277
  .join("\n");
12277
- output += "\n";
12278
- output += formatSummary(errors, warnings);
12279
- output += "\n";
12278
+ if (merged.showSummary) {
12279
+ output += "\n";
12280
+ output += formatSummary(errors, warnings);
12281
+ output += "\n";
12282
+ }
12280
12283
  return errors + warnings > 0 ? output : "";
12281
12284
  }
12282
12285
  const formatter$3 = codeframe;