From 4e5643fb492415ac496b7b3f35cc0ae04e5a43c0 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Wed, 31 Jan 2024 07:51:21 +0000
Subject: [PATCH] fix: properly parse tags in body
---
quartz/plugins/transformers/ofm.ts | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts
index 8c405bf..d58eaf6 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 {
--
Gitblit v1.10.0