fix(mdxish): combine code tabs if separated by CLRF token \r\n#1372
Merged
eaglethrost merged 3 commits intonextfrom Mar 15, 2026
Merged
fix(mdxish): combine code tabs if separated by CLRF token \r\n#1372eaglethrost merged 3 commits intonextfrom
eaglethrost merged 3 commits intonextfrom
Conversation
kevinports
approved these changes
Mar 13, 2026
Contributor
kevinports
left a comment
There was a problem hiding this comment.
Cloned this PR and the Akamai projects from the ticket and ran locally & confirmed this fixes it.
rafegoldberg
pushed a commit
that referenced
this pull request
Mar 16, 2026
## Version 13.6.0 ### ✨ New & Improved * correctly render block level elements in callout ([#1362](#1362)) ([32040cb](32040cb)) ### 🛠 Fixes & Updates * **mdxish-editor:** built in anchor component not deserializing to to a link in mdxish editor ([#1361](#1361)) ([30e037d](30e037d)) * **mdxish:** callout end tag rendering ([#1373](#1373)) ([cad7594](cad7594)) * **mdxish:** combine code tabs if separated by CLRF token \r\n ([#1372](#1372)) ([2d8d267](2d8d267)) * **mdxish:** Curly braces on separate lines cause render failure on MDXish ([#1364](#1364)) ([d85e106](d85e106)) * **mdxished:** Preserve embed type and dimensions when copy/pasting <Embed> blocks ([#1369](#1369)) ([5af9623](5af9623)) ### 📘 Tests & Docs * **xish:** add CLAUDE.md + processor flow overview docs ([#1370](#1370)) ([b8d9e4c](b8d9e4c)) <!--SKIP CI-->
Contributor
This PR was released!🚀 Changes included in v13.6.0 |
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.

🧰 Changes
While investigating CX-3027, I found that one of the cause of the code tabs separating was because the raw document had CLRF new line tokens, so \r\n instead of only \n in between the code blocks. I verified that this resulted in separate code blocks in mdxish rendering, but seems like it's correctly tabbed in legacy from looking at the resulting mdast trees.
The adjacency check in the code-tabs transformer only accounted for LF (\n) line endings. CRLF adds an extra byte (\r) to the offset gap, causing the check to fail and rendering each code block separately. So I updated the check to also accept CRLF by allowing a gap of start.column + 1 when the blocks are still on consecutive lines (i.e., the extra byte is \r, not a blank line)/
🧬 QA & Testing
Unfortunately, it's quite hard to visually test in an actual doc because adding in the \r\n in the raw doc will render it literally, and I read that this might be a Windows os specific thing & not Mac. The best way I can think of is through the jest tests I created, which includes some regression tests.
One regression check is to ensure the code blocks behaviour should follow MDX & legacy, so testing multiple consecutive blocks, adding some space / characters between the blocks, adding more than 1 line space between, etc.