diff --git a/src/Code/Converters/SubMicroDvdConverter.php b/src/Code/Converters/SubMicroDvdConverter.php index c16f119..aeccd54 100644 --- a/src/Code/Converters/SubMicroDvdConverter.php +++ b/src/Code/Converters/SubMicroDvdConverter.php @@ -4,11 +4,11 @@ class SubMicroDvdConverter implements ConverterContract { - static protected $fps = 23.975; // SubtitleEdit by default uses this fps. Taken that value without much thinking. Change it to a better values if you will find. + static protected $fps = 23.976; // SubtitleEdit by default uses this fps. Taken that value without much thinking. Change it to a better values if you will find. public function canParseFileContent($file_content) { - $pattern = "/\{\d+\}\{\d+\}(.*)\./"; + $pattern = "/\{\d+\}\{\d+\}(.*)/"; return preg_match($pattern, $file_content, $matches); } diff --git a/tests/formats/SubMicroDvdTest.php b/tests/formats/SubMicroDvdTest.php index 3dee5be..922b285 100644 --- a/tests/formats/SubMicroDvdTest.php +++ b/tests/formats/SubMicroDvdTest.php @@ -42,4 +42,15 @@ public function testParsesStyles() $expected = $this->defaultSubtitles()->getInternalFormat(); $this->assertInternalFormatsEqual($expected, $actual, 0.25); } + + public function testParsesLinesWithoutDotAtTheEnd() + { + $content = <<getInternalFormat(); + $expected = (new Subtitles())->add(0, 4.17, 'Subtitle line 1')->add(6.26, 12.51, 'Subtitle line 2')->getInternalFormat(); + $this->assertInternalFormatsEqual($expected, $actual); + } }