aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-06-20 11:10:35 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-06-20 11:10:35 -0700
commit56c410ef6a3b7c3dd4054b18ea667cb4ab5a5ee0 (patch)
tree8d9c24598c44166e40ef78f56125b53c614f6a27 /src/Text/Pandoc/Readers
parent2eadc7805392c165f7286bd9a337b310b41c897d (diff)
downloadpandoc-56c410ef6a3b7c3dd4054b18ea667cb4ab5a5ee0.tar.gz
Markdown reader: Prevent spurious line breaks after list items.
When the `hard_line_breaks` option was specified, pandoc would produce a spurious line break after a tight list item. This patch solves the problem. Closes #1137.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index a6720beba..2c9064994 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1560,7 +1560,8 @@ endline = try $ do
guardEnabled Ext_blank_before_header <|> notFollowedBy (char '#') -- atx header
guardDisabled Ext_backtick_code_blocks <|>
notFollowedBy (() <$ (lookAhead (char '`') >> codeBlockFenced))
- (guardEnabled Ext_hard_line_breaks >> return (return B.linebreak))
+ (eof >> return mempty)
+ <|> (guardEnabled Ext_hard_line_breaks >> return (return B.linebreak))
<|> (guardEnabled Ext_ignore_line_breaks >> return mempty)
<|> (return $ return B.space)