Jacky Zhao
2024-01-31 7cb1c291c802b74dc47d235f094e5d9134f95283
fix: allow formatting in callout titles
2 files modified
10 ■■■■■ changed files
docs/features/callouts.md 5 ●●●●● patch | view | raw | blame | history
quartz/plugins/transformers/ofm.ts 5 ●●●● patch | view | raw | blame | history
docs/features/callouts.md
@@ -36,7 +36,8 @@
 --color: #customcolor;
 --border: #custombordercolor;
 --bg: #custombg;
 --callout-icon: url('data:image/svg+xml; utf8, <custom formatted svg>'); //SVG icon code
    --callout-icon: url("data:image/svg+xml; utf8, <custom formatted svg>"); //SVG icon code
  }
}
```
@@ -48,7 +49,7 @@
> [!info]
> Default title
> [!question]+ Can callouts be nested?
> [!question]+ Can callouts be _nested_?
>
> > [!todo]- Yes!, they can. And collapsed!
> >
quartz/plugins/transformers/ofm.ts
@@ -387,10 +387,7 @@
                  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)