diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-02-15 22:33:30 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-02-15 22:34:32 -0800 |
commit | d7d1c9c8e41851e06c1224ae018f740c915a3600 (patch) | |
tree | 243b5ec095eacfc31b0ed32f605c4e091e0aee86 /src/Text/Pandoc/Readers | |
parent | fb5bafd13e9fc890a134c93dd1aa381409a4058d (diff) | |
download | pandoc-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.hs | 5 |
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 |