Skip to content

draft: Rendering HAST #1921

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

draft: Rendering HAST #1921

wants to merge 2 commits into from

Conversation

AVGVSTVS96
Copy link
Collaborator

No description provided.

- add `hast-to-jsx-runtime`
- update `MarkdownText` with HAST flow
- update `markdown-text` to accept HAST
- export `type Root` from HAST in `packages/react-markdown`
Copy link

cubic-dev-ai bot commented May 8, 2025

Your mrge subscription is currently inactive. Please reactivate your subscription to receive AI reviews and use mrge.

Copy link

changeset-bot bot commented May 8, 2025

⚠️ No Changeset found

Latest commit: 859272c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

trag-bot bot commented May 9, 2025

Pull request summary

  • Replaced MarkdownTextPrimitive with MarkdownTextPrimitiveServer to support server-side rendering of Markdown content.
  • Introduced a new HastRenderer component to convert HAST (Hypertext Abstract Syntax Tree) to JSX for rendering.
  • Updated the MarkdownTextImpl component to accept an optional hast prop for rendering processed Markdown.
  • Removed the remark-gfm plugin import, indicating a shift away from using GitHub Flavored Markdown.
  • Added a new dependency, hast-util-to-jsx-runtime, to facilitate the conversion of HAST to JSX.
  • Modified the MarkdownTextPrimitiveProps interface to include an optional hast property.
  • Created a new server-side implementation of the MarkdownTextPrimitive to handle HAST rendering.
  • Updated the package.json to include the new dependency and ensure compatibility with existing packages.
  • Adjusted the export statements in the index.ts file to include the new server component and types.
  • Cleaned up the code by commenting out unused imports and ensuring consistent formatting.

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.

1 participant