New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zepto does not handle multiple self-closing tags the same as jQuery #322

Closed
pamelafox opened this Issue Nov 19, 2011 · 1 comment

Comments

Projects
None yet
3 participants
@pamelafox
Contributor

pamelafox commented Nov 19, 2011

The jQuery tools dateinput plugin uses this line to create some DOM:

root = $('<div><div><a/><div/><a/></div><div><div/><div/></div></div>').hide().css({position: 'absolute'}).attr("id", css.root);

The DOM produced by Zepto is not the same as the DOM produced by jQuery. To workaround it, I created start and end tags for each of the self-closing tags in the string, and it came out correctly.

You can compare the DOM produced here:
http://pastebin.com/5heWjZg9

Zepto seems generally to be able to handle self closing tag syntax, but perhaps not when it's mixed in a long string like that.

@ghost ghost assigned madrobby and mislav Apr 5, 2012

@madrobby

This comment has been minimized.

Show comment
Hide comment
@madrobby

madrobby Apr 5, 2012

Owner

Webkit parses this HTML as:

<div><div><a></a><div><a></a><a></a></div><div><div><div></div></div></div></div></div>

This is the way HTML5 is supposed to be parsed.

In HTML 5, <foo /> means <foo>. The slash is just syntactic sugar for people who are addicted to XML. The syntax is valid, but it is not a "self-closing tag". The distinction is important since (in the HTML syntax at least) <div /> means <div> in HTML 5 and not <div></div> as it does in XHTML. (from http://stackoverflow.com/questions/3558119/are-self-closing-tags-valid-in-html5)

Owner

madrobby commented Apr 5, 2012

Webkit parses this HTML as:

<div><div><a></a><div><a></a><a></a></div><div><div><div></div></div></div></div></div>

This is the way HTML5 is supposed to be parsed.

In HTML 5, <foo /> means <foo>. The slash is just syntactic sugar for people who are addicted to XML. The syntax is valid, but it is not a "self-closing tag". The distinction is important since (in the HTML syntax at least) <div /> means <div> in HTML 5 and not <div></div> as it does in XHTML. (from http://stackoverflow.com/questions/3558119/are-self-closing-tags-valid-in-html5)

@madrobby madrobby closed this Apr 5, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment