From f4ac0edf2a5087f3f988147726813a6240288945 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 22 Mar 2017 21:18:55 +0100 Subject: Markdown reader: allow latex macro definitions indented 1-3 spaces. Previously they only worked if nonindented. --- src/Text/Pandoc/Readers/Markdown.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 0cc10c1d4..5f08afe08 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -498,7 +498,7 @@ block = do , htmlBlock , table , codeBlockIndented - , guardEnabled Ext_latex_macros *> (macro >>= return . return) + , latexMacro , rawTeXBlock , lineBlock , blockQuote @@ -1071,6 +1071,13 @@ rawVerbatimBlock = htmlInBalanced isVerbTag isVerbTag (TagOpen "script" _) = True isVerbTag _ = False +latexMacro :: PandocMonad m => MarkdownParser m (F Blocks) +latexMacro = try $ do + guardEnabled Ext_latex_macros + skipNonindentSpaces + res <- macro + return $ return res + rawTeXBlock :: PandocMonad m => MarkdownParser m (F Blocks) rawTeXBlock = do guardEnabled Ext_raw_tex -- cgit v1.2.3