Update MD051/link-fragments to allow HTML's implicit "#top" fragment (fixes #1488).

This commit is contained in:
David Anson 2025-03-15 16:30:32 -07:00
parent 5749c8dcf7
commit 50300fa7af
7 changed files with 58 additions and 1 deletions

View file

@ -66,7 +66,8 @@ export default {
"parser": "micromark",
"function": function MD051(params, onError) {
const ignoreCase = params.config.ignore_case || false;
const fragments = new Map();
/** @type {Map<string, number>} */
const fragments = new Map([ [ "#top", 0 ] ]);
// Process headings
const headingTexts = filterByTypesCached([ "atxHeadingText", "setextHeadingText" ]);