aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-08-31 12:55:47 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-08-31 12:55:47 -0700
commit598d3ee23b708634ac8526cdc03291f17803eb2a (patch)
tree6e036cc26c8bf3e5d58982d21dc6bbfa72ce8c9d /src/Text/Pandoc/Readers
parent6cf9ab78554cdf0a854a26a9386265653c7519ad (diff)
downloadpandoc-598d3ee23b708634ac8526cdc03291f17803eb2a.tar.gz
Markdown reader: better handling of paragraph in div.
Previously text that ended a div would be parsed as Plain unless there was a blank line before the closing div tag. Test case: <div class="first"> This is a paragraph. This is another paragraph. </div> Closes #1591.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 6b7f1a8fb..02a787670 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -927,6 +927,12 @@ para = try $ do
<|> (guardDisabled Ext_blank_before_header >> () <$ lookAhead header)
<|> (guardEnabled Ext_lists_without_preceding_blankline >>
() <$ lookAhead listStart)
+ <|> do guardEnabled Ext_native_divs
+ inHtmlBlock <- stateInHtmlBlock <$> getState
+ case inHtmlBlock of
+ Just "div" -> () <$
+ lookAhead (htmlTag (~== TagClose "div"))
+ _ -> mzero
return $ do
result' <- result
case B.toList result' of
@@ -1611,6 +1617,7 @@ endline = try $ do
guardEnabled Ext_blank_before_header <|> notFollowedBy (char '#') -- atx header
guardDisabled Ext_backtick_code_blocks <|>
notFollowedBy (() <$ (lookAhead (char '`') >> codeBlockFenced))
+ notFollowedByHtmlCloser
(eof >> return mempty)
<|> (guardEnabled Ext_hard_line_breaks >> return (return B.linebreak))
<|> (guardEnabled Ext_ignore_line_breaks >> return mempty)