Skip to content

fix(subtitle): escape literal transcript text in WebVTT - #721

Merged
calesthio merged 2 commits into
OpenMontageInc:mainfrom
ac1982:fix/subtitle-cue-escaping
Nov 8, 2026
Merged

calesthio merged 2 commits into
OpenMontageInc:mainfrom
ac1982:fix/subtitle-cue-escaping

Conversation

@ac1982

@ac1982 ac1982 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Transcript text is written directly into WebVTT cue markup. Literal <b>tag</b> loses its tags in a browser, and literal &amp; displays as &. This affects normal, word-by-word, and karaoke captions.

Escape transcript text at the WebVTT rendering boundary, before adding the tool's own karaoke <b> tags. Caption JSON retains raw text. SRT retains its existing rendering because FFmpeg's SubRip decoder does not decode HTML entities; applying WebVTT escaping there would display entity strings literally.

Validation:

The cue-text rules are described in https://www.w3.org/TR/webvtt1/#webvtt-cue-text.

Checked existing subtitle/markup/escaping issues and PRs. #538 handles CJK spacing; #718 fixes regex replacement interpretation in corrections. This change concerns WebVTT serialization and is independent of those fixes.

@ac1982
ac1982 requested a review from calesthio as a code owner October 7, 2026 10:31
@ac1982 ac1982 changed the title fix(subtitle): escape literal transcript text in SRT and WebVTT fix(subtitle): escape literal transcript text in WebVTT Oct 7, 2026

@calesthio calesthio left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing literal text in WebVTT. Reviewed the complete diff against main 63d1087a: escaping occurs at the VTT boundary before karaoke markup, while raw JSON and SubRip behavior are preserved. This agrees with the WebVTT cue-text rules (https://www.w3.org/TR/webvtt1/#webvtt-cue-text).

Validation: isolated offline run of tests/tools/test_subtitle_escaping.py and tests/tools/test_subtitle_timestamps.py — 11 passed, including actual FFmpeg SRT decoding controls.

@calesthio calesthio closed this Nov 7, 2026
@calesthio calesthio reopened this Nov 7, 2026
calesthio pushed a commit that referenced this pull request Nov 8, 2026
@calesthio
calesthio merged commit ef4e7e8 into OpenMontageInc:main Nov 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants