fix(mdxish): fix FA Emojis in Callouts#1421
Conversation
…o/fix-fa-emoji-in-callout
| * @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') { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
…o/fix-fa-emoji-in-callout
…o/fix-fa-emoji-in-callout
There was a problem hiding this comment.
lint changes only for this file
## 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-->
This PR was released!🚀 Changes included in v13.8.5 |

🎯 What does this PR do?
:fa-rss-square:) being silently dropped inside blockquote callout headers in the MDXish pipeline. ThetoMarkdownExtensionsin the callout transformer was missing a handler forNodeTypes.i, so FA nodes were lost during thetoMarkdown()→ re-parse roundtrip.>.extractTextonly recognizedtextandhtmlnode types as content, so emoji-only blockquotes were treated as empty and deleted.🧪 QA tips
> 📘 :fa-rss-square: Titlerenders the FA icon in the callout header (MDXish)> 📘 Title\n>\n> Body :fa-rss-square:renders the FA icon in the callout body> :fa-rss-square: :grin:preserves both emojis in a regular blockquote (not collapsed to>)Use this source code to test
📸 Screenshot or Loom
one more before picture
