html-validate 10.11.1 → 10.11.2
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 +13 -6
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/tsdoc-metadata.json +1 -1
- package/dist/esm/core.js +13 -6
- package/dist/esm/core.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +1 -1
package/dist/esm/core.js
CHANGED
|
@@ -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
|
|
9951
|
+
const delimiter = text.search(/[?#]/);
|
|
9948
9952
|
for (const match of this.getMatches(text)) {
|
|
9949
|
-
|
|
9953
|
+
const allowUnterminated = isAttribute && isAfterQueryOrFragment(delimiter, match);
|
|
9954
|
+
this.validateCharacterReference(node, location, match, {
|
|
9955
|
+
allowUnterminated
|
|
9956
|
+
});
|
|
9950
9957
|
}
|
|
9951
9958
|
}
|
|
9952
|
-
validateCharacterReference(node, location,
|
|
9959
|
+
validateCharacterReference(node, location, entityMatch, { allowUnterminated }) {
|
|
9953
9960
|
const { requireSemicolon } = this.options;
|
|
9954
|
-
const { match, entity, raw, terminated } =
|
|
9961
|
+
const { match, entity, raw, terminated } = entityMatch;
|
|
9955
9962
|
if (isNumerical(entity)) {
|
|
9956
9963
|
return;
|
|
9957
9964
|
}
|
|
9958
|
-
if (
|
|
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.
|
|
12504
|
+
const version = "10.11.2";
|
|
12498
12505
|
const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
|
|
12499
12506
|
|
|
12500
12507
|
function freeze(src) {
|