From 444e05ee21687473c17c19e1d52d7da39694971c Mon Sep 17 00:00:00 2001
From: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 01 Feb 2024 02:35:29 +0000
Subject: [PATCH] chore(deps-dev): bump @types/hast from 3.0.3 to 3.0.4 (#780)
---
quartz/plugins/transformers/ofm.ts | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts
index 7cd9499..44df3fa 100644
--- a/quartz/plugins/transformers/ofm.ts
+++ b/quartz/plugins/transformers/ofm.ts
@@ -383,11 +383,17 @@
const calloutType = canonicalizeCallout(typeString.toLowerCase())
const collapse = collapseChar === "+" || collapseChar === "-"
const defaultState = collapseChar === "-" ? "collapsed" : "expanded"
- const titleContent =
- match.input.slice(calloutDirective.length).trim() || capitalize(calloutType)
+ const titleContent = match.input.slice(calloutDirective.length).trim()
+ const useDefaultTitle = titleContent === "" && restOfTitle.length === 0
const titleNode: Paragraph = {
type: "paragraph",
- children: [{ type: "text", value: titleContent + " " }, ...restOfTitle],
+ children: [
+ {
+ type: "text",
+ value: useDefaultTitle ? capitalize(calloutType) : titleContent + " ",
+ },
+ ...restOfTitle,
+ ],
}
const title = mdastToHtml(titleNode)
--
Gitblit v1.10.0