diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2013-09-08 11:43:46 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-09-08 11:43:46 -0700 |
commit | cf2506acdc721ec27ed310cd7bdad8affb28d1e5 (patch) | |
tree | beb50f3539a49b34b379bbfc4e9fd2871333d8b7 /src/Text | |
parent | 4bc9e695b846ff2733a55c4cff5eb373b4f1f0c4 (diff) | |
download | pandoc-cf2506acdc721ec27ed310cd7bdad8affb28d1e5.tar.gz |
Markdown: Allow backtick code blocks not to be preceded by blank line.
Closes #975.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 2ca0d312a..4a7789e17 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -872,6 +872,7 @@ para = try $ do newline (blanklines >> return mempty) <|> (guardDisabled Ext_blank_before_blockquote >> lookAhead blockQuote) + <|> (guardEnabled Ext_backtick_code_blocks >> lookAhead codeBlockFenced) <|> (guardDisabled Ext_blank_before_header >> lookAhead header) return $ do result' <- result @@ -1562,6 +1563,8 @@ endline = try $ do guardDisabled Ext_lists_without_preceding_blankline <|> notFollowedBy listStart guardEnabled Ext_blank_before_blockquote <|> notFollowedBy emailBlockQuoteStart guardEnabled Ext_blank_before_header <|> notFollowedBy (char '#') -- atx header + guardEnabled Ext_backtick_code_blocks >> + notFollowedBy (() <$ (lookAhead (char '`') >> codeBlockFenced)) -- parse potential list-starts differently if in a list: st <- getState when (stateParserContext st == ListItemState) $ do |