Skip to content

Commit

Permalink
fix: migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyjosephprice committed Feb 12, 2025
1 parent f2ee891 commit 714807c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 714807c

Please sign in to comment.