I want some kind of input field in html like textarea, or a div which is editable to highlight special words like Hi or foo. I know that there are some syntax highlighting script out there - Prettify, Syntax Highlighter, highlight.js, etc. However would have to adapt them pretty heavily, because "HI" isn't a token in a programming language. I don't know how to do this / code one by myself.
(I've thought of some kind of string.split by chars and then adding those chars together until I have "HI" for example, but I don't know how to color those words then. span with color? But how would I remove that span if the word is deleted?)
Do you have advice?
Thanks in advance