feat: made default markdown not use the measurements plugin

This commit is contained in:
Leyla Becker 2026-02-22 16:29:46 -06:00
parent 63bd438e45
commit 2cbd931e99
5 changed files with 31 additions and 18 deletions

20
lib/footnotes/plugin.js Normal file
View file

@ -0,0 +1,20 @@
const markdownItFootnote = require("markdown-it-footnote");
// Wraps markdown-it-footnote and customizes rendering to remove brackets
const markdownItFootnoteCustom = (md) => {
md.use(markdownItFootnote);
md.renderer.rules.footnote_ref = (tokens, idx, options, env, slf) => {
const id = slf.rules.footnote_anchor_name(tokens, idx, options, env, slf);
const n = Number(tokens[idx].meta.id + 1).toString();
let refid = id;
if (tokens[idx].meta.subId > 0) {
refid += ':' + tokens[idx].meta.subId;
}
return '<sup class="footnote-ref"><a href="#fn' + id + '" id="fnref' + refid + '">' + n + '</a></sup>';
};
};
module.exports = markdownItFootnoteCustom;