Skip to content

fix(mdxish): add missing toMarkdown extension for MDX expressions in stripComments#1347

Merged
maximilianfalco merged 5 commits intonextfrom
falco/mdxish-stripComments
Feb 18, 2026
Merged

fix(mdxish): add missing toMarkdown extension for MDX expressions in stripComments#1347
maximilianfalco merged 5 commits intonextfrom
falco/mdxish-stripComments

Conversation

@maximilianfalco
Copy link
Copy Markdown
Contributor

@maximilianfalco maximilianfalco commented Feb 18, 2026

PR App Fix RM-XYZ

🧰 Changes

Note

This fixes CX2940

The stripComments function in mdxish mode was registering fromMarkdownExtensions for MDX expressions but not toMarkdownExtensions. This meant expressions like {user.email} were parsed correctly but lost during serialization back to markdown.

This adds mdxExpressionToMarkdown() to the toMarkdownExtensions data so non-comment MDX expressions are preserved through the round-trip.

Before After
Screenshot 2026-02-18 at 14 31 02 Screenshot 2026-02-18 at 14 37 13

📷 Demo

Screen.Recording.2026-02-18.at.15.45.33.mov

🧬 QA & Testing

@maximilianfalco maximilianfalco marked this pull request as ready for review February 18, 2026 04:04
@eaglethrost
Copy link
Copy Markdown
Contributor

eaglethrost commented Feb 18, 2026

Code change looks good, slightly more tests would be good 🙏

- opted to use it.each here to reduce diff size
Copy link
Copy Markdown
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.

Lgtm

left.position &&
right.position &&
right.position.start.line - left.position.end.line === 1; // Are the blocks on adjacent lines?
left.position && right.position && right.position.start.line - left.position.end.line === 1; // Are the blocks on adjacent lines?
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

forgot to mention, this got changed due to lint

@maximilianfalco maximilianfalco merged commit 02ddfce into next Feb 18, 2026
11 checks passed
@maximilianfalco maximilianfalco deleted the falco/mdxish-stripComments branch February 18, 2026 12:27
rafegoldberg pushed a commit that referenced this pull request Feb 18, 2026
## Version 13.2.0
### ✨ New & Improved

* **demo:** add a markdown view in demo app when stripComments is on ([#1348](#1348)) ([a7a8726](a7a8726))
* extend regex to cover more cases ([#1338](#1338)) ([3e8efc8](3e8efc8))

### 🛠 Fixes & Updates

* **mdxish:** add missing toMarkdown extension for MDX expressions in stripComments ([#1347](#1347)) ([02ddfce](02ddfce))
* properly escape escaped chars when expression parsing fails ([#1325](#1325)) ([136f7af](136f7af))
* **mdxish:** tone down empty line addition preprocessing after html blocks ([#1344](#1344)) ([e4e7362](e4e7362)), closes [#1336](#1336)

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

This PR was released!

🚀 Changes included in v13.2.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