rsnext/examples/cms-datocms/lib/markdownToHtml.js
Lee Robinson 01e174e5fa
Update all CMS examples dependencies. (#33580)
Updates all CMS updates to use:

- Tailwind 3 (and the corresponding `tailwind.config.js` and PostCSS changes)
- `remark@14` and `remark-html@15` (and the corresponding ESM breaking changes)
- `date-fns` minor bump

Ensured all CMS examples were:

- Using `next/image`
- Not using `as` for `next/link` (no longer needed)
2022-02-04 00:07:35 +00:00

7 lines
210 B
JavaScript

import { remark } from 'remark'
import html from 'remark-html'
export default async function markdownToHtml(markdown) {
const result = await remark().use(html).process(markdown)
return result.toString()
}