feat: extend prettier plugin to preserve more mdx components#29819
Open
mvvmm wants to merge 10 commits intoproductionfrom
Open
feat: extend prettier plugin to preserve more mdx components#29819mvvmm wants to merge 10 commits intoproductionfrom
mvvmm wants to merge 10 commits intoproductionfrom
Conversation
Contributor
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
Contributor
Contributor
|
This PR requires additional review attention because it affects the following areas: PartialsThis PR updates partial files, which are pieces of content used across multiple files in our Render component.
|
Contributor
Author
|
/bonk please review |
Contributor
|
All validation checks pass. The PR is well-structured and implements the changes correctly: Summary of changes:
Plugin implementation - The new approach uses HTML comment placeholders to preserve element content verbatim, which correctly handles:
Validation results:
No issues found. The PR is ready for merge. |
…r all MDX components, first pass at removing prettier ignore comments
09daa6c to
a46ce8a
Compare
cdrubin
approved these changes
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Extends the custom prettier plugin from #29770. Renamed from
prettier-plugin-mdx-inlinetoprettier-plugin-cloudflare-docs.The plugin now uses a single
mdxPreserveElementsoption (replacing the previousmdxInlineElements/mdxPreserveElementssplit). Elements in this list are ignored by prettier completely — their content is output verbatim regardless of length or nesting.Expanded the protected element list to include
Tabs,TabItem,FileTree, and movedcodeandGlossaryTooltipinto it. This meanscodeandGlossaryTooltipare now protected everywhere, including when nested inside raw HTML blocks like<div>and<table>where the previous approach had no effect.Removed
prettier-ignorecomments and formatted 60+ files covering<Steps>,<Tabs>,<TabItem>,<FileTree>,<code>, and<GlossaryTooltip>— the plugin handles all of these automatically now.