diff --git a/src/Scanner.php b/src/Scanner.php index 31c794ff..a191e021 100644 --- a/src/Scanner.php +++ b/src/Scanner.php @@ -41,7 +41,7 @@ public function findTranslations() '('. // Start a new group to match: '.+'. // Must start with group ')'. // Close group - "[\'\"]". // Closing quote + "(?scanner = app()->make(Scanner::class); $matches = $this->scanner->findTranslations(); - $this->assertEquals($matches, ['single' => ['single' => ['This will go in the JSON array' => '', 'This will also go in the JSON array' => '', 'trans' => '']], 'group' => ['lang' => ['first_match' => ''], 'lang_get' => ['first' => '', 'second' => ''], 'trans' => ['first_match' => '', 'third_match' => ''], 'trans_choice' => ['with_params' => '']]]); + $this->assertEquals(['single' => ['single' => ['This will go in the JSON array' => '', 'This will also go in the JSON array' => '', 'The first half of this sentence should go into the \'JSON array\', but the second part should as well!' => '', 'trans' => '']], 'group' => ['lang' => ['first_match' => ''], 'lang_get' => ['first' => '', 'second' => ''], 'trans' => ['first_match' => '', 'third_match' => ''], 'trans_choice' => ['with_params' => '']]], $matches); $this->assertCount(2, $matches); } } diff --git a/tests/fixtures/scan-tests/__.txt b/tests/fixtures/scan-tests/__.txt index 8b04d350..0a0cc475 100644 --- a/tests/fixtures/scan-tests/__.txt +++ b/tests/fixtures/scan-tests/__.txt @@ -3,4 +3,8 @@ __('This will go in the JSON array') __( 'This will also go in the JSON array' -) \ No newline at end of file +) + +__('This will go in the JSON array, and it\'ll properly unescape the apostrophe.') + +__('The first half of this sentence should go into the \'JSON array\', but the second part should as well!')