-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
Feat: New syntax highlight system based on shiki #1606
base: master
Are you sure you want to change the base?
Conversation
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/[email protected] |
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is a typosquat?Package name is similar to other popular packages and may not be the package you want. Use care when consuming similarly named packages and ensure that you did not intend to consume a different package. Malicious packages often publish using similar names as existing popular packages. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
@huumn Thanks for your feedback. I have removed the dependency on directly setting the HTML. I have also fixed a bug that blocked the adoption of darkMode. However, it looks like the useDarkMode hook is not triggering a re-render until the webpage is refreshed. Could you please check if my usage of the hook is incorrect? Otherwise there may be a bug preventing dark mode updates to be propagated through to the widgets. |
The missing dark mode update was fixed in #1603 |
@ekzyis Thanks for your update, I have merged last changes to the master and I confirm dark mode switch works now! I believe the code is ready for review. |
Description
I have implemented a novel code highlight widget based on Shiki, which authors claim to keep the bundle size small. Fixes #1242.
Screenshots
Light mode:
Dark mode:
Additional Context
I am undecided about which themes to adopt. The complete list is provided here.
Checklist
Are your changes backwards compatible? Please answer below: This removes any reference to react-syntax-highligher, replacing it with Shiki. However, I guess no working code depends on this.
On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below: 8, I have manually tested with different languages and with no at all on both comments and posts, checking if the preview was updated as well.
For frontend changes: Tested on mobile, light and dark mode? Please answer below: Yes.
Did you introduce any new environment variables? If so, call them out explicitly here: No.