Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Similar to #27 but with updated function names based on PR comments. In Parcel, we're looking to implement native support for MDX in Rust, and we'd like to avoid re-parsing since we already use SWC. See parcel-bundler/parcel#10064
Second commit may be more controversial. Basically I need a way to embed JSX expressions into Hast element nodes. In Parcel, we want to collect dependencies in MDX, e.g. image references and links. To do this, we need to transform<img src="foo.png" />
into<img src={new URL('foo.png', import.meta.url).toString()} />
. TheURL
constructor creates a dependency in later stages.I tried converting theNode::Element
into aNode::MdxJsxElement
in order to do this, but this gets treated as an "explicit" JSX element and no longer uses the injected_components.img
. Simplest way to implement this was to add a JSX expression variant toPropertyValue
but I could change it if there's a better way.