From 8ffd7fbc1f4828d2868c761927dd0e1a2b89337b Mon Sep 17 00:00:00 2001 From: biosfood Date: Mon, 11 Sep 2023 17:19:01 +0200 Subject: [PATCH] allow limited markdown in spoiler summary --- src/shared/markdown.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/markdown.ts b/src/shared/markdown.ts index 65ff34042..f57929fab 100644 --- a/src/shared/markdown.ts +++ b/src/shared/markdown.ts @@ -61,10 +61,11 @@ const spoilerConfig = { render: (tokens: any, idx: any) => { var m = tokens[idx].info.trim().match(/^spoiler\s+(.*)$/); + var summary = mdToHtmlInline(md.utils.escapeHtml(m[1])).__html; if (tokens[idx].nesting === 1) { // opening tag - return `
${md.utils.escapeHtml(m[1])} \n`; + return `
${summary} \n`; } else { // closing tag return "
\n";