diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-09-30 21:07:28 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-09-30 21:07:28 +0200 |
| commit | a61dd7004929d59e882974640a2cc7526b13bfd6 (patch) | |
| tree | 7aaab8a5f6ff50c57e560f3b78527369e8fe941b | |
| parent | 52b2a3423147294df30a6a8c0f31c6d0412805c5 (diff) | |
Allow colours in font color tags to have no surrounding
quotation marks.
| -rw-r--r-- | src/subrip_reader.cc | 2 | ||||
| -rw-r--r-- | test/subrip_reader_test.cc | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/subrip_reader.cc b/src/subrip_reader.cc index beb81e1..89a5599 100644 --- a/src/subrip_reader.cc +++ b/src/subrip_reader.cc @@ -237,7 +237,7 @@ SubripReader::convert_line (string t, RawSubtitle& p) p.underline = false; } else if (boost::starts_with (tag, "font")) { maybe_content (p); - boost::regex re (".*color=\"#([[:xdigit:]]+)\""); + boost::regex re (".*color=\"?#([[:xdigit:]]+)\"?"); boost::smatch match; if (boost::regex_search (tag, match, re) && string (match[1]).size() == 6) { p.colour = Colour::from_rgb_hex (match[1]); diff --git a/test/subrip_reader_test.cc b/test/subrip_reader_test.cc index a77e8d7..6f8e5b8 100644 --- a/test/subrip_reader_test.cc +++ b/test/subrip_reader_test.cc @@ -424,6 +424,7 @@ BOOST_AUTO_TEST_CASE (subrip_read_test) test ("Fight.Club.1999.720p.BRRip.x264-x0r.srt"); test ("EU13.srt"); test ("Subtitulos_HURTO_eng.srt"); + test ("SWING_PARA_SORDOS_CASTELLANO_24.srt"); test_throw ("subtitulo1.srt"); } |
