File tree 1 file changed +5
-4
lines changed
src/node/markdown/plugins
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -62,15 +62,16 @@ function createContainer(
62
62
{
63
63
render ( tokens , idx , _options , env : MarkdownEnv & { references ?: any } ) {
64
64
const token = tokens [ idx ]
65
- const info = token . info . trim ( ) . slice ( klass . length ) . trim ( )
66
- const attrs = md . renderer . renderAttrs ( token )
67
65
if ( token . nesting === 1 ) {
66
+ token . attrJoin ( 'class' , `${ klass } custom-block` )
67
+ const attrs = md . renderer . renderAttrs ( token )
68
+ const info = token . info . trim ( ) . slice ( klass . length ) . trim ( )
68
69
const title = md . renderInline ( info || defaultTitle , {
69
70
references : env . references
70
71
} )
71
72
if ( klass === 'details' )
72
- return `<details class=" ${ klass } custom-block" ${ attrs } ><summary>${ title } </summary>\n`
73
- return `<div class=" ${ klass } custom-block" ${ attrs } ><p class="custom-block-title">${ title } </p>\n`
73
+ return `<details ${ attrs } ><summary>${ title } </summary>\n`
74
+ return `<div ${ attrs } ><p class="custom-block-title">${ title } </p>\n`
74
75
} else return klass === 'details' ? `</details>\n` : `</div>\n`
75
76
}
76
77
}
You can’t perform that action at this time.
0 commit comments