-
Notifications
You must be signed in to change notification settings - Fork 255
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
Text() / .InnerText do not include text of nested elements #186
Comments
Issued was observed on version 1.3.4 |
Ok, though I was quite certain the given test was failing before (using .Text()), it is passing for me now. I have no idea why. It seems .InnerText is still behaving badly though, which is what I was using in the code I am trying to fix. With the tests below, at version 1.3.4, TextIncludesSubElements passes while test InnerTextIncludesSubElements fails. I sear TextIncludesSubElements (formerly called Misc) was failing before, but, its hard to explain why it would change and easier to conclude I made a mistake in my observations.
|
I can use element.Cq().Text() instead of .InnerText to get the result I want now. I don't know why I saw .Text() misbehaving, but I will assume I was wrong on that and close this issue out. (I still expected .InnerText to behave differently, but CsQuery is your design I'm not sure if that makes sense for you) |
When using jQuery or the DOM, .text() and .innerText include the text of inner DOM elements. In the below example, observe the contents of the inner are included:
in CsQuery, the nested elements are not included in .Text() or .InnerText. Below is a failing test, the .Text() result equals "est", not including the s contents as I'd expect.
The text was updated successfully, but these errors were encountered: