From 24348b24a94c5f9ca285642b751e6798b92eedd9 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Tue, 20 Jun 2023 05:50:25 +0000
Subject: [PATCH] fix: parsing wikilinks that have codeblock anchors, scroll to anchor

---
 quartz/plugins/transformers/syntax.ts |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/quartz/plugins/transformers/syntax.ts b/quartz/plugins/transformers/syntax.ts
index 16424ec..0f46519 100644
--- a/quartz/plugins/transformers/syntax.ts
+++ b/quartz/plugins/transformers/syntax.ts
@@ -3,9 +3,6 @@
 
 export const SyntaxHighlighting: QuartzTransformerPlugin = () => ({
   name: "SyntaxHighlighting",
-  markdownPlugins() {
-    return []
-  },
   htmlPlugins() {
     return [[rehypePrettyCode, {
       theme: 'css-variables',
@@ -15,10 +12,12 @@
         }
       },
       onVisitHighlightedLine(node) {
+        node.properties.className ??= []
         node.properties.className.push('highlighted')
       },
       onVisitHighlightedWord(node) {
-        node.properties.className = ['word']
+        node.properties.className ??= []
+        node.properties.className.push('word')
       },
     } satisfies Partial<CodeOptions>]]
   }

--
Gitblit v1.10.0