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

chroot does not backtrack if guard fails #34

Closed
fimad opened this issue May 29, 2016 · 0 comments
Closed

chroot does not backtrack if guard fails #34

fimad opened this issue May 29, 2016 · 0 comments
Labels
Milestone

Comments

@fimad
Copy link
Owner

fimad commented May 29, 2016

If guard is used within the inner scraper passed to chroot scalpel should backtrack and try to find a tag that matches if the first tag fails. Currently this backtracking does not happen.

For example,

scrapeStringLike "<a>foo</a><a>bar</a><a>baz</a>" $ chroot "a" $ do
        t <- text Any
        guard ("b" `isInfixOf` t)
        html Any

Currently returns Nothing, but should return Just "<a>bar</a>"

fimad added a commit that referenced this issue May 29, 2016
This commit adds the resolutions to #23 and #25 to README.md under a
new tips & tricks section. Full source code for each is given in a new
example as well.

Additionally a backtracking bug was found in `chroot` while
documenting these tricks and is fixed in this commit as well.
@fimad fimad added this to the 0.3.1.1 milestone May 29, 2016
@fimad fimad added the bug label May 29, 2016
fimad added a commit that referenced this issue May 29, 2016
@fimad fimad closed this as completed May 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant