aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-03-22 21:18:55 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-03-22 21:19:50 +0100
commitf4ac0edf2a5087f3f988147726813a6240288945 (patch)
treec81030ae8fd30561b34d2d0f401fbb2c869dd0c6
parent9437ab449c8f8bf50f4c8a7f08156d2c1aea604a (diff)
downloadpandoc-f4ac0edf2a5087f3f988147726813a6240288945.tar.gz
Markdown reader: allow latex macro definitions indented 1-3 spaces.
Previously they only worked if nonindented.
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs9
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