Skip to content
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

✨ add react-remark library, test it in SimpleMarkdownText #2875

Merged
merged 3 commits into from
Nov 7, 2023

Conversation

danyx23
Copy link
Contributor

@danyx23 danyx23 commented Oct 30, 2023

This PR adds the react-remark library. This seems to be the best library for parsing markdown given the following requirements:

  • We want parsing to be separate from rendering, with the ability to modify the AST in between
  • We'd like extensions to be straightforward and ideally a nice ecosystem of plugins for things like mathematical formulas, tables etc
  • We'd like to avoid dangerouslySetInnerHTML in React

This PR then replaces the rendering path of the SimpleMarkdownText component with the new parser.

Bundle size increases by about 40KB minified + gzipped but I think this is an ok trade-off

@danyx23 danyx23 force-pushed the markdown-add-react-remark branch from 4dc9fe3 to 6c06232 Compare November 7, 2023 14:36
Copy link
Contributor Author

danyx23 commented Nov 7, 2023

Merge activity

  • Nov 7, 3:55 PM: @danyx23 started a stack merge that includes this pull request via Graphite.
  • Nov 7, 3:56 PM: Graphite couldn't merge this PR because it had conflicts with the trunk branch.
  • Nov 7, 4:03 PM: @danyx23 started a stack merge that includes this pull request via Graphite.
  • Nov 7, 4:03 PM: @danyx23 merged this pull request with Graphite.

@danyx23 danyx23 force-pushed the markdown-add-react-remark branch from 6c06232 to f239a48 Compare November 7, 2023 21:02
@danyx23 danyx23 merged commit 9a6a9e4 into master Nov 7, 2023
12 checks passed
@danyx23 danyx23 deleted the markdown-add-react-remark branch November 7, 2023 21:03
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