Nice catch... (aka: confirmed)
However the bug is not in the
RemoveFormatCodes() function. This function acts like it should.
---
The bug is actually how the sMessage parameter is passed to the OnEvent_ChatWndReceiveMessage() event.
If [c=1]abcdef[/c] was received, it will be passed with all the tag characters being replaced by spaces:
(note that the bold tags don't matter, neither does it matter if you use a gradient or not or multiple color tags)
send: [c=1]abcdef[/c]
passed: _____abcdef____
So your variable
sMessage in
MsgPlus.RemoveFormatCodes(sMessage) will already be "_____abcdef____" (thus without any tags). And of course its output is exactly the same as there are no tags to replace to begin with.
Example code to reproduce it
code:
function OnEvent_ChatWndReceiveMessage(oChatWnd, sOrigin, sMessage, nMsgKind) {
Debug.Trace(sMessage);
}
of course, the underscores being used in this post (_) represent spaces