Skip to content

fix(mdxish): fix FA Emojis in Callouts#1421

Merged
maximilianfalco merged 7 commits intonextfrom
falco/fix-fa-emoji-in-callout
Apr 14, 2026
Merged

fix(mdxish): fix FA Emojis in Callouts#1421
maximilianfalco merged 7 commits intonextfrom
falco/fix-fa-emoji-in-callout

Conversation

@maximilianfalco
Copy link
Copy Markdown
Contributor

@maximilianfalco maximilianfalco commented Apr 3, 2026

🎫 Resolve CX-3153

🎯 What does this PR do?

  • Fix font-awesome emoji shortcodes (e.g. :fa-rss-square:) being silently dropped inside blockquote callout headers in the MDXish pipeline. The toMarkdownExtensions in the callout transformer was missing a handler for NodeTypes.i, so FA nodes were lost during the toMarkdown() → re-parse roundtrip.
  • Fix regular blockquotes containing only emoji nodes (FA or gemoji) being replaced with a literal >. extractText only recognized text and html node types as content, so emoji-only blockquotes were treated as empty and deleted.

🧪 QA tips

  • Verify > 📘 :fa-rss-square: Title renders the FA icon in the callout header (MDXish)
  • Verify > 📘 Title\n>\n> Body :fa-rss-square: renders the FA icon in the callout body
  • Verify > :fa-rss-square: :grin: preserves both emojis in a regular blockquote (not collapsed to >)
  • Verify RMDX and RDMD pipelines are unaffected

Use this source code to test

> :fa-rss-square: :grin: hello

> :fa-rss-square: :grin:

# :fa-rss-square: :grin:

__asd :fa-rss-square: :grin: asd__

*asd :fa-rss-square: :grin: asd*

~sdfs :fa-rss-square: :grin: sdf~

`:fa-rss-square: :grin:`

> 📘 :grin: :fa-rss-square:
>
> Hello :fa-rss-square:

📸 Screenshot or Loom

Before After
Screenshot 2026-04-04 at 00 35 11 Screenshot 2026-04-04 at 00 34 16

one more before picture
Screenshot 2026-04-04 at 00 35 35

@maximilianfalco maximilianfalco marked this pull request as ready for review April 3, 2026 13:36
@maximilianfalco maximilianfalco requested review from Jadenzzz, eaglethrost, kevinports and rafegoldberg and removed request for rafegoldberg April 3, 2026 13:36
* @returns The concatenated text content
*/
export const extractText = (node: { alt?: unknown; children?: unknown[]; type?: string; value?: unknown }): string => {
if ((node.type === 'text' || node.type === 'html') && typeof node.value === 'string') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are you broadening this? It seems safe when I think about it but just want to make sure we aren't regressing the behavior that led to the (node.type === 'text' || node.type === 'html') check being added.

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.

in the very beginning this function only checked for text and string in #1260 but then expanded again in #1371 to also take in html and now gemoji (and most likely inlineCode and code sometime in the future. this will probably keep going as we want to keep allowing parsing new stuff so I just opted to broaden it and just let it parse anything that has node.value

that said tho if you feel like still maintaining a strict allowed types is the correct way, im more than happy to create an explicit list

Comment thread lib/mdxish.ts
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.

lint changes only for this file

@maximilianfalco maximilianfalco merged commit f7caa3e into next Apr 14, 2026
7 checks passed
@maximilianfalco maximilianfalco deleted the falco/fix-fa-emoji-in-callout branch April 14, 2026 01:27
rafegoldberg pushed a commit that referenced this pull request Apr 14, 2026
## Version 13.8.5
### 🛠 Fixes & Updates

* actually fix toc links with query params ([#1436](#1436)) ([b59ce5f](b59ce5f))
* **mdxish:** fix FA Emojis in Callouts ([#1421](#1421)) ([f7caa3e](f7caa3e))
* **mdxish:** preserve blank lines in JSX table parsing to fix roundtrip corruption ([#1430](#1430)) ([9fa040c](9fa040c)), closes [#1371](#1371)
* proper spacing in empty callouts ([#1433](#1433)) ([97b8a41](97b8a41))
* scope link color inheritance to headings ([#1432](#1432)) ([cd78a62](cd78a62))

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

This PR was released!

🚀 Changes included in v13.8.5

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.

3 participants