dfilatov / vidom

Library to build UI based on virtual DOM
MIT License
415 stars 16 forks source link

issues with void elements in SSR #108

Closed ghost closed 9 years ago

ghost commented 9 years ago

Void elements shouldn't have a end tag.

createNode("input").renderToString()

result: </input> expected: <input>

dfilatov commented 9 years ago

Seems you don't even try to check because it returns <input/>.

ghost commented 9 years ago

Why you say that? A void element doesn't have a end tag. And you clearly show to me here it's has an end tag. Still an issue in your script.

Reference:

From the W3C specs: http://www.w3.org/TR/html-markup/syntax.html#syntax-elements

http://www.456bereastreet.com/archive/201005/void_empty_elements_and_self-closing_start_tags_in_html/

dfilatov commented 9 years ago

There's no end tag in that case, just <input/>.

ghost commented 9 years ago

Ah! I see it now. I was thinking about / as an end-tag. It isn't. Sorry!