Skip to content

Commit 22265e3

Browse files
nodejs-github-bottargos
authored andcommitted
tools: update lint-md-dependencies to [email protected]
PR-URL: #40929 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent ae12a60 commit 22265e3

File tree

3 files changed

+62
-2701
lines changed

3 files changed

+62
-2701
lines changed

tools/lint-md/lint-md.mjs

+23-13
Original file line numberDiff line numberDiff line change
@@ -5236,8 +5236,7 @@ const own$6 = {}.hasOwnProperty;
52365236
* @returns {string|false}
52375237
* Decoded reference.
52385238
*/
5239-
function decodeEntity(value) {
5240-
// @ts-expect-error: to do: use `Record` for `character-entities`.
5239+
function decodeNamedCharacterReference(value) {
52415240
return own$6.call(characterEntities, value) ? characterEntities[value] : false
52425241
}
52435242

@@ -5319,7 +5318,7 @@ function tokenizeCharacterReference(effects, ok, nok) {
53195318

53205319
if (
53215320
test === asciiAlphanumeric &&
5322-
!decodeEntity(self.sliceSerialize(token))
5321+
!decodeNamedCharacterReference(self.sliceSerialize(token))
53235322
) {
53245323
return nok(code)
53255324
}
@@ -10185,7 +10184,7 @@ function decode($0, $1, $2) {
1018510184
return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10)
1018610185
}
1018710186

10188-
return decodeEntity($2) || $0
10187+
return decodeNamedCharacterReference($2) || $0
1018910188
}
1019010189

1019110190
/**
@@ -10680,7 +10679,7 @@ function compiler(options = {}) {
1068010679
* @this {CompileContext}
1068110680
* @param {N} node
1068210681
* @param {Token} token
10683-
* @param {OnError} [errorHandler]
10682+
* @param {OnEnterError} [errorHandler]
1068410683
* @returns {N}
1068510684
*/
1068610685

@@ -10714,9 +10713,15 @@ function compiler(options = {}) {
1071410713
exit.call(this, token);
1071510714
}
1071610715
}
10717-
/** @type {CompileContext['exit']} */
10716+
/**
10717+
* @type {CompileContext['exit']}
10718+
* @this {CompileContext}
10719+
* @param {Token} token
10720+
* @param {OnExitError} [onExitError]
10721+
* @returns {Node}
10722+
*/
1071810723

10719-
function exit(token) {
10724+
function exit(token, onExitError) {
1072010725
const node = this.stack.pop();
1072110726
const open = this.tokenStack.pop();
1072210727

@@ -10732,8 +10737,12 @@ function compiler(options = {}) {
1073210737
'): it’s not open'
1073310738
)
1073410739
} else if (open[0].type !== token.type) {
10735-
const handler = open[1] || defaultOnError;
10736-
handler.call(this, token, open[0]);
10740+
if (onExitError) {
10741+
onExitError.call(this, token, open[0]);
10742+
} else {
10743+
const handler = open[1] || defaultOnError;
10744+
handler.call(this, token, open[0]);
10745+
}
1073710746
}
1073810747

1073910748
node.position.end = point(token.end);
@@ -11093,9 +11102,10 @@ function compiler(options = {}) {
1109311102
);
1109411103
setData('characterReferenceType');
1109511104
} else {
11096-
// @ts-expect-error `decodeEntity` can return false for invalid named
11097-
// character references, but everything we’ve tokenized is valid.
11098-
value = decodeEntity(data);
11105+
// @ts-expect-error `decodeNamedCharacterReference` can return false for
11106+
// invalid named character references, but everything we’ve tokenized is
11107+
// valid.
11108+
value = decodeNamedCharacterReference(data);
1109911109
}
1110011110

1110111111
const tail = this.stack.pop();
@@ -11325,7 +11335,7 @@ function extension(combined, extension) {
1132511335
}
1132611336
}
1132711337
}
11328-
/** @type {OnError} */
11338+
/** @type {OnEnterError} */
1132911339

1133011340
function defaultOnError(left, right) {
1133111341
if (left) {

0 commit comments

Comments
 (0)