@cheeaun @bramus I was thinking of hacking something for textarea based on https://github.com/kueblc/LDT
(which overlays a transparent <textarea> on top of a styled <pre>)
Not sure the highlight API has been thought out for dynamic content... I don't know if you can change the bounds of a range after it's been registered and have the output updated... We'll see 🙂
@pygy @cheeaun Perfectly possible.
Here's a demo that does on-the-fly highlighting: https://www.bram.us/2024/02/18/custom-highlight-api-for-syntax-highlighting/#highlighting-contenteditable