From 08f8e3b4a4879dd7c91c16fbce80c4f2bc5e357f Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Mon, 10 Jul 2023 02:32:24 +0000
Subject: [PATCH] docs + various polish

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

diff --git a/quartz/plugins/transformers/syntax.ts b/quartz/plugins/transformers/syntax.ts
index f09daaa..d2d0103 100644
--- a/quartz/plugins/transformers/syntax.ts
+++ b/quartz/plugins/transformers/syntax.ts
@@ -1,28 +1,11 @@
-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 {
+export const SyntaxHighlighting: QuartzTransformerPlugin = () => ({
+  name: "SyntaxHighlighting",
+  htmlPlugins() {
     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>]]
   }
-}
+})

--
Gitblit v1.10.0