Update MD051/link-fragments to handle backslash-escaping in heading text (fixes #984).

This commit is contained in:
David Anson 2023-09-18 22:20:44 -07:00
parent ca9930464e
commit 941769f204
5 changed files with 35 additions and 25 deletions

View file

@ -13,7 +13,9 @@ const anchorRe = /\{(#[a-z\d]+(?:[-_][a-z\d]+)*)\}/gu;
// Sets for filtering heading tokens during conversion
const childrenExclude = new Set([ "image", "reference", "resource" ]);
const tokensInclude = new Set([ "codeTextData", "data" ]);
const tokensInclude = new Set(
[ "characterEscapeValue", "codeTextData", "data" ]
);
/**
* @typedef {import("../helpers/micromark.cjs").Token} Token