Skip to content

Commit f25e757

Browse files
dicerharaldF
authored andcommitted
Support spans without a style attribute
1 parent 7e963cc commit f25e757

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ttaf2srt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ def parseStyles(styles):
7171
if item.hasAttribute('xml:id'):
7272
dumpHeader(item, subCount)
7373
subCount += 1
74-
color = styles[item.getAttribute("style")]
74+
if item.hasAttribute('style'):
75+
color = styles[item.getAttribute("style")]
7576
if color:
7677
print("<font color=\"" + color + "\">", end="")
7778
dumpText(item)

0 commit comments

Comments
 (0)