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;