Skip to content

Commit 0abd7ce

Browse files
authored
Merge pull request #53 from joelcuevas/master
fix #52 for regex not matching @lang/@choice when enclosed on html tags
2 parents bedbe70 + 819c31c commit 0abd7ce

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Manager.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,9 @@ public function getAllViewFilesWithTranslations()
309309
$functions = ['trans', 'trans_choice', 'Lang::get', 'Lang::choice', 'Lang::trans', 'Lang::transChoice', '@lang', '@choice'];
310310

311311
$pattern =
312-
// See https://regex101.com/r/jS5fX0/2
313-
'[^\w|>]'. // Must not start with any alphanum or _ or >
312+
// See https://regex101.com/r/jS5fX0/3
313+
'[^\w]'. // Must not start with any alphanum or _
314+
'(?<!->)'. // Must not start with ->
314315
'('.implode('|', $functions).')'.// Must start with one of the functions
315316
"\(".// Match opening parentheses
316317
"[\'\"]".// Match " or '

0 commit comments

Comments
 (0)