From c22358e0d25e0b6d6e57699a2bedbc467a75f89c Mon Sep 17 00:00:00 2001 From: Jason Grim Date: Wed, 25 Oct 2023 15:26:14 -0400 Subject: [PATCH] Fixed markdown parsing error particularly with the spoiler tag. (#2200) --- src/shared/markdown.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/shared/markdown.ts b/src/shared/markdown.ts index 24a62a5e..4678a066 100644 --- a/src/shared/markdown.ts +++ b/src/shared/markdown.ts @@ -63,10 +63,9 @@ const spoilerConfig = { render: (tokens: any, idx: any) => { const m = tokens[idx].info.trim().match(/^spoiler\s+(.*)$/); - const summary = mdToHtmlInline(md.utils.escapeHtml(m[1])).__html; - if (tokens[idx].nesting === 1) { // opening tag + const summary = mdToHtmlInline(md.utils.escapeHtml(m[1])).__html; return `
${summary} \n`; } else { // closing tag