Hello i need to colorize some text in the contentEditable div. Let's say i need to highlight +
with blue color. On keyup event i do following $textarea.html($textarea.html().replace((/-/))/g,"<span class='blue'>$1</span>")
The obvious problem that replace fires up on the same part of stirng more than once (because i have keyup event). I can use only that type of event keyup event. How to do this? Thanks
UPD*
Maybe im not clear describe my problem. Im typing '-' and then continute type - asdasdad
. The problem is keyup event fires after each letter (this is a must), so i get too much spans, because '-' is always in string.