File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
packages/view/src/Elements Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,11 @@ public function __construct(
1919 public function compile (): string
2020 {
2121 return str ($ this ->text )
22+ // Render {{-- --}}
23+ ->replaceRegex (
24+ regex: '/{{--(.|\n)*?--}}/ ' ,
25+ replace: '' ,
26+ )
2227 // Render {{
2328 ->replaceRegex (
2429 regex: '/{{(?<match>.*?)}}/ ' ,
Original file line number Diff line number Diff line change @@ -718,4 +718,13 @@ public function test_unclosed_php_tag(): void
718718
719719 $ this ->assertSame ('hi ' , $ html );
720720 }
721+
722+ public function test_view_comments (): void
723+ {
724+ $ html = $ this ->render (<<<'HTML'
725+ <p>{{-- this is a comment --}}this is rendered text</p>{{-- this is a comment --}}
726+ HTML);
727+
728+ $ this ->assertSnippetsMatch ('<p>this is rendered text</p> ' , $ html );
729+ }
721730}
You can’t perform that action at this time.
0 commit comments