You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In reading mode, mozilla/readability causes the code highlighting effect and language annotation attributes to disappear, but I noticed that shiki still highlights the content. It would be better if the language could be automatically detected before highlighting.
Suggested solution
In the past, I ported guesslang, a library that detects the programming language of source code through deep learning, to run in the browser using TensorFlow.js.
I added the esm format and web worker calls to it and used it in a production environment. You can also refer to this online demo:
Yes, initially my goal was also to use the language detection module in
vscode, but this library relies on node.js, while follow needs to run in a
browser.
但为君故 ***@***.***>于2025年1月7日 周二下午7:56写道:
Clear and concise description of the problem
In reading mode,
mozilla/readability
causes the code highlighting effect and language annotation attributes to disappear, but I noticed that shiki still highlights the content. It would be better if the language could be automatically detected before highlighting.Suggested solution
In the past, I ported
guesslang
, a library that detects the programming language of source code through deep learning, to run in the browser using TensorFlow.js.I added the esm format and web worker calls to it and used it in a production environment. You can also refer to this online demo:
https://ray-d-song.github.io/guesslang-js/
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: