Fix coalesced override codes (\i1\b1 and such).
[libsub.git] / src / ssa_reader.cc
index 93e96f28af7cf4dd7fe6e8dcc0cdd7acf32461f8..05c908e2c86b3c1bbfef35d940116eea57342298 100644 (file)
@@ -230,7 +230,7 @@ SSAReader::parse_line (RawSubtitle base, string line)
                        }
                        break;
                case STYLE:
-                       if (c == '}') {
+                       if (c == '}' || c == '\\') {
                                if (!current.text.empty ()) {
                                        subs.push_back (current);
                                        current.text = "";
@@ -250,7 +250,11 @@ SSAReader::parse_line (RawSubtitle base, string line)
                                } else if (style == "\\an7" || style == "\\an8" || style == "\\an9") {
                                        current.vertical_position.reference = sub::TOP_OF_SCREEN;
                                }
+
                                style = "";
+                       }
+
+                       if (c == '}') {
                                state = TEXT;
                        } else {
                                style += c;