mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-19 03:54:28 +08:00
863f61d908
Co-authored-by: afc163 <afc163@gmail.com>
16 lines
426 B
TypeScript
16 lines
426 B
TypeScript
import rehypeFigure from '@microflash/rehype-figure';
|
|
import rehypeStringify from 'rehype-stringify';
|
|
import { remark } from 'remark';
|
|
import remarkGfm from 'remark-gfm';
|
|
import remarkRehype from 'remark-rehype';
|
|
|
|
export default function markdown2Html(content: string) {
|
|
return remark()
|
|
.use(remarkGfm)
|
|
.use(remarkRehype)
|
|
.use(rehypeFigure)
|
|
.use(rehypeStringify)
|
|
.processSync(content)
|
|
.toString();
|
|
}
|