Closed qiudaozhang closed 6 years ago
Hey,
I have a simplified clone of PrismJs for Java: prism4j. It's not sophisticated and doesn't have theming built-in, but it will allow you to tokenize a supported syntax and apply styling to your needs. I use it in my Markwon library (syntax-highlight
module) to provide syntax highlighting to Android applications.
PrismJs is RegEx based so do not expect something too precise, but it does help with general highlighting. If you have any questions you can create an issue in the repository and I will try to answer it.
@qiudaozhang I'm not exactly sure what you want. But if it's syntax highlighting, see @noties pointers.
commonmark-java provides the functionality to provide custom rendering of code blocks, so you'd want to use that together with a syntax highlighting library.
Providing syntax highlighting in commonmark-java itself is not in the scope of this project.
thanks , i use js have resolve it.
Hi @qiudaozhang how did you fixed with js? Client side on browser?
You may have a look for highlight.js or some java libs
Steps to reproduce the problem (provide example input): render the code like java
Expected behavior: hightlights
Actual behavior: no hightlights