aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-02-15 22:33:30 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2019-02-15 22:34:32 -0800
commitd7d1c9c8e41851e06c1224ae018f740c915a3600 (patch)
tree243b5ec095eacfc31b0ed32f605c4e091e0aee86 /src/Text/Pandoc/Readers
parentfb5bafd13e9fc890a134c93dd1aa381409a4058d (diff)
downloadpandoc-d7d1c9c8e41851e06c1224ae018f740c915a3600.tar.gz
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.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs5
1 files changed, 3 insertions, 2 deletions
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