Closed iczero closed 8 months ago
Hi! It seems some of the things asked in the template are missing? Please edit your post to fill out everything.
You won’t get any more notifications from me, but I’ll keep on updating this comment, and remove it when done!
Thanks, — bb
Hi, @iczero .
You'd better to create a related issue first actually.
The current approach does not work. Will try another one.
See https://github.com/micromark/micromark-extension-mdx-jsx/issues/12#issuecomment-1875713767 for commentary on approach and ideas on how to (and not to) proceed.
The approach in this PR is fundamentally incorrect. (Un)fortunately, I have not run out of ideas yet.
Hi! This was closed. Team: If this was merged, please describe when this is likely to be released. Otherwise, please add one of the no/*
labels.
Initial checklist
Description of changes
This is a proof of concept to reintroduce CommonMark-style HTML blocks to MDX. I would like to request comments on these changes.
Currently, MDX parses
as
The content within the tags is parsed as a paragraph, but this is often not wanted. CommonMark specifies this behavior to only occur if there is a blank line after the tag, as such:
but this is needlessly restrictive when you want markdown syntax within flow elements.
This change introduces a configuration option to parse content within flow elements as inline markdown. Paragraph wrapping can be restored by adding a blank line, as in CommonMark.
Examples:
Test
Configuration is done by setting
preferInline
(bad name, please advise) when creating the extension:mdxJsx({ acorn, acornOptions, addResult: true, preferInline: true })
.I am currently writing tests for this feature and will update the PR when I have good coverage.
I intend to maintain this patch set into the future because I am currently working on a project which wants this feature. I am opening this PR for the primary purpose of gathering feedback. If this feature is not wanted, please close this PR.
Finally, I would like to offer my sincere gratitude for the authors of
micromark
and related packages. Markdown truly is horrible to parse, andmicromark
makes everything so much easier.Things that need fixing
This does not work because expressions are not handled:fixed hopefullyThis does not work: