Skip to content
Discussion options

You must be logged in to vote

I write a small remark plugin to support jsx table in .mdx like html table in .md.

export const remarkJsxTable: Plugin<[], Root> = () => (ast) => {
  visit(ast, 'mdxJsxFlowElement', (node) => {
    if (
      node.name &&
      ['table', 'thead', 'tbody', 'tfoot', 'tr', 'th', 'td'].includes(
        node.name,
      ) &&
      node.data?._mdxExplicitJsx
    ) {
      delete node.data._mdxExplicitJsx
    }
  })
}

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

JounQin
Jan 10, 2025
Collaborator Author

You must be logged in to vote
0 replies
Comment options

JounQin
Jan 10, 2025
Collaborator Author

You must be logged in to vote
0 replies
Comment options

JounQin
Jan 10, 2025
Collaborator Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

JounQin
Jan 10, 2025
Collaborator Author

You must be logged in to vote
0 replies
Answer selected by JounQin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants