Skip to content

Commit

Permalink
Fix trailing whitespaces from format names in ASS decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
nandesh-dev committed Oct 4, 2024
1 parent 3fdbf9e commit a303036
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkgs/subtitle/ass/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,15 @@ func DecodeSubtitle(path string, index int) (Stream, *warning.WarningList, error

switch lT {
case Format:
currentFormat = strings.Split(suffix, ",")
currentFormat = make([]string, 0)
for _, pt := range strings.Split(suffix, ",") {
currentFormat = append(currentFormat, strings.TrimSpace(pt))
}
case Dialogue:
segment := NewSegment()

parts := strings.SplitN(suffix, ",", len(currentFormat))

for i, partName := range currentFormat {
switch partName {
case "Start":
Expand Down

0 comments on commit a303036

Please sign in to comment.