File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
packages/view/src/Elements Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ public function compile(): string
4141 $ attributes = [];
4242
4343 foreach ($ this ->getAttributes () as $ name => $ value ) {
44- if ($ value ) {
44+ if ($ value !== null && $ value !== '' ) {
4545 $ attributes [] = $ name . '=" ' . $ value . '" ' ;
4646 } else {
4747 $ attributes [] = $ name ;
Original file line number Diff line number Diff line change @@ -856,4 +856,13 @@ public function test_attributes_with_single_quotes(): void
856856
857857 $ this ->assertSnippetsMatch ('<div class="hello"></div> ' , $ html );
858858 }
859+
860+ public function test_zero_in_attribute (): void
861+ {
862+ $ html = $ this ->render (<<<'HTML'
863+ <table border="0"></table>
864+ HTML);
865+
866+ $ this ->assertSnippetsMatch ('<table border="0"></table> ' , $ html );
867+ }
859868}
You can’t perform that action at this time.
0 commit comments