.callout-content support

This commit is contained in:
Emile Bangma 2024-06-07 10:26:27 +00:00
parent 688c5484a9
commit ac93fe31a2
2 changed files with 17 additions and 1 deletions

View File

@ -492,6 +492,22 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
"data-callout-metadata": calloutMetaData,
},
}
// Add callout-content class to callout body if it has one.
if (node.children.length > 1) {
const contentData = node.children[1]
node.children[1] = {
data: {
hProperties: {
...(contentData.data?.hProperties ?? {}),
className: "callout-content",
},
hName: "div",
},
type: "blockquote",
children: [contentData],
}
}
}
})
}

View File

@ -10,7 +10,7 @@
transition: max-height 0.3s ease;
box-sizing: border-box;
& > *:nth-child(2) {
& > .callout-content > :first-child {
margin-top: 0;
}