Skip to content

Commit

Permalink
fix: handle references in container titles
Browse files Browse the repository at this point in the history
closes #3004
  • Loading branch information
brc-dd committed Sep 23, 2023
1 parent 0d56855 commit 7fbfe71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node/markdown/plugins/containers.ts
Expand Up @@ -38,12 +38,12 @@ function createContainer(
container,
klass,
{
render(tokens, idx) {
render(tokens, idx, _options, env) {
const token = tokens[idx]
const info = token.info.trim().slice(klass.length).trim()
const attrs = md.renderer.renderAttrs(token)
if (token.nesting === 1) {
const title = md.renderInline(info || defaultTitle)
const title = md.renderInline(info || defaultTitle, { ...env })
if (klass === 'details')
return `<details class="${klass} custom-block"${attrs}><summary>${title}</summary>\n`
return `<div class="${klass} custom-block"${attrs}><p class="custom-block-title">${title}</p>\n`
Expand Down

0 comments on commit 7fbfe71

Please sign in to comment.