From 7e503c8d4f7941fab8b535d46af3ef93c1f14e3a Mon Sep 17 00:00:00 2001 From: Justin Bennett Date: Sun, 6 Oct 2024 14:07:01 -0400 Subject: [PATCH] Update decoding strategy to properly account for hex chars --- packages/astro-md/middleware.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/astro-md/middleware.ts b/packages/astro-md/middleware.ts index 58c938d..624afae 100644 --- a/packages/astro-md/middleware.ts +++ b/packages/astro-md/middleware.ts @@ -7,7 +7,7 @@ import { remarkObsidian } from "../remark-obsidian"; import remarkFrontmatter from "remark-frontmatter"; const decode = (str: string) => - str.replace(/&#x(\d+);/g, (_, hex) => String.fromCharCode(parseInt(hex, 16))); + str.replace(/&#x(\w+);/g, (_, hex) => String.fromCharCode(parseInt(hex, 16))); const theme = "nord";