Repository navigation
fix(webvtt): keep cues with misnested end tags - #1079
aad1tyaaaaa wants to merge 2 commits into
Conversation
|
✅ DCO Check Passed Thanks @aad1tyaaaaa, all your commits are properly signed off. 🎉 |
Merge Protections🔴 1 of 2 protections blocking · waiting on 👀 reviews
🔴 Require two reviewer for test updatesWaiting for
This rule is failing.When test data is updated, we require two reviewers
Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
AI triage (advisory)Checked commit Warning The AI analysis did not finish. Only the deterministic checks are shown. CI safety: not assessed. The |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@aad1tyaaaaa Thanks for suggesting this PR. Before entering into the development details, I added a comment to the issue conversation on how I see the scope of this PR. |
|
@aad1tyaaaaa There is a conflict with |
A bare '<' that starts no tag, as in "x < 5", is now kept as text instead of failing validation. An end tag that does not close the innermost open span is ignored, as the WebVTT cue text parsing rules require, instead of raising "Incorrect end tag". In both cases the whole cue used to be dropped. Signed-off-by: aad1tyaaaaa <aadityaaaaa.jaiswar@gmail.com>
Signed-off-by: aad1tyaaaaa <aadityaaaaa.jaiswar@gmail.com>
63709f3 to
b5f70e7
Compare
Fixes #1078
A cue with misnested end tags (
<b><i>x</b></i>) madeWebVTTCueBlock.parseraiseIncorrect end tag, so the whole cue was dropped from the converted document.Change (
webvtt.py): an end tag that does not close the innermost open span is ignored, as WebVTT §6.4 requires ("Otherwise, ignore the token"), instead of raising.<b><i>x</b></i>now parses to<b><i>x</i></b>.Tests (
tests/test_webvtt.py): the "Misnested end tags are still rejected" assertion now checks that such cues are kept and repaired. It fails onmainand passes with this change; ruff is clean.Following the discussion in #1078, this PR no longer changes how a bare
<is handled.I used an AI assistant (Claude Code) to help find this bug and write the fix and tests. I reviewed and ran everything myself.