From 67f3614f3d58d8c27e9dbf6ad2201493b1a627ca Mon Sep 17 00:00:00 2001
From: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 13 May 2024 02:05:27 +0000
Subject: [PATCH] chore(deps-dev): bump tsx from 4.7.1 to 4.9.3 (#1120)

---
 quartz/plugins/transformers/ofm.ts |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts
index 3ee6480..108f7f7 100644
--- a/quartz/plugins/transformers/ofm.ts
+++ b/quartz/plugins/transformers/ofm.ts
@@ -188,7 +188,8 @@
             const [raw]: (string | undefined)[] = capture
             let escaped = raw ?? ""
             escaped = escaped.replace("#", "\\#")
-            escaped = escaped.replace("|", "\\|")
+            // escape pipe characters if they are not already escaped
+            escaped = escaped.replace(/((^|[^\\])(\\\\)*)\|/g, "$1\\|")
 
             return escaped
           })

--
Gitblit v1.10.0