Permalink
Browse files

Changed the regex to account for more things.

Signed-off-by: Eric Barnes <eric@ericlbarnes.com>
  • Loading branch information...
1 parent 8ec5274 commit 1d43896ad1050512dad52a1306e62c92a030a84c @ericbarnes committed Apr 5, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 laravel/blade.php
View
6 laravel/blade.php
@@ -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);
}
/**

0 comments on commit 1d43896

Please sign in to comment.