Skip to content

Commit

Permalink
fix: Footnote in heading (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
uroybd authored Feb 23, 2023
1 parent 717492b commit 18b4be3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 18b4be3

Please sign in to comment.