From 714807c0e731d50e70d8717b97d96fb8340559db Mon Sep 17 00:00:00 2001 From: Kelly Joseph Price Date: Wed, 12 Feb 2025 13:13:16 -0800 Subject: [PATCH] fix: migrate --- lib/migrate.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/migrate.ts b/lib/migrate.ts index c8525b394..69d53c303 100644 --- a/lib/migrate.ts +++ b/lib/migrate.ts @@ -2,7 +2,14 @@ import mdastV6 from './mdastV6'; import mdx from './mdx'; const migrate = (doc: string, { rdmd }): string => { - return mdx(mdastV6(doc, { rdmd })).replaceAll(/ /g, ' '); + return ( + mdx(mdastV6(doc, { rdmd })) + .replaceAll(/ /g, ' ') + // @note: I'm not sure what's happening, but I think mdx is converting an + // 'a' to 'a' as a means of escaping it. I think this helps with + // parsing weird cases. + .replaceAll(/a/g, 'a') + ); }; export default migrate;