From 1cd256ba63dbc6a9e02889cc7ecc1894614c51b6 Mon Sep 17 00:00:00 2001 From: Merlin Date: Sun, 24 Mar 2024 20:29:54 +0100 Subject: [PATCH] fix markdown headings --- embedg-app/src/discord/markdown.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/embedg-app/src/discord/markdown.js b/embedg-app/src/discord/markdown.js index 87b468177..ca823fa4c 100644 --- a/embedg-app/src/discord/markdown.js +++ b/embedg-app/src/discord/markdown.js @@ -276,7 +276,10 @@ const bodyRules = { }), heading: Object.assign({}, markdown.defaultRules.heading, { match: function (source, state) { - if (state.prevCapture === null || state.prevCapture[0] === "\n") { + if ( + state.prevCapture === null || + state.prevCapture[state.prevCapture.length - 1] === "\n" + ) { const re = /^(#{1,3}) +([^\n]+?)(\n|$)/; return re.exec(source); }