fix(combat): strip HTML tags + newlines before regex matching
DECAL's ChatBoxMessage delivers raw text with HTML tags and trailing \r\n that break the ^...$ regex anchors in every combat pattern. ProcessChatLine now strips tags and trims before matching, same as ChatEventRouter.NormalizeChatLine does for the WebSocket chat stream. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
38a14c5894
commit
f71ae72935
2 changed files with 6 additions and 0 deletions
|
|
@ -73,6 +73,12 @@ namespace MosswartMassacre
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
// DECAL ChatBoxMessage delivers raw text with HTML tags and
|
||||||
|
// trailing newlines. Strip them so ^...$ regex anchors work.
|
||||||
|
text = System.Text.RegularExpressions.Regex.Replace(text, "<[^>]+>", "");
|
||||||
|
text = text.TrimEnd('\r', '\n', ' ');
|
||||||
|
if (string.IsNullOrEmpty(text)) return;
|
||||||
|
|
||||||
// Skip non-combat chat (tells, channels, etc.)
|
// Skip non-combat chat (tells, channels, etc.)
|
||||||
if (IsNonCombatChat(text)) return;
|
if (IsNonCombatChat(text)) return;
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue