Repository navigation
fix(subtitle): escape literal transcript text in WebVTT - #721
Merged
Merged
Conversation
calesthio
approved these changes
Nov 7, 2026
calesthio
left a comment
Collaborator
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Transcript text is written directly into WebVTT cue markup. Literal
<b>tag</b>loses its tags in a browser, and literal&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:
getCueAsHTML().textContentpreserves the original literal text, and karaoke bolding still applies to the active word.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.