diff --git a/workers/dynamic-pages/utils/formatters.js b/workers/dynamic-pages/utils/formatters.js index 72466a4a..63f540b7 100644 --- a/workers/dynamic-pages/utils/formatters.js +++ b/workers/dynamic-pages/utils/formatters.js @@ -1,4 +1,6 @@ import markdownIt from "markdown-it"; +import markdownItAnchor from "markdown-it-anchor"; +import markdownItFootnote from "markdown-it-footnote"; export const formatDate = (date) => new Date(date).toLocaleDateString("en-US", { @@ -6,4 +8,13 @@ export const formatDate = (date) => month: "long", day: "numeric", }); + export const md = markdownIt({ html: true, linkify: true }); + +md.use(markdownItAnchor, { + level: [1, 2], + permalink: markdownItAnchor.permalink.headerLink({ + safariReaderFix: true, + }), +}); +md.use(markdownItFootnote); \ No newline at end of file