Skip to content

feat: extend regex to cover more cases#1338

Merged
maximilianfalco merged 1 commit intonextfrom
falco/extend-normalize-emphasis-transformer
Feb 18, 2026
Merged

feat: extend regex to cover more cases#1338
maximilianfalco merged 1 commit intonextfrom
falco/extend-normalize-emphasis-transformer

Conversation

@maximilianfalco
Copy link
Copy Markdown
Contributor

@maximilianfalco maximilianfalco commented Feb 13, 2026

PR App Fix RM-XYZ

🧰 Changes

This fixes CX2834 (mentioned here to not trigger Linear bot).

Essentially our regex to normalize malformed emphasis syntaxes were not equipped well enough to handle having the _ and __ WITHIN the text element itself. ie things like this were failing since it though the middle _ was the end

_hello_world _
Before After
Screenshot 2026-02-13 at 15 36 38 Screenshot 2026-02-13 at 15 36 22

Note

this actually improves on the original legacy capabilities by allowing us to parse the __ bold syntax as well

Important

we do not extend to also be the same for the * syntax simply because the legacy engine didnt support that as well. goal of these malformed transformations was for parity with legacy

🧬 QA & Testing

Stuff like

_hello_world _

or even

__hello__world __

should be considered one node and not split into two

@eaglethrost
Copy link
Copy Markdown
Contributor

Code change makes sense! Confirming, I noticed in the example you gave __hello__world __ the behaviour is different from legacy, is this fine? Though compared to the previous version its rendering is definitely better.

Screen.Recording.2026-02-16.at.8.14.29.pm.mov

@maximilianfalco
Copy link
Copy Markdown
Contributor Author

Code change makes sense! Confirming, I noticed in the example you gave __hello__world __ the behaviour is different from legacy, is this fine? Though compared to the previous version its rendering is definitely better.

@eaglethrost yea mentioned this in the PR desc, this should be an improvement compared to the legacy one

@maximilianfalco maximilianfalco merged commit 3e8efc8 into next Feb 18, 2026
20 of 23 checks passed
@maximilianfalco maximilianfalco deleted the falco/extend-normalize-emphasis-transformer branch February 18, 2026 12:28
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