-
Notifications
You must be signed in to change notification settings - Fork 23
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
Enforcing client side shiki syntax highlight #135
Comments
I think this is a valid concern, and I think it would be nice to have an option to toggle this behavior. We could provide a few different modes, like ( |
Having different modes seems a good idea. @pedraal You did not miss anything, module does not have option to configure this behavior. Feel free to drop a PR. |
@farnabaz I'm really unfamiliar with nuxt modules development but I'll give it a try ! |
@farnabaz I'm not able to run the playground, neither on my computer (MBA M1), neither in the codesandbox provided in the repo readme. Any guidance about this ? |
@pedraal CodeSandbox has an issue (I just replaced it with working StackBlitz playground). But local develpment should be ok, what error did you get on local? |
I'm building a chat app (using LLMs API, how original is that 🙃) where some markdown content is streamed to the client. My implementation makes my
Message
component call theparseMarkdown
whenever thecontent
prop gets updated (every few ms depending on the response stream "speed"). By using theparseMarkdown
helper as it is, it triggers calls the to/api/_mdc/highlight
endpoint on each update which is not what I would want in a production environment.By looking at the code, I found that if this API call catches an error it would set a
mdc-shiki-highlighter
item in thesessionStorage
to switch to a client side shiki syntax highlighting. This is exactly what I would want to be my default behaviour. At the moment, I'm manually setting thesessionStorage
item when my app mounts which actually seems to do the job.Did I missed something in the configs that would make the module set this by default ? If not, I'd be happy to submit a PR to add this, I'm just wondering if it's something someone would like to see in this module.
PS: I'm a newbie to open source issue reporting / contributing, any guidance will be highly appreciated !
The text was updated successfully, but these errors were encountered: