mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
13 lines
350 B
TypeScript
13 lines
350 B
TypeScript
|
import remark from 'remark'
|
||
|
import remarkHtml from 'remark-html'
|
||
|
import remarkGfm from 'remark-gfm'
|
||
|
|
||
|
export function markdownToHtml(markdown: string): string {
|
||
|
const result = remark()
|
||
|
.use(remarkGfm)
|
||
|
.use(remarkHtml) // serializes through remark-rehype and rehype-stringify
|
||
|
.processSync(markdown).contents
|
||
|
|
||
|
return result.toString()
|
||
|
}
|