From efdce070e1cea59d52d9f3bf47d468890658eceb Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sun, 28 Jan 2024 06:15:25 +0000
Subject: [PATCH] deps: bump flexsearch
---
quartz/plugins/transformers/ofm.ts | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts
index c067296..735d114 100644
--- a/quartz/plugins/transformers/ofm.ts
+++ b/quartz/plugins/transformers/ofm.ts
@@ -108,7 +108,8 @@
function canonicalizeCallout(calloutName: string): keyof typeof callouts {
let callout = calloutName.toLowerCase() as keyof typeof calloutMapping
- return calloutMapping[callout] ?? "note"
+ // if callout is not recognized, make it a custom one
+ return calloutMapping[callout] ?? calloutName
}
export const externalLinkRegex = /^https?:\/\//i
@@ -317,7 +318,7 @@
}
tag = slugTag(tag)
- if (file.data.frontmatter && !file.data.frontmatter.tags.includes(tag)) {
+ if (file.data.frontmatter?.tags?.includes(tag)) {
file.data.frontmatter.tags.push(tag)
}
@@ -431,7 +432,7 @@
value: `<div
class="callout-title"
>
- <div class="callout-icon">${callouts[calloutType]}</div>
+ <div class="callout-icon">${callouts[calloutType] ?? callouts.note}</div>
<div class="callout-title-inner">${title}</div>
${collapse ? toggleIcon : ""}
</div>`,
@@ -457,7 +458,7 @@
node.data = {
hProperties: {
...(node.data?.hProperties ?? {}),
- className: `callout ${collapse ? "is-collapsible" : ""} ${
+ className: `callout ${calloutType} ${collapse ? "is-collapsible" : ""} ${
defaultState === "collapsed" ? "is-collapsed" : ""
}`,
"data-callout": calloutType,
--
Gitblit v1.10.0