3 ms·
In theory, dynamic syntax highlighting done via Javascript lets you customize it on-the-fly, for example by choosing a syntax highlighting method that suits you
by b0rsuk 7y ago
In theory, dynamic syntax highlighting done via Javascript lets you customize it on-the-fly, for example by choosing a syntax highlighting method that suits you. In practice, I've never seen a website with syntax highlighting that does it. So we're getting the worst of both worlds: no ability to tweak and syntax highlighting for the same page repeated millions of times. I find it especially ironic that Rust programming books use Javascript syntax highlighting. Doesn't Rust pride itself with cutting the runtime operations to absolute minimum?
The one and only place where I want dynamic syntax highlighting is on "pages" where content might change, such as in-browser code interpreters. This kind of thing can't be done with static syntax highlighting:
https://play.rust-lang.org/ https://play.rust-lang.org/