qgustavor / ass-parser

Parse SSA/ASS subtitle format
MIT License
1 stars 1 forks source link

Empty text. #2

Open shell1986 opened 1 year ago

shell1986 commented 1 year ago

Hi, in some lines where the text is enclosed in animation tags, the text is Empty.

Example

Dialogue: 0,0:06:23.04,0:06:23.96,top,Text,0000,0000,0000,,{\b1\c&H000200&\3c&HFFFFFF&}ЖАРЕНАЯ РЫБА{\b0}
Dialogue: 0,0:06:24.67,0:06:25.63,top,Text,0000,0000,0000,,{\b1\c&H000200&\3c&HFFFFFF&}СУП С ЖАРЕНОЙ РЫБОЙ{\b0}
Dialogue: 0,0:06:26.17,0:06:27.21,top,Text,0000,0000,0000,,{\b1\c&H000200&\3c&HFFFFFF&}САЛАТ С ЖАРЕНОЙ РЫБОЙ{\b1\b0}
Dialogue: 0,0:06:27.92,0:06:28.92,top,Text,0000,0000,0000,,{\b1\c&H000200&\3c&HFFFFFF&}ДЕСЕРТ ИЗ ЖАРЕНОЙ РЫБЫ{\b1\b0}
Dialogue: 0,0:06:29.55,0:06:30.28,top,Text,0000,0000,0000,,{\b1\c&H000200&\3c&HFFFFFF&}ЧТО-ТО С ЖАРЕНОЙ РЫБОЙ{\b1\b0}
qgustavor commented 1 year ago

Seems your issue got buried among other notifications. Can you provide the script with at least the Format lines? Upload it as a gist.

The animation tags should not be an issue since this library does not handle them at all. That's planned for the future, but at the moment tags are completely ignored by the parser.

Edit: check the demo: https://codepen.io/qgustavor/full/YzaRXeX

Dialogue: 0,0:00:00.00,0:00:05.00,Default,,0,0,0,,{\b}This is a line. becomes { "Layer": "0", "Start": "0:00:00.00", "End": "0:00:05.00", "Style": "Default", "Name": "", "MarginL": "0", "MarginR": "0", "MarginV": "0", "Effect": "", "Text": "{\\b}This is a line." }.