Skip to content

Commit

Permalink
Merge pull request #272 from joeldrapper/remove-redundant-slash-in-vo…
Browse files Browse the repository at this point in the history
…id-elements

Remove redundant slash in void elements
  • Loading branch information
joeldrapper authored Oct 19, 2022
2 parents 64dd283 + d49a194 commit e54bb5b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/phlex/html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ def register_void_element(element, tag: element.name.tr("_", "-"))
def #{element}(**attributes)
if attributes.length > 0
@_target << "<#{tag}" << (Phlex::ATTRIBUTE_CACHE[attributes.hash] || _attributes(attributes)) << " />"
@_target << "<#{tag}" << (Phlex::ATTRIBUTE_CACHE[attributes.hash] || _attributes(attributes)) << ">"
else
@_target << "<#{tag} />"
@_target << "<#{tag}>"
end
nil
Expand Down
2 changes: 1 addition & 1 deletion test/phlex/view/tags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
end

it "produces the correct output" do
expect(output).to be == %(<#{tag} class="class" id="id" disabled />)
expect(output).to be == %(<#{tag} class="class" id="id" disabled>)
end
end
end
Expand Down

0 comments on commit e54bb5b

Please sign in to comment.