Skip to content
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

trailing html comment is parsed as multiple elements #35

Closed
tnguyen14 opened this issue Sep 9, 2014 · 1 comment
Closed

trailing html comment is parsed as multiple elements #35

tnguyen14 opened this issue Sep 9, 2014 · 1 comment

Comments

@tnguyen14
Copy link

domify('<div class="main"></div>'); // returns a div element
domify('<div class="main"></div><!-- .main -->'); // returns a document-fragment

The practice of putting the trailing comment to identify the closing tag is quite common, especially for large node. Is this a bug or the intended behavior, and is there a way to get around it without removing the comment?

@stephenmathieson
Copy link
Contributor

well, a div and a comment are actually two nodes, so returning a single node wouldn't work. i'd say this is intended behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants