From 8eec47c340d48d9b45970a88da0aaff4e216a7e2 Mon Sep 17 00:00:00 2001
From: kabirgh <15871468+kabirgh@users.noreply.github.com>
Date: Mon, 15 Jan 2024 16:39:16 +0000
Subject: [PATCH] fix: rebuild errors on windows (#692)

---
 quartz/plugins/transformers/syntax.ts |   42 +++++++++++++++++-------------------------
 1 files changed, 17 insertions(+), 25 deletions(-)

diff --git a/quartz/plugins/transformers/syntax.ts b/quartz/plugins/transformers/syntax.ts
index f09daaa..e847729 100644
--- a/quartz/plugins/transformers/syntax.ts
+++ b/quartz/plugins/transformers/syntax.ts
@@ -1,28 +1,20 @@
-import { PluggableList } from "unified"
 import { QuartzTransformerPlugin } from "../types"
 import rehypePrettyCode, { Options as CodeOptions } from "rehype-pretty-code"
 
-export class SyntaxHighlighting extends QuartzTransformerPlugin {
-  name = "SyntaxHighlighting"
-
-  markdownPlugins(): PluggableList {
-    return []
-  }
-
-  htmlPlugins(): PluggableList {
-    return [[rehypePrettyCode, {
-      theme: 'css-variables',
-      onVisitLine(node) {
-        if (node.children.length === 0) {
-          node.children = [{ type: 'text', value: ' ' }]
-        }
-      },
-      onVisitHighlightedLine(node) {
-        node.properties.className.push('highlighted')
-      },
-      onVisitHighlightedWord(node) {
-        node.properties.className = ['word']
-      },
-    } satisfies Partial<CodeOptions>]]
-  }
-}
+export const SyntaxHighlighting: QuartzTransformerPlugin = () => ({
+  name: "SyntaxHighlighting",
+  htmlPlugins() {
+    return [
+      [
+        rehypePrettyCode,
+        {
+          keepBackground: false,
+          theme: {
+            dark: "github-dark",
+            light: "github-light",
+          },
+        } satisfies Partial<CodeOptions>,
+      ],
+    ]
+  },
+})

--
Gitblit v1.10.0