Skip to content

Escape timestamp arrows in word-level subtitles - #2847

Open
codewithfourtix wants to merge 2 commits into
openai:mainfrom
codewithfourtix:fix-word-subtitle-arrow-text
Open

codewithfourtix wants to merge 2 commits into
openai:mainfrom
codewithfourtix:fix-word-subtitle-arrow-text

Conversation

@codewithfourtix

Copy link
Copy Markdown

Segment-level subtitles already replace --> in transcript text, but word-level subtitles leave it intact. Apply the same escaping before assembling word-level cues, including highlighted words.

Adds SRT and VTT regressions and checks that the input timings remain unchanged.

Copilot AI lite review requested due to automatic review settings September 5, 2026 17:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new regression test does not currently verify the “input timings remain unchanged” claim from the PR description, so the test coverage doesn’t fully match the stated acceptance criteria.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR ensures word-level subtitle output (SRT/VTT) escapes the --> timestamp arrow sequence inside subtitle text (word cues and highlighted-word cues), aligning behavior with existing segment-level subtitle escaping.

Changes:

  • Escape --> to -> in each word’s text before assembling word-level subtitle cues.
  • Add regression tests covering both SRT and VTT writers, with and without highlight_words.
File summaries
File Description
whisper/utils.py Escapes --> in word-level cue text before line splitting / cue assembly.
tests/test_subtitle_arrows.py Adds a regression test ensuring word-level subtitle text does not contain --> for both writers and highlight modes.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/test_subtitle_arrows.py Resolved
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