Markdown reader: allow latex macro definitions indented 1-3 spaces.

Previously they only worked if nonindented.
This commit is contained in:
John MacFarlane 2017-03-22 21:18:55 +01:00
parent 9437ab449c
commit f4ac0edf2a

View file

@ -498,7 +498,7 @@ block = do
, htmlBlock , htmlBlock
, table , table
, codeBlockIndented , codeBlockIndented
, guardEnabled Ext_latex_macros *> (macro >>= return . return) , latexMacro
, rawTeXBlock , rawTeXBlock
, lineBlock , lineBlock
, blockQuote , blockQuote
@ -1071,6 +1071,13 @@ rawVerbatimBlock = htmlInBalanced isVerbTag
isVerbTag (TagOpen "script" _) = True isVerbTag (TagOpen "script" _) = True
isVerbTag _ = False 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 :: PandocMonad m => MarkdownParser m (F Blocks)
rawTeXBlock = do rawTeXBlock = do
guardEnabled Ext_raw_tex guardEnabled Ext_raw_tex