From c538c151c7462ad0395ff2c15c5e11e89e362aa8 Mon Sep 17 00:00:00 2001
From: Striven <sg.striven@cutecat.club>
Date: Sat, 04 Apr 2026 19:47:16 +0000
Subject: [PATCH] Initial commit
---
quartz/plugins/transformers/oxhugofm.ts | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/quartz/plugins/transformers/oxhugofm.ts b/quartz/plugins/transformers/oxhugofm.ts
index cdbffcf..303566e 100644
--- a/quartz/plugins/transformers/oxhugofm.ts
+++ b/quartz/plugins/transformers/oxhugofm.ts
@@ -1,4 +1,6 @@
import { QuartzTransformerPlugin } from "../types"
+import rehypeRaw from "rehype-raw"
+import { PluggableList } from "unified"
export interface Options {
/** Replace {{ relref }} with quartz wikilinks []() */
@@ -54,7 +56,7 @@
textTransform(_ctx, src) {
if (opts.wikilinks) {
src = src.toString()
- src = src.replaceAll(relrefRegex, (value, ...capture) => {
+ src = src.replaceAll(relrefRegex, (_value, ...capture) => {
const [text, link] = capture
return `[${text}](${link})`
})
@@ -62,7 +64,7 @@
if (opts.removePredefinedAnchor) {
src = src.toString()
- src = src.replaceAll(predefinedHeadingIdRegex, (value, ...capture) => {
+ src = src.replaceAll(predefinedHeadingIdRegex, (_value, ...capture) => {
const [headingText] = capture
return headingText
})
@@ -70,7 +72,7 @@
if (opts.removeHugoShortcode) {
src = src.toString()
- src = src.replaceAll(hugoShortcodeRegex, (value, ...capture) => {
+ src = src.replaceAll(hugoShortcodeRegex, (_value, ...capture) => {
const [scContent] = capture
return scContent
})
@@ -78,7 +80,7 @@
if (opts.replaceFigureWithMdImg) {
src = src.toString()
- src = src.replaceAll(figureTagRegex, (value, ...capture) => {
+ src = src.replaceAll(figureTagRegex, (_value, ...capture) => {
const [src] = capture
return ``
})
@@ -86,11 +88,11 @@
if (opts.replaceOrgLatex) {
src = src.toString()
- src = src.replaceAll(inlineLatexRegex, (value, ...capture) => {
+ src = src.replaceAll(inlineLatexRegex, (_value, ...capture) => {
const [eqn] = capture
return `$${eqn}$`
})
- src = src.replaceAll(blockLatexRegex, (value, ...capture) => {
+ src = src.replaceAll(blockLatexRegex, (_value, ...capture) => {
const [eqn] = capture
return `$$${eqn}$$`
})
@@ -102,5 +104,9 @@
}
return src
},
+ htmlPlugins() {
+ const plugins: PluggableList = [rehypeRaw]
+ return plugins
+ },
}
}
--
Gitblit v1.10.0