Skip to content

Instantly share code, notes, and snippets.

@juristr
Created June 21, 2021 07:24
Next + Nx series
//libs/markdown/src/lib/markdownToHtml.ts
import remark from 'remark';
import html from 'remark-html';
export async function markdownToHtml(markdown) {
const result = await remark().use(html).process(markdown);
return result.toString();
}
@victorpavlov
Copy link

In this file you have small mistake which will cause static props rendering to be failed. remark should be imported like an instance from property import { remark } from 'remark' to make call as a function available, or you can use remark.remark() in line #6 which will also works but not so elegant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment