Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
fix regex to skip html tags, makes testShouldNotTouchHtmlTags() pass
Browse files Browse the repository at this point in the history
  • Loading branch information
martinlindhe committed Nov 27, 2015
1 parent d0acd47 commit 5367b69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private function adjustString($s)
}

return preg_replace_callback(
'/:\w*/',
'/(<[^>]*>(*SKIP)(*FAIL)|:\w*)/',
function ($matches) {
return '{' . mb_substr($matches[0], 1) . '}';
},
Expand Down
4 changes: 2 additions & 2 deletions tests/GenerateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function testNamed()
$this->destroyLocaleFilesFrom($arr, $root);
}

function testLeaveHtmlTags()
function testShouldNotTouchHtmlTags()
{
$arr = [
'en' => [
Expand All @@ -135,7 +135,7 @@ function testLeaveHtmlTags()
'export default {' . PHP_EOL
. ' "en": {' . PHP_EOL
. ' "help": {' . PHP_EOL
. ' "yes": "see <a href=\"mailto:mail@com\">",' . PHP_EOL
. ' "yes": "see <a href=\"mailto:mail@com\">"' . PHP_EOL
. ' }' . PHP_EOL
. ' }' . PHP_EOL
. '}' . PHP_EOL,
Expand Down

0 comments on commit 5367b69

Please sign in to comment.