Skip to content

Commit 9c2e5ff

Browse files
committed
fix(zoom): iteratively strip tags to close incomplete-sanitization gap
1 parent 5d1aa22 commit 9c2e5ff

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

apps/sim/connectors/zoom/zoom.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,13 @@ function parseVtt(vtt: string): string {
152152
if (textParts.length > 0) {
153153
const raw = textParts.join(' ')
154154
const withSpeakers = raw.replace(/<v(?:\.[^\s>]+)?\s+([^>]+)>([\s\S]*?)<\/v>/g, '$1: $2')
155-
const stripped = withSpeakers
156-
.replace(/<\/?[^>]+>/g, '')
157-
.replace(/\s+/g, ' ')
158-
.trim()
155+
let withoutTags = withSpeakers
156+
let previous: string
157+
do {
158+
previous = withoutTags
159+
withoutTags = withoutTags.replace(/<\/?[^>]+>/g, '')
160+
} while (withoutTags !== previous)
161+
const stripped = withoutTags.replace(/\s+/g, ' ').trim()
159162
if (stripped) segments.push(stripped)
160163
}
161164
}

0 commit comments

Comments
 (0)