From 7cb1c291c802b74dc47d235f094e5d9134f95283 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Wed, 31 Jan 2024 11:41:27 -0800 Subject: [PATCH] fix: allow formatting in callout titles --- docs/features/callouts.md | 13 +++++++------ quartz/plugins/transformers/ofm.ts | 5 +---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/features/callouts.md b/docs/features/callouts.md index 64a5171..d739792 100644 --- a/docs/features/callouts.md +++ b/docs/features/callouts.md @@ -32,11 +32,12 @@ By default, custom callouts are handled by applying the `note` style. To make fa ```scss title="quartz/styles/custom.scss" .callout { - &[data-callout="custom"] { - --color: #customcolor; - --border: #custombordercolor; - --bg: #custombg; - --callout-icon: url('data:image/svg+xml; utf8, '); //SVG icon code + &[data-callout="custom"] { + --color: #customcolor; + --border: #custombordercolor; + --bg: #custombg; + --callout-icon: url("data:image/svg+xml; utf8, "); //SVG icon code + } } ``` @@ -48,7 +49,7 @@ By default, custom callouts are handled by applying the `note` style. To make fa > [!info] > Default title -> [!question]+ Can callouts be nested? +> [!question]+ Can callouts be _nested_? > > > [!todo]- Yes!, they can. And collapsed! > > diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index d58eaf6..7cd9499 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -387,10 +387,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin match.input.slice(calloutDirective.length).trim() || capitalize(calloutType) const titleNode: Paragraph = { type: "paragraph", - children: - restOfTitle.length === 0 - ? [{ type: "text", value: titleContent + " " }] - : restOfTitle, + children: [{ type: "text", value: titleContent + " " }, ...restOfTitle], } const title = mdastToHtml(titleNode)