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/cjs/core.js CHANGED
@@ -2986,7 +2986,7 @@ var TRANSFORMER_API;
2986
2986
  /** @public */
2987
2987
  const name = "html-validate";
2988
2988
  /** @public */
2989
- const version = "6.7.0";
2989
+ const version = "6.7.1";
2990
2990
  /** @public */
2991
2991
  const homepage = "https://html-validate.org";
2992
2992
  /** @public */
@@ -7272,7 +7272,7 @@ class TelNonBreaking extends Rule {
7272
7272
  if (isIgnored) {
7273
7273
  return;
7274
7274
  }
7275
- this.walk(target);
7275
+ this.walk(target, target);
7276
7276
  });
7277
7277
  }
7278
7278
  isRelevant(event) {
@@ -7288,17 +7288,17 @@ class TelNonBreaking extends Rule {
7288
7288
  }
7289
7289
  return true;
7290
7290
  }
7291
- walk(node) {
7291
+ walk(anchor, node) {
7292
7292
  for (const child of node.childNodes) {
7293
7293
  if (isTextNode(child)) {
7294
- this.detectDisallowed(child);
7294
+ this.detectDisallowed(anchor, child);
7295
7295
  }
7296
7296
  else if (isElementNode(child)) {
7297
- this.walk(child);
7297
+ this.walk(anchor, child);
7298
7298
  }
7299
7299
  }
7300
7300
  }
7301
- detectDisallowed(node) {
7301
+ detectDisallowed(anchor, node) {
7302
7302
  const [offset, text] = getText(node);
7303
7303
  const matches = matchAll(text, this.regex);
7304
7304
  for (const match of matches) {
@@ -7308,12 +7308,12 @@ class TelNonBreaking extends Rule {
7308
7308
  if (!entry) {
7309
7309
  throw new Error(`Failed to find entry for "${detected}" when searching text "${text}"`);
7310
7310
  }
7311
- const message = `"${detected}" should be replaced with "${entry.replacement}" in telephone number`;
7311
+ const message = `"${detected}" should be replaced with "${entry.replacement}" (${entry.description}) in telephone number`;
7312
7312
  const begin = offset + match.index;
7313
7313
  const end = begin + detected.length;
7314
7314
  const location = sliceLocation(node.location, begin, end);
7315
7315
  const context = entry;
7316
- this.report(node, message, location, context);
7316
+ this.report(anchor, message, location, context);
7317
7317
  }
7318
7318
  }
7319
7319
  }
@@ -12191,6 +12191,7 @@ const formatter$4 = checkstyleFormatter;
12191
12191
 
12192
12192
  const defaults = {
12193
12193
  showLink: true,
12194
+ showSummary: true,
12194
12195
  };
12195
12196
  /**
12196
12197
  * Codeframe formatter based on ESLint codeframe.
@@ -12305,9 +12306,11 @@ function codeframe(results, options) {
12305
12306
  return resultsOutput.concat(messages);
12306
12307
  }, [])
12307
12308
  .join("\n");
12308
- output += "\n";
12309
- output += formatSummary(errors, warnings);
12310
- output += "\n";
12309
+ if (merged.showSummary) {
12310
+ output += "\n";
12311
+ output += formatSummary(errors, warnings);
12312
+ output += "\n";
12313
+ }
12311
12314
  return errors + warnings > 0 ? output : "";
12312
12315
  }
12313
12316
  const formatter$3 = codeframe;