Post
Why, you might ask? highlight.js is a genuinely great project, but it suffers from one great weakness: regular expressions. This comes with 2 main downsides: RegEx is often vulnerable to denial-of-service, and it has no semantic understanding of the code.
0 reposts9 likes
Shout-out to the tree-sitter contributors and the hundreds of independent grammar authors for creating such a strong ecosystem, and shout-out @fasterthanli.me for building Arborium (the basis for our new syntax highlighter).
If you want to check out the source code, it's available at github.com/discord/arbo.... Your favorite language may not be supported, but please feel free to submit a patch with new grammars: they need only be permissively licensed.
github.comGitHub - discord/arborium-rt: tree-sitter syntax highlighting for the browser and Electrontree-sitter syntax highlighting for the browser and Electron - discord/arborium-rt