summaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-07-24 21:42:32 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-07-24 21:43:24 -0700
commitc00f5c4372fabfcb30744aa85b1cc2b9142ea3e7 (patch)
tree55f49dd61fcab6b595fd3445f12e418a857dd5c8 /src/Text
parent1fb1cfb67014f93e96bdc379951b41a9d6ba27c6 (diff)
HTML reader: Fixed bug in htmlBalanced.
This caused hangs in parsing certain markdown input using --strict.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index d76524e14..87ce6277d 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -595,11 +595,10 @@ htmlInBalanced :: (Tag String -> Bool) -> Parser [Char] ParserState String
htmlInBalanced f = try $ do
(TagOpen t _, tag) <- htmlTag f
guard $ '/' `notElem` tag -- not a self-closing tag
- let nonTagChunk = many1 $ satisfy (/= '<')
let stopper = htmlTag (~== TagClose t)
let anytag = liftM snd $ htmlTag (const True)
contents <- many $ notFollowedBy' stopper >>
- (nonTagChunk <|> htmlInBalanced (const True) <|> anytag)
+ (htmlInBalanced f <|> anytag <|> count 1 anyChar)
endtag <- liftM snd stopper
return $ tag ++ concat contents ++ endtag