Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table styles seem broken #6

Open
feliche93 opened this issue May 12, 2023 · 2 comments
Open

Table styles seem broken #6

feliche93 opened this issue May 12, 2023 · 2 comments

Comments

@feliche93
Copy link

In this sample post the table style layouts do not seem to be working: https://next-contentlayer.vercel.app/posts/dynamic-routing-static-regeneration

CleanShot 2023-05-12 at 17 12 53@2x
@mohammedyh
Copy link

I had a similar problem, I'm not sure what Markdown implementation Contentlayer uses, but I imagine tables aren't supported. I resolved the issue by installing the remark-gfm package and adding it to the contentlayer.config.js file. After that, the tables rendered correctly for me. Code snippet below for reference:

import remarkGfm from 'remark-gfm'

...

export default makeSource({
  contentDirPath: 'posts',
  documentTypes: [Post],
  mdx: {
    remarkPlugins: [remarkGfm],
  },
})

Table rendering correctly after installing remark plugin

@TheKonka
Copy link

TheKonka commented Jul 5, 2023

@mohammedyh Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@TheKonka @feliche93 @mohammedyh and others