Skip to content

Commit f88fbc5

Browse files
Merge pull request #36 from iicdii/feature/support-mdx-table
Add remark-gfm plugin to mdx option to support table in markdown
2 parents 6fef2f5 + 6ef0aec commit f88fbc5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/utils/documents.server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ export async function fetchRepoFile(
5656
}
5757

5858
export async function markdownToMdx(content: string) {
59-
const { default: rehypeSlug } =
59+
const [{ default: rehypeSlug }, { default: remarkGfm }] =
6060
// @ts-ignore
61-
await import('rehype-slug')
61+
await Promise.all([import('rehype-slug'), import('remark-gfm')])
6262

6363
const mdx = await bundleMDX<{ title: string }>({
6464
source: content,
6565
mdxOptions: (options) => {
66-
// options.remarkPlugins = [...(options.remarkPlugins ?? []), rehypeSlug]
66+
options.remarkPlugins = [...(options.remarkPlugins ?? []), remarkGfm]
6767
options.rehypePlugins = [...(options.rehypePlugins ?? []), rehypeSlug]
6868
return options
6969
},

0 commit comments

Comments
 (0)