Skip to content

Commit

Permalink
Merge pull request #53 from joelcuevas/master
Browse files Browse the repository at this point in the history
fix #52 for regex not matching @lang/@choice when enclosed on html tags
  • Loading branch information
themsaid authored Sep 3, 2016
2 parents bedbe70 + 819c31c commit 0abd7ce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,9 @@ public function getAllViewFilesWithTranslations()
$functions = ['trans', 'trans_choice', 'Lang::get', 'Lang::choice', 'Lang::trans', 'Lang::transChoice', '@lang', '@choice'];

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

0 comments on commit 0abd7ce

Please sign in to comment.