/** * Replace all new lines (mostly from
s) with , so that the MDX parser * doesn't treat them as new paragraphs and such. */ const loader = function (source: string) { // very hacky const htmlStart = source.search(//i); const frontmatter = source.slice(0, htmlStart); return frontmatter + source.slice(htmlStart).replace(/\n/g, ' '); }; export default loader;