From d2a685e50d20101a42b7d9d08d1b90bb92defcd3 Mon Sep 17 00:00:00 2001 From: Alexis Hovorka Date: Sat, 17 Aug 2024 19:32:06 -0600 Subject: [feat] Yet more tweaks --- .eleventy.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to '.eleventy.js') diff --git a/.eleventy.js b/.eleventy.js index 6cb78a0..e7794ce 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -55,8 +55,17 @@ module.exports = (cfg) => { const md = require("markdown-it")({ typographer: true, html: true, highlight: (str, lang) => { + let starting = 1; + let numLength; + if (lang.includes(":")) { + lang = lang.split(":"); + starting = lang[1]; + numLength = lang[2]; + lang = lang[0]; + } if (lang && hljs.getLanguage(lang)) { try { - return '
' +
+        return '
' +
           hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +
         '
'; } catch (__) {} } @@ -66,6 +75,7 @@ module.exports = (cfg) => { }).use(require("markdown-it-anchor"), { permalink: true, permalinkBefore: true, permalinkSymbol: "#"}) .use(require("markdown-it-emoji"), {shortcuts: {}}) + .use(require("markdown-it-footnote")) .use(require("markdown-it-mark")); md.renderer.rules.emoji = (token, i) => @@ -74,6 +84,10 @@ module.exports = (cfg) => { md.renderer.rules.code_block = (tokens, i, options, env, slf) => `` + utils.escapeHtml(tokens[i].content.replace(/ /g, "\xA0"))+'
\n'; + md.renderer.rules.footnote_block_open = () => ( + '
\n' + + '
    \n' + ); cfg.setLibrary("md", md); -- cgit v1.2.3-70-g09d2