diff --git a/scalpel-core/src/Text/HTML/Scalpel/Internal/Select.hs b/scalpel-core/src/Text/HTML/Scalpel/Internal/Select.hs index 236cfa6..35f9a09 100644 --- a/scalpel-core/src/Text/HTML/Scalpel/Internal/Select.hs +++ b/scalpel-core/src/Text/HTML/Scalpel/Internal/Select.hs @@ -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 = ( diff --git a/scalpel-core/tests/TestMain.hs b/scalpel-core/tests/TestMain.hs index e330612..7400a7c 100644 --- a/scalpel-core/tests/TestMain.hs +++ b/scalpel-core/tests/TestMain.hs @@ -296,6 +296,11 @@ scrapeTests = "scrapeTests" ~: TestList [ index <- position content <- text anySelector return (index, content)) + + , scrapeTest + "

p1

p2

p3

p4

" + (Just ["p1", "p2", "p3", "p4"]) + (texts "p") ] scrapeTest :: (Eq a, Show a) => String -> Maybe a -> Scraper String a -> Test