From 18745585c1300cb5a900f06c854068961fa38d3e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 31 Jan 2016 10:52:46 -0800 Subject: LaTeX reader: `inlineCommand` now gobbles an empty `{}` after any command. This gives better results when people write e.g. `\TeX{}` in Markdown. \TeX{} and \LaTeX{} now works as expected with `pandoc -f markdown -t latex`. Closes #2687. --- src/Text/Pandoc/Readers/LaTeX.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Text/Pandoc/Readers') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 2acce8ece..9a1708331 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -422,7 +422,8 @@ inlineCommand = try $ do else if parseRaw then return $ rawInline "latex" rawcommand else return mempty - lookupListDefault mzero [name',name] inlineCommands + (lookupListDefault mzero [name',name] inlineCommands <* + optional (try (string "{}"))) <|> raw unlessParseRaw :: LP () -- cgit v1.2.3