Merge pull request #1448 from hackmdio/feature/spoiler-inline-markdown

Allow inline markdown in spoiler summary syntax
This commit is contained in:
Yukai Huang 2020-03-09 20:31:38 +08:00 committed by GitHub
commit f0fbd09fa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -1124,7 +1124,7 @@ md.use(markdownitContainer, 'spoiler', {
// opening tag
const summary = m[1] && m[1].trim()
if (summary) {
return `<details><summary>${md.utils.escapeHtml(summary)}</summary>\n`
return `<details><summary>${md.renderInline(summary)}</summary>\n`
} else {
return `<details>\n`
}

View File

@ -125,7 +125,7 @@ md.use(markdownitContainer, 'spoiler', {
const partClass = `class="part raw" data-startline="${startline}" data-endline="${endline}"`
const summary = m[1] && m[1].trim()
if (summary) {
return `<details ${partClass}><summary>${md.utils.escapeHtml(summary)}</summary>\n`
return `<details ${partClass}><summary>${md.renderInline(summary)}</summary>\n`
} else {
return `<details ${partClass}>\n`
}