-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: mdx-less reusable content #811
Conversation
b0ace0d
to
3baf2a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me!
expect(tree.children[2].children[0].value).toBe('After'); | ||
}); | ||
|
||
it('should parse a reusable content block that is not defined', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it('should parse a reusable content block that is not defined', () => { | |
it('should not parse a reusable content block that is not defined', () => { |
If I'm reading this test case correctly, it doesn't get parsed right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Err, I think it's still getting parsed, per se. It's just empty? Maybe it could be clearer with "should insert an empty node if the reusable content block is not defined"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah that makes more sense 👍
This PR was released!🚀 Changes included in v6.68.0 |
🧰 Changes
Adds support for Reusable Content!
This PR adds a transformer to convert
html
nodes intoreusable-content
nodes. If the so named content node has been passed in viareusableContent
, then the parsedmdsat
is inserted into place. This PR also adds a compiler for writing back out tomd
.The syntax is meant to match html/JSX so we have compatibility with future MDX.
🧬 QA & Testing