From c63ea4a63bd19cb3048f2ef5781845bb68531203 Mon Sep 17 00:00:00 2001 From: kfule Date: Sat, 27 Sep 2025 12:27:38 +0900 Subject: [PATCH] Replace the "[version]" in the body of the markdown, fix #37 The "[]" in the link will be encoded, so "[version]" must be replaced before marked conversion. --- scripts/_build/generator.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/_build/generator.js b/scripts/_build/generator.js index a4596cae..01a4533f 100644 --- a/scripts/_build/generator.js +++ b/scripts/_build/generator.js @@ -117,6 +117,9 @@ export async function makeGenerator() { // fix links body = body.replace(/\]\((?!\w+:\/\/)(.+?)\.md([)#])/gim, "]($1.html$2") + // update version + body = body.replaceAll("[version]", versions.mithril) + let markedHtml = marked(body) // inject anchors