From 4e5643fb492415ac496b7b3f35cc0ae04e5a43c0 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Tue, 30 Jan 2024 23:51:21 -0800 Subject: [PATCH] fix: properly parse tags in body --- quartz/plugins/transformers/ofm.ts | 5 +++-- 1 file 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 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin } 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 {