at the moment pfc also highlights a nickname if it is in between a word. I tried to fix that by using the following lines (instead of the old ones) (function parseMessage):
- Code: Select all
rx = new RegExp('(^|[^A-Za-z0-9])'+RegExp.escape(this.nickname)+'([^A-Za-z0-9]|$)','g');
msg = msg.replace(rx, '$1<strong>'+ this.nickname +'</strong>$2');
Instead of using a negation. We could also use something like that:
- Code: Select all
rx = new RegExp('(^|[:.,;])'+RegExp.escape(this.nickname)+'([:.,;]|$)','g');
msg = msg.replace(rx, '$1<strong>'+ this.nickname +'</strong>$2');
I have another suggestion: Most people wont write a nickname case sensitive therefox the nickname highlighting should not me case sensitive. So I suggest to change "g" to "gi".
Just a remark:
Nicknames should be - in general - (at least for latin languages) not case sensitive to be more IRC conform.
Bernhard