Skip to content

Commit

Permalink
void elements dont need a slash
Browse files Browse the repository at this point in the history
  • Loading branch information
stanistan committed Jan 24, 2024
1 parent 52bb9d9 commit 2ec11e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions el/el_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ func TestHTMLRender(t *testing.T) {
},
{
el.Br().In(el.Div()),
`<div><br /></div>`,
`<div><br></div>`,
},
{
el.Img().Attr("src", "/foo.png"),
`<img src="/foo.png" />`,
`<img src="/foo.png">`,
},
} {
testCase := testCase
Expand Down
2 changes: 1 addition & 1 deletion el/void.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var (

// View constructs a [*veun.View] from a VoidElement.
func (e *VoidElement) View(ctx context.Context) (*veun.View, error) {
return veun.Raw(openingTag(e.tag, e.attrs, " />")).View(ctx)
return veun.Raw(openingTag(e.tag, e.attrs, ">")).View(ctx)
}

// Attrs sets the attributes for the element.
Expand Down

0 comments on commit 2ec11e6

Please sign in to comment.