Skip to content

Commit 8f0b2a0

Browse files
committed
refactor: simplefiy joining class attributes
1 parent 2231893 commit 8f0b2a0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Diff for: src/node/markdown/plugins/preWrapper.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ export function preWrapperPlugin(md: MarkdownIt, options: Options) {
2626
if (classAttr != null) {
2727
classAttr[1] = `${classes} ${classAttr[1]}`
2828
} else {
29-
const attrs: Array<[string, string]> = [['class', classes]]
30-
31-
token.attrs = token.attrs ? token.attrs.concat(attrs) : attrs
29+
token.attrJoin('class', classes)
3230
}
3331

3432
const rawCode = fence(...args)

0 commit comments

Comments
 (0)