diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-03-22 21:18:55 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-03-22 21:19:50 +0100 |
commit | f4ac0edf2a5087f3f988147726813a6240288945 (patch) | |
tree | c81030ae8fd30561b34d2d0f401fbb2c869dd0c6 /src/Text | |
parent | 9437ab449c8f8bf50f4c8a7f08156d2c1aea604a (diff) | |
download | pandoc-f4ac0edf2a5087f3f988147726813a6240288945.tar.gz |
Markdown reader: allow latex macro definitions indented 1-3 spaces.
Previously they only worked if nonindented.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 9 |
1 files changed, 8 insertions, 1 deletions
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 |