mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-26 13:26:22 +00:00
chore(callouts): remove unnecessary whitespaces after class name (#833)
Though we should have a plugins that just strip whitespace in all node class. Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
This commit is contained in:
parent
6ae0bb0908
commit
ab80eba794
1 changed files with 9 additions and 3 deletions
|
@ -450,13 +450,19 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
|
||||||
// replace first line of blockquote with title and rest of the paragraph text
|
// replace first line of blockquote with title and rest of the paragraph text
|
||||||
node.children.splice(0, 1, ...blockquoteContent)
|
node.children.splice(0, 1, ...blockquoteContent)
|
||||||
|
|
||||||
|
const classNames = ["callout", calloutType]
|
||||||
|
if (collapse) {
|
||||||
|
classNames.push("is-collapsible")
|
||||||
|
}
|
||||||
|
if (defaultState === "collapsed") {
|
||||||
|
classNames.push("is-collapsed")
|
||||||
|
}
|
||||||
|
|
||||||
// add properties to base blockquote
|
// add properties to base blockquote
|
||||||
node.data = {
|
node.data = {
|
||||||
hProperties: {
|
hProperties: {
|
||||||
...(node.data?.hProperties ?? {}),
|
...(node.data?.hProperties ?? {}),
|
||||||
className: `callout ${calloutType} ${collapse ? "is-collapsible" : ""} ${
|
className: classNames.join(" "),
|
||||||
defaultState === "collapsed" ? "is-collapsed" : ""
|
|
||||||
}`,
|
|
||||||
"data-callout": calloutType,
|
"data-callout": calloutType,
|
||||||
"data-callout-fold": collapse,
|
"data-callout-fold": collapse,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue