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:
Erik 2026-04-12 09:48:11 +02:00
parent 38a14c5894
commit f71ae72935
2 changed files with 6 additions and 0 deletions

View file

@ -73,6 +73,12 @@ namespace MosswartMassacre
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.)
if (IsNonCombatChat(text)) return;