html-validate 10.11.1 → 10.11.3

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.
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.57.6"
8
+ "packageVersion": "7.58.0"
9
9
  }
10
10
  ]
11
11
  }
package/dist/esm/core.js CHANGED
@@ -6823,14 +6823,14 @@ class EmptyTitle extends Rule {
6823
6823
  }
6824
6824
  switch (classifyNodeText(node)) {
6825
6825
  case TextClassification.DYNAMIC_TEXT:
6826
- case TextClassification.STATIC_TEXT:
6826
+ case TextClassification.STATIC_TEXT: {
6827
6827
  break;
6828
- case TextClassification.EMPTY_TEXT:
6829
- {
6830
- const message = `<${node.tagName}> cannot be empty, must have text content`;
6831
- this.report(node, message, node.location);
6832
- }
6828
+ }
6829
+ case TextClassification.EMPTY_TEXT: {
6830
+ const message = `<${node.tagName}> cannot be empty, must have text content`;
6831
+ this.report(node, message, node.location);
6833
6832
  break;
6833
+ }
6834
6834
  }
6835
6835
  });
6836
6836
  }
@@ -9869,6 +9869,10 @@ const lowercaseEntities = entities$1.map((it) => it.toLowerCase());
9869
9869
  function isNumerical(entity) {
9870
9870
  return entity.startsWith("&#");
9871
9871
  }
9872
+ function isAfterQueryOrFragment(delimiterIndex, match) {
9873
+ const matchIndex = match.match.index ?? 0;
9874
+ return delimiterIndex !== -1 && matchIndex > delimiterIndex;
9875
+ }
9872
9876
  function getLocation(location, entity, match) {
9873
9877
  const index = match.index ?? 0;
9874
9878
  return sliceLocation(location, index, index + entity.length);
@@ -9944,18 +9948,21 @@ class UnknownCharReference extends Rule {
9944
9948
  }
9945
9949
  }
9946
9950
  findCharacterReferences(node, text, location, { isAttribute }) {
9947
- const isQuerystring = isAttribute && text.includes("?");
9951
+ const delimiter = text.search(/[?#]/);
9948
9952
  for (const match of this.getMatches(text)) {
9949
- this.validateCharacterReference(node, location, match, { isQuerystring });
9953
+ const allowUnterminated = isAttribute && isAfterQueryOrFragment(delimiter, match);
9954
+ this.validateCharacterReference(node, location, match, {
9955
+ allowUnterminated
9956
+ });
9950
9957
  }
9951
9958
  }
9952
- validateCharacterReference(node, location, foobar, { isQuerystring }) {
9959
+ validateCharacterReference(node, location, entityMatch, { allowUnterminated }) {
9953
9960
  const { requireSemicolon } = this.options;
9954
- const { match, entity, raw, terminated } = foobar;
9961
+ const { match, entity, raw, terminated } = entityMatch;
9955
9962
  if (isNumerical(entity)) {
9956
9963
  return;
9957
9964
  }
9958
- if (isQuerystring && !terminated) {
9965
+ if (!terminated && allowUnterminated) {
9959
9966
  return;
9960
9967
  }
9961
9968
  const found = this.entities.includes(entity);
@@ -12494,7 +12501,7 @@ class EventHandler {
12494
12501
  }
12495
12502
 
12496
12503
  const name = "html-validate";
12497
- const version = "10.11.1";
12504
+ const version = "10.11.3";
12498
12505
  const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
12499
12506
 
12500
12507
  function freeze(src) {