Move styles array outside the parse loop in ansiToHtml so styles accumulate across sequences, and use stripAnsi when filtering live logs so search matches visible text.
Merge color and style maps into a unified STYLES table, hoist the
regex to module scope, export stripAnsi for use in log parsing, and
handle SGR 39 (default foreground) by removing only color styles
instead of clearing all styles.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Multiple SGR parameters in one escape sequence (e.g. bold + color)
were each opening a new span, losing earlier styles. Collect styles
per sequence and emit one span with all of them.
Terminal color codes were rendering as raw escape sequences in the
web UI, making logs hard to read.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>