diff --git a/.eleventy.js b/.eleventy.js index 43a41fd83..78a23b722 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -140,6 +140,22 @@ module.exports = function (eleventyConfig) { return defaultLinkRule(tokens, idx, options, env, self); }; + // Footnote heading fix (till the upstream releases the fix) + md.renderer.rules.render_footnote_anchor_name = ( + tokens, + idx, + options, + env + ) => { + var n = Number(tokens[idx].meta.id + 1).toString(); + var prefix = ""; + + if (env && typeof env.docId === "string") { + prefix = "-" + env.docId + "-"; + } + + return prefix + n; + }; }); eleventyConfig.setLibrary("md", markdownLib);