-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
19,761 additions
and
19,572 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
import { remark } from "remark"; | ||
import html from "remark-html"; | ||
import { serialize } from "next-mdx-remote/serialize"; | ||
import remarkGfm from "remark-gfm"; | ||
|
||
export default async function markdownToHtml(markdown: any): Promise<string> { | ||
const result = await remark().use(html).process(markdown); | ||
return result.toString(); | ||
export default async function markdownToHtml<T>(markdown: any) { | ||
const mdxSource = await serialize<Record<string, unknown>, T>(markdown, { | ||
parseFrontmatter: true, | ||
mdxOptions: { | ||
remarkPlugins: [remarkGfm], | ||
}, | ||
}); | ||
|
||
return mdxSource; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
07ab74a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
genshin-builds – ./
genshin-builds-two.vercel.app
genshin-builds-git-master-dvaji94.vercel.app
genshin-builds.com
genshin-builds-dvaji94.vercel.app