-
Notifications
You must be signed in to change notification settings - Fork 44
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
doesn't parse correctly if whitespaces exist #8
Comments
Not sure I understand. The 2nd example has 3 children: a text node, the Squashing whitespace around elements may not be appropriate for all use cases. In XHTML, |
Ok, You're right! valueElement.children[0] // returns ' ' instead of 4 As long as I know the tag name I can use |
Generally I'd suggest using A patch for a handy |
BTW. As an european open source hacker, do you have any plans regarding FOSDEM 2012? I won't be there, but @dodo is planning to go! |
ltx.parse("<x> </x>").children.length
is1
and correct (as long as whitespace characters where threated as children)ltx.parse("<x> <y> </y> </x>").children.length
is3
and NOT correct; it should be1
The children and the text of an element are treated the same way. Maybe we should explicitly separate them? So an element has either some children (
el.children
) or content (el.content
) but not both.The text was updated successfully, but these errors were encountered: