wip: added html handler in markdown
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { unified } from 'unified';
|
||||
import remarkGfm from 'remark-gfm';
|
||||
import remarkParse from 'remark-parse';
|
||||
import remarkRehype from 'remark-rehype';
|
||||
import remarkRehype, { Options as RemarkRehypeOptions } from 'remark-rehype';
|
||||
import rehypeSanitize from 'rehype-sanitize';
|
||||
import rehypeHighlight, { Options as RehypeHighlightOptions } from 'rehype-highlight';
|
||||
import rehypeReact, { Options as RehypeReactOptions } from 'rehype-react';
|
||||
@@ -9,13 +9,15 @@ import { all } from 'lowlight';
|
||||
import { Fragment, jsx, jsxs } from 'react/jsx-runtime';
|
||||
import { MarkPostString } from '@/components/dummyPost';
|
||||
import { raleway, roboto, nunito } from "@/app/fonts";
|
||||
import rehypeRaw from "rehype-raw";
|
||||
|
||||
export default async function Mark() {
|
||||
let content = await MarkPostString();
|
||||
let result = await unified()
|
||||
.use(remarkParse)
|
||||
.use(remarkGfm)
|
||||
.use(remarkRehype)
|
||||
.use(remarkRehype, { allowDangerousHtml: true } as RemarkRehypeOptions)
|
||||
.use(rehypeRaw)
|
||||
.use(rehypeSanitize)
|
||||
.use(rehypeHighlight, {
|
||||
languages: all,
|
||||
|
||||
Reference in New Issue
Block a user