Replace the first top-level heading in a markdown document
import remark from 'remark';
import firstHeading from 'remark-first-heading';
const r = remark().use(firstHeading, { heading: 'Correct Heading' });
const someMarkdown = '# wrong heading';
r.processSync(someMarkdown).toString();
//=> "# Correct Heading\n"
MIT © Sigurd Fosseng