Fixed markdown parsing error particularly with the spoiler tag. (#2200)

This commit is contained in:
Jason Grim 2023-10-25 15:26:14 -04:00 committed by GitHub
parent 069c2c787f
commit c22358e0d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,10 +63,9 @@ const spoilerConfig = {
render: (tokens: any, idx: any) => { render: (tokens: any, idx: any) => {
const m = tokens[idx].info.trim().match(/^spoiler\s+(.*)$/); const m = tokens[idx].info.trim().match(/^spoiler\s+(.*)$/);
const summary = mdToHtmlInline(md.utils.escapeHtml(m[1])).__html;
if (tokens[idx].nesting === 1) { if (tokens[idx].nesting === 1) {
// opening tag // opening tag
const summary = mdToHtmlInline(md.utils.escapeHtml(m[1])).__html;
return `<details><summary> ${summary} </summary>\n`; return `<details><summary> ${summary} </summary>\n`;
} else { } else {
// closing tag // closing tag