Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Self-closing html tags act as open tags #487
When creating DOM elements with an html string, self-closing html tags are interpreted by the browser and opening tags only. This happens when you set
Expect to Happen:
To fix this, jQuery will split any self-closing tags into open-close tags before creating the elements. This pull request implements that technique in Zepto. I also added a test for this scenario.
jQuery Implementation Reference: https://github.com/jquery/jquery/blob/master/src/manipulation.js#L674
Side Effect: I added uglifier to the Gemfile since it's required to build the project. If you don't want to accept that part of this pull request, I can remove it.
It's a short fix, but should we promote this? In HTML5, there actually aren't any self-closing tags anymore, and writing stuff like
I can see the appeal for conciseness tho, plus it doesn't add a lot of code.