Skip to content
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

Merged
merged 7 commits into from
Aug 28, 2023
Merged

feat: mdx-less reusable content #811

merged 7 commits into from
Aug 28, 2023

Conversation

kellyjosephprice
Copy link
Collaborator

@kellyjosephprice kellyjosephprice commented Aug 23, 2023

PR App Fix RM-7878

🧰 Changes

Adds support for Reusable Content!

This PR adds a transformer to convert html nodes into reusable-content nodes. If the so named content node has been passed in via reusableContent, then the parsed mdsat is inserted into place. This PR also adds a compiler for writing back out to md.

The syntax is meant to match html/JSX so we have compatibility with future MDX.

🧬 QA & Testing

@kellyjosephprice kellyjosephprice changed the title Feat/mdx less rc feat: mdx-less reusable content Aug 23, 2023
@kellyjosephprice kellyjosephprice mentioned this pull request Aug 23, 2023
@kellyjosephprice kellyjosephprice requested review from rafegoldberg and a team August 23, 2023 22:17
@kellyjosephprice kellyjosephprice marked this pull request as ready for review August 23, 2023 22:17
Copy link
Contributor

@kevinports kevinports left a 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', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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?

Copy link
Collaborator Author

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"

Copy link
Contributor

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 👍

@kellyjosephprice kellyjosephprice merged commit cdebefd into next Aug 28, 2023
7 checks passed
@kellyjosephprice kellyjosephprice deleted the feat/mdx-less-rc branch August 28, 2023 17:54
rafegoldberg pushed a commit that referenced this pull request Aug 28, 2023
## Version 6.68.0

### ✨ New & Improved

* mdx-less reusable content ([#811](#811)) ([cdebefd](cdebefd))

<!--SKIP CI-->
@rafegoldberg
Copy link
Contributor

This PR was released!

🚀 Changes included in v6.68.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants