From 9e83af04a78d5988bd517bcc61c48998bbfa17ef Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Mon, 24 Jul 2023 00:07:19 +0000
Subject: [PATCH] refactor static and asset emission to be actual emitter plugins
---
quartz/plugins/transformers/ofm.ts | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts
index 6b68fcc..3f58d0f 100644
--- a/quartz/plugins/transformers/ofm.ts
+++ b/quartz/plugins/transformers/ofm.ts
@@ -110,7 +110,7 @@
// from https://github.com/escwxyz/remark-obsidian-callout/blob/main/src/index.ts
const calloutRegex = new RegExp(/^\[\!(\w+)\]([+-]?)/)
// (?:^| ) -> non-capturing group, tag should start be separated by a space or be the start of the line
-// #(\w+) -> tag itself is # followed by a string of alpha-numeric characters
+// #(\w+) -> tag itself is # followed by a string of alpha-numeric characters
const tagRegex = new RegExp(/(?:^| )#(\w+)/, "g")
export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options> | undefined> = (
@@ -225,7 +225,7 @@
findAndReplace(tree, commentRegex, (_value: string, ..._capture: string[]) => {
return {
type: "text",
- value: ""
+ value: "",
}
})
}
@@ -296,8 +296,9 @@
node.data = {
hProperties: {
...(node.data?.hProperties ?? {}),
- className: `callout ${collapse ? "is-collapsible" : ""} ${defaultState === "collapsed" ? "is-collapsed" : ""
- }`,
+ className: `callout ${collapse ? "is-collapsible" : ""} ${
+ defaultState === "collapsed" ? "is-collapsed" : ""
+ }`,
"data-callout": calloutType,
"data-callout-fold": collapse,
},
--
Gitblit v1.10.0