mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 19:46:23 +00:00
fix: regression in formatted callout titles
This commit is contained in:
parent
422986c98b
commit
bfd877133b
1 changed files with 9 additions and 3 deletions
|
@ -383,11 +383,17 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
|
||||||
const calloutType = canonicalizeCallout(typeString.toLowerCase())
|
const calloutType = canonicalizeCallout(typeString.toLowerCase())
|
||||||
const collapse = collapseChar === "+" || collapseChar === "-"
|
const collapse = collapseChar === "+" || collapseChar === "-"
|
||||||
const defaultState = collapseChar === "-" ? "collapsed" : "expanded"
|
const defaultState = collapseChar === "-" ? "collapsed" : "expanded"
|
||||||
const titleContent =
|
const titleContent = match.input.slice(calloutDirective.length).trim()
|
||||||
match.input.slice(calloutDirective.length).trim() || capitalize(calloutType)
|
const useDefaultTitle = titleContent === "" && restOfTitle.length === 0
|
||||||
const titleNode: Paragraph = {
|
const titleNode: Paragraph = {
|
||||||
type: "paragraph",
|
type: "paragraph",
|
||||||
children: [{ type: "text", value: titleContent + " " }, ...restOfTitle],
|
children: [
|
||||||
|
{
|
||||||
|
type: "text",
|
||||||
|
value: useDefaultTitle ? capitalize(calloutType) : titleContent + " ",
|
||||||
|
},
|
||||||
|
...restOfTitle,
|
||||||
|
],
|
||||||
}
|
}
|
||||||
const title = mdastToHtml(titleNode)
|
const title = mdastToHtml(titleNode)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue