-
-
Notifications
You must be signed in to change notification settings - Fork 58
fix: shiki -> react-syntax-highlighter #136
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
Conversation
…ces Code again / customizable prism theme
@epoll31 is attempting to deploy a commit to the SyntaxUI Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I used them to avoid performing those string mutations on rerenders. They are pretty simple so I don't think that they are vital, but I thought it would be better with them. Specifically, the code one trims the extra white space and newlines. And, the language one removes "language-" from the language or returns "plaintext" when no language specified |
const lang = useMemo( | ||
() => (rawLang ? rawLang.replace('language-', '') : 'plaintext'), | ||
[rawLang], | ||
) | ||
const code = useMemo(() => rawCode.trim(), [rawCode]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are these useMemo() doing?
Description
using
react-syntax-highlighter
in Code now / ComponentPreview references Code again / customizable prism themeRelated Issue
Fixes #135
Proposed Changes
react-syntax-highlighter
instead ofcodeToHtml
insrc/components/code/Code.tsx
Code
instead ofreact-syntax-highlighter
insrc/components/code/ComponentPreview.tsx
to only referencereact-syntax-highlighter
in one placereact-syntax-highlighter
uses a theme defined insrc/components/code/theme.ts
src/styles/tailwind.css
Screenshots
Checklist
Please check the boxes that apply:
npm run build
and build is successful