-
Anybody know of an existing utility to convert an mdxJsxFlowElement node back to its original jsx string? For example something like this hypothetical const result = toJsx({
type: 'mdxJsxFlowElement',
name: 'Demo',
attributes: [],
children: [],
position: [Object]
})
assert(result === '<Demo />') |
Beta Was this translation helpful? Give feedback.
Answered by
Lokua
Apr 28, 2022
Replies: 1 comment
-
Figured it out. Using https://github.com/syntax-tree/mdast-util-mdx import { toMarkdown } from 'mdast-util-to-markdown'
import { mdxToMarkdown } from 'mdast-util-mdx'
toMarkdown(node, {
extensions: [mdxToMarkdown()],
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Lokua
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Figured it out. Using https://github.com/syntax-tree/mdast-util-mdx