Daily Shaarli
July 23, 2026
Une vision pessimiste puisque la surveillance est de plus en plus possible.
Syntax Highlighting: No Extra HTML for Code Blocks via Custom Highlights API and syntaxp · Jens Oliver Meiert
A 16KB alternative to Prism and highlight.js: https://github.com/j9t/syntaxp
How It Works
- Finds all
<code>elements with aclass=language-*attribute- Tokenizes the text content using regex-based per-language tokenizers
- Creates StaticRange objects for each token
- Registers them as Highlight objects in CSS.highlights
- Styles them via
::highlight()CSS rules