We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8adae63 commit ded4282Copy full SHA for ded4282
1 file changed
packages/web/src/ee/features/chat/mcp/mcpToolMetadata.ts
@@ -40,7 +40,16 @@ function removeControlCharacters(value: string): string {
40
}
41
42
function removeHtmlTags(value: string): string {
43
- return value.replace(/<[^>]*>/g, '');
+ // Strip repeatedly until stable: a single pass can reintroduce a tag
44
+ // sequence (e.g. "<scr<x>ipt>" collapses to "<script>"), so loop until
45
+ // no more tags are removed.
46
+ let current = value;
47
+ let previous: string;
48
+ do {
49
+ previous = current;
50
+ current = current.replace(/<[^>]*>/g, '');
51
+ } while (current !== previous);
52
+ return current;
53
54
55
function normalizeWhitespace(value: string): string {
0 commit comments