Skip to content

fix(mdxish): variables in callout titles causing it to crash#1378

Merged
kevinports merged 1 commit intonextfrom
dimas/rm-15659-callouts-with-variables-in-its-title-crashing
Mar 17, 2026
Merged

fix(mdxish): variables in callout titles causing it to crash#1378
kevinports merged 1 commit intonextfrom
dimas/rm-15659-callouts-with-variables-in-its-title-crashing

Conversation

@eaglethrost
Copy link
Copy Markdown
Contributor

@eaglethrost eaglethrost commented Mar 17, 2026

PR App Fix RM-15659

🧰 Changes

Fix callout rendering crash when the callout title contains variables — both legacy <> and MDX {user.name} syntax. In a recent change in #1362, the callout transformer serializes the title paragraph back to markdown via toMarkdown() to detect block-level syntax. When the title contains readme-variable or mdxTextExpression nodes, toMarkdown() throws "Cannot handle unknown node" because it has no handlers for these custom types. It turns out we needed to explicitly pass in the handlers for them for it to not crash & serialise them properly.

🧬 QA & Testing

> 🚧 Hello <<name>>                                                                                                                                
>                                                                                                                                                   
> Test                                                                                                                                             
                                                                                                                                                     
> 🚧 Hello {user.name}                                         
>> Test
  • Verify both callouts render without console errors
  • Verify the variable resolves in the title (shows the variable value, not raw syntax)
  • Verify callout body ("Test") still renders

@eaglethrost eaglethrost marked this pull request as ready for review March 17, 2026 13:33
Copy link
Copy Markdown
Contributor

@maximilianfalco maximilianfalco left a comment

Choose a reason for hiding this comment

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

thanks for this dimas 🙏 code looks good

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

@kevinports kevinports merged commit 4006247 into next Mar 17, 2026
17 of 19 checks passed
@kevinports kevinports deleted the dimas/rm-15659-callouts-with-variables-in-its-title-crashing branch March 17, 2026 18:26
rafegoldberg pushed a commit that referenced this pull request Mar 17, 2026
## Version 13.6.1
### 🛠 Fixes & Updates

* **mdxish:** parse <Table> as single token to prevent blank-line fragmentations ([#1371](#1371)) ([ce73b7f](ce73b7f))
* **mdxish:** variables in callout titles causing it to crash ([#1378](#1378)) ([4006247](4006247)), closes [#1362](#1362)

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

This PR was released!

🚀 Changes included in v13.6.1

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