I have a div element with contenteditable set to true, and I want to detect whether a certain string exists within the element, and if so, style it, giving the appearance of syntax highlighting (I've already looked at existing libraries/scripts, and none of them work the way I need them to).
What would be the best solution to this, while preserving compatibility with HTML5/CSS3 compliant browsers?