Skip to content

Commit

Permalink
Update decoding strategy to properly account for hex chars
Browse files Browse the repository at this point in the history
  • Loading branch information
zephraph committed Oct 6, 2024
1 parent 669ca54 commit 7e503c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/astro-md/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down

0 comments on commit 7e503c8

Please sign in to comment.