Skip to content

Conversation

@eaglethrost
Copy link
Contributor

@eaglethrost eaglethrost commented Dec 11, 2025

PR App Fix RM-XYZ

🧰 Changes

There were 2 bugs regarding [block:embed] magic blocks in mdxish:

Fixes:

  • When parsing embed magic blocks & setting the children, don't send in null as fallback, because it can create a type error later on. Use an empty string instead
  • Create an embed handler to map the embed node magic blocks to the Embed component defined in markdown

Demo of it working now:

Screen.Recording.2026-01-06.at.4.33.35.pm.mov

🧬 QA & Testing

  1. In the readme site, create a project document with an embed item (e.g YouTube)
  2. Turn on mdxish for the project in god mode
  3. View the doc with embed content, it shouldn't crash and render the same as MDX

Example embed:

[block:embed]
{
  "url": "https://www.youtube.com/watch?v=FVikHLyW500&list=RD3-9V38W00CM&index=4",
  "provider": "youtube.com",
  "href": "https://www.youtube.com/watch?v=FVikHLyW500&list=RD3-9V38W00CM&index=4",
  "typeOfEmbed": "youtube"
}
[/block]

@eaglethrost eaglethrost marked this pull request as ready for review December 11, 2025 11:24
});

it('should convert html content inside table cells as nodes in the ast', () => {
const md = `
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some minor input formatting changes

{
children: [
{ children: [{ type: 'text', value: title || null }], title: embedJson.provider, type: 'link', url },
{ children: [{ type: 'text', value: title || '' }], title: embedJson.provider, type: 'link', url },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problematic code, accessing on null's

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants