diff --git a/src/node/markdown/plugins/containers.ts b/src/node/markdown/plugins/containers.ts index 6b08fc3d..073fb38d 100644 --- a/src/node/markdown/plugins/containers.ts +++ b/src/node/markdown/plugins/containers.ts @@ -62,15 +62,16 @@ function createContainer( { render(tokens, idx, _options, env: MarkdownEnv & { references?: any }) { const token = tokens[idx] - const info = token.info.trim().slice(klass.length).trim() - const attrs = md.renderer.renderAttrs(token) if (token.nesting === 1) { + token.attrJoin('class', `${klass} custom-block`) + const attrs = md.renderer.renderAttrs(token) + const info = token.info.trim().slice(klass.length).trim() const title = md.renderInline(info || defaultTitle, { references: env.references }) if (klass === 'details') - return `
${title}\n` - return `

${title}

\n` + return `
${title}\n` + return `

${title}

\n` } else return klass === 'details' ? `
\n` : `
\n` } }