From d7d1c9c8e41851e06c1224ae018f740c915a3600 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 15 Feb 2019 22:33:30 -0800 Subject: Markdown reader: fix bug parsing fenced code blocks. Previously parsing would break if the code block contained a string of backticks of sufficient length followed by something other than end of line. Closes #5304. --- src/Text/Pandoc/Readers/Markdown.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 646e5aaa7..43cb68b67 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -722,8 +722,9 @@ codeBlockFenced = try $ do blankline contents <- intercalate "\n" <$> manyTill (gobbleAtMostSpaces indentLevel >> anyLine) - (blockDelimiter (== c) (Just size)) - blanklines + (try $ do + blockDelimiter (== c) (Just size) + blanklines) return $ return $ case rawattr of Left syn -> B.rawBlock syn contents -- cgit v1.2.3