mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-08 16:39:42 +02:00
fix: avoid no-control-regex lint error for ANSI strip pattern
Use RegExp constructor with String.raw to express \x1b without a literal control character in the source, matching the pattern used elsewhere in the codebase. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1000,7 +1000,7 @@ export function registerSessionRoutes(
|
|||||||
// Strip XML-like system/command tags and ANSI escapes from transcripts
|
// Strip XML-like system/command tags and ANSI escapes from transcripts
|
||||||
text = text
|
text = text
|
||||||
.replace(/<[^>]+>/g, '')
|
.replace(/<[^>]+>/g, '')
|
||||||
.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, '')
|
.replace(new RegExp(String.raw`\x1b\[[0-9;]*[a-zA-Z]`, 'g'), '')
|
||||||
.trim()
|
.trim()
|
||||||
.replace(/\s+/g, ' ');
|
.replace(/\s+/g, ' ');
|
||||||
if (!text) continue;
|
if (!text) continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user