Skip to content

Commit

Permalink
Changed the regex to account for more things.
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Barnes <eric@ericlbarnes.com>
  • Loading branch information
ericlbarnes committed Apr 5, 2012
1 parent 8ec5274 commit 1d43896
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions laravel/blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,10 @@ protected static function extract($value, $expression)
*/
protected static function compile_comments($value)
{
$value = preg_replace('/\{\{\-([^\{\}]*)\-\}\}/', '<?php /* $1 */ ?>', $value);
return preg_replace('/\{\{-(.+?)\n/', '<?php // $1 ?>', $value);
// Single line
$value = preg_replace('/\{\{--(.+?)(--\}\})?\n/', "<?php // $1 ?>", $value);
// Multi line
return preg_replace('/\{\{--((.|\s)*?)--\}\}/', "<?php /* $1 */ ?>\n", $value);
}

/**
Expand Down

0 comments on commit 1d43896

Please sign in to comment.