mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-21 13:18:04 +08:00
18 lines
568 B
TypeScript
18 lines
568 B
TypeScript
|
/* eslint-disable compat/compat */
|
||
|
/* eslint-disable no-console, no-await-in-loop, import/no-extraneous-dependencies, no-restricted-syntax */
|
||
|
import { remark } from 'remark';
|
||
|
import remarkGfm from 'remark-gfm';
|
||
|
import remarkRehype from 'remark-rehype';
|
||
|
import rehypeStringify from 'rehype-stringify';
|
||
|
import rehypeFigure from '@microflash/rehype-figure';
|
||
|
|
||
|
export default function markdown2Html(content: string) {
|
||
|
return remark()
|
||
|
.use(remarkGfm)
|
||
|
.use(remarkRehype)
|
||
|
.use(rehypeFigure)
|
||
|
.use(rehypeStringify)
|
||
|
.processSync(content)
|
||
|
.toString();
|
||
|
}
|