fix: normalize blank separators before WebVTT metadata classification

This commit is contained in:
Palash Debnath
2026-09-17 14:01:25 +05:30
parent ad52d32760
commit 1f17560cde
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -86,7 +86,7 @@ def parse_srt(content: str) -> SrtParseResult:
# example timestamp inside a NOTE/STYLE/REGION cannot become speech.
blocks = []
for block in re.split(r"\n[^\S\n]*\n", text):
lines = block.strip("\n").split("\n")
lines = block.strip().split("\n")
first = lines[0].strip()
# WebVTT's block parser gives a timing line in position two
# precedence over the identifier (including STYLE/REGION/NOTE).