aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-01-13 22:12:32 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2018-01-13 22:12:32 -0800
commite7d95cadf537909bcb1e7d17d4545932d6bb34bc (patch)
tree30e2fd0f5f116f252d68b894f073a96b779a75ea /src/Text
parent485535464df27f5c2e2dd144650af318bde239c1 (diff)
downloadpandoc-e7d95cadf537909bcb1e7d17d4545932d6bb34bc.tar.gz
LaTeX reader: pass through macro defs in rawLaTeXBlock...
even if the `latex_macros` extension is set. This reverts to earlier behavior and is probably safer on the whole, since some macros only modify things in included packages, which pandoc's macro expansion can't modify. Closes #4246.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index d3f730259..0a78fbe53 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -272,10 +272,8 @@ rawLaTeXBlock = do
lookAhead (try (char '\\' >> letter))
-- we don't want to apply newly defined latex macros to their own
-- definitions:
- (do (_, raw) <- rawLaTeXParser macroDef
- (guardDisabled Ext_latex_macros >> return raw) <|> return "")
- <|> (do (_, raw) <- rawLaTeXParser (environment <|> blockCommand)
- applyMacros raw)
+ (snd <$> rawLaTeXParser macroDef)
+ <|> ((snd <$> rawLaTeXParser (environment <|> blockCommand)) >>= applyMacros)
rawLaTeXInline :: (PandocMonad m, HasMacros s, HasReaderOptions s)
=> ParserT String s m String