Open ChenglimEar opened 8 years ago
The "words" parameter is a list of regexes, which is perhaps a bit unclear. You should be able to escape values you pass in as regexes. I could perhaps add an argument that takes non-regex words, although I'd have to research how to do this in a generalized way.
I did notice that there were rendering issues when a pipe or a > was in the middle of a word, which are now fixed. You can see the changes/new examples here:
If you set the word to highlight to something like '|a', it doesn't work (that's a vertical bar and not a letter).
I've investigated this problem and found two places where it was problematic:
1) I had to use the regular expression for the word such that "|a" became "[|]a". This works such that the initial part of the plugin code matches "|a" in the text area.
2) The second part of the plugin code that actually searches for the match, "|a", to highlight fails because the "|" interferes with the regex being constructed in this line of code:
Can you fix this? Inserting this line before the above line seems to fix it for me:
Thanks.