From 8b76167ccfbe5bf21295db6905451e1c50ca4407 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sat, 2 Sep 2023 00:01:58 +0530 Subject: [PATCH] fix: respect attrs on custom containers --- src/node/markdown/plugins/containers.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/node/markdown/plugins/containers.ts b/src/node/markdown/plugins/containers.ts index b9397581..d90f4db3 100644 --- a/src/node/markdown/plugins/containers.ts +++ b/src/node/markdown/plugins/containers.ts @@ -41,15 +41,13 @@ function createContainer( render(tokens, idx) { 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) - if (klass === 'details') { - return `
${title}\n` - } - return `

${title}

\n` - } else { - return klass === 'details' ? `
\n` : `\n` - } + if (klass === 'details') + return `
${title}\n` + return `

${title}

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