Closed gregnwosu closed 8 years ago
Check out the response to issue #23
chroots "p" $ do
t <- text Any
guard (isInfixOf "would" t)
html Any
selects paragraphs whose text contains "would".
Does @rpglover64's comment provide what you need?
As for concatenating all text nodes, I'm not sure what a reasonable alternative would be. For example, if you have <a> foo <b> bar </b> baz </a>
there isn't a single text node within the <a>
tag. And it seems like it would be very unintuitive to only return foo baz
in this case.
Closing this out. The chroots trick @rpglover64 provided is now documented in the README.
try as I might I havent been able to select based on the text, further more the text primitive seems to concatenate all text nodes beneath the current node. Any ways around this?