Skip to content

Commit

Permalink
Merge pull request #60 from Raveline/fix_dfs
Browse files Browse the repository at this point in the history
Fix dfs
  • Loading branch information
fimad authored Apr 25, 2017
2 parents 7138aba + 4d56239 commit cf07144
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scalpel-core/src/Text/HTML/Scalpel/Internal/Select.hs
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ selectNodes [n] (tags, f : fs, ctx) acc
| nodeMatches n info = (shrunkSpec :)
$ selectNodes [n] (tags, fs, ctx)
$ selectNodes [n] (tags, Tree.subForest f, ctx) acc
| otherwise = selectNodes [n] (tags, fs, ctx)
$ selectNodes [n] (tags, Tree.subForest f, ctx) acc
| otherwise = selectNodes [n] (tags, Tree.subForest f, ctx)
$ selectNodes [n] (tags, fs, ctx) acc
where
Span lo hi = Tree.rootLabel f
shrunkSpec = (
Expand Down
5 changes: 5 additions & 0 deletions scalpel-core/tests/TestMain.hs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@ scrapeTests = "scrapeTests" ~: TestList [
index <- position
content <- text anySelector
return (index, content))

, scrapeTest
"<div><p>p1</p><p>p2</p><blockquote><p>p3</p></blockquote><p>p4</p>"
(Just ["p1", "p2", "p3", "p4"])
(texts "p")
]

scrapeTest :: (Eq a, Show a) => String -> Maybe a -> Scraper String a -> Test
Expand Down

0 comments on commit cf07144

Please sign in to comment.