Open skiniks opened 2 weeks ago
I guess @antfu Shiki would be a good fit ?
I guess @/antfu Shiki would be a good fit ?
Some mention of it already here and later in the thread: https://bsky.app/profile/ryanskinner.com/post/3l7teiwotse2q
Let me know if you need any help on adopting to Shiki :)
@antfu I did some digging, and it looks like the incompatibility with React Native is due to the use of RegExp's d
flag to access match.indices
for capture group position tracking, which isn't currently supported by Hermes. this appears to be the only incompatibility i could find with @shikijs/engine-javascript
.
would love to hear your thoughts on potential solutions—perhaps adding a fallback/simulation mechanism for environments without d
flag support?
Uhm, I see. The d
flag is a fundamental requirement for it to work, I don't think it would be easily polyfillable. On the other hand, does React Native support WASM? Or maybe C binary? We could use that to create a custom engine for Shiki with thr native binding if possible.
unfortunately no WASM support natively in React Native. C binary is definitely possible and I believe that would allow for the use of Oniguruma directly
Describe the Feature
Earlier today, @patak-dev made a post highlighting the importance of syntax highlighting, especially for developers sharing accessible code snippets rather than images. This feature would not only improve accessibility but would continue to foster a developer-friendly environment, promoting more experimentation with the protocol.
Here’s the original post:
@gaearon also expressed support for the idea, stating:
I am happy to contribute time to help work on this feature once a direction has been chosen.
Attachments
Here's the attachment from @patak-dev's post as an example:
Describe Alternatives
No response
Additional Context
No response