From 75d64eac9135e63cda0c2beb51791109070b2575 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Wed, 31 Jan 2024 19:58:54 +0000
Subject: [PATCH] fix: fmt
---
quartz/plugins/transformers/ofm.ts | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts
index 8c405bf..7cd9499 100644
--- a/quartz/plugins/transformers/ofm.ts
+++ b/quartz/plugins/transformers/ofm.ts
@@ -290,8 +290,9 @@
}
tag = slugTag(tag)
- if (file.data.frontmatter?.tags?.includes(tag)) {
- file.data.frontmatter.tags.push(tag)
+ if (file.data.frontmatter) {
+ const noteTags = file.data.frontmatter.tags ?? []
+ file.data.frontmatter.tags = [...new Set([...noteTags, tag])]
}
return {
@@ -386,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)
--
Gitblit v1.10.0