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.
commit18745585c1300cb5a900f06c854068961fa38d3e
authorJohn MacFarlane <jgm@berkeley.edu>
dateSun 31 Jan 2016, 10:52 (11 years ago)
parenta02c26d
src/Text/Pandoc/Readers/LaTeX.hs+2−1
@@ -422,7 +422,8 @@ inlineCommand = try $ do
422422 else if parseRaw
423423 then return $ rawInline "latex" rawcommand
424424 else return mempty
425− lookupListDefault mzero [name',name] inlineCommands
425+ (lookupListDefault mzero [name',name] inlineCommands <*
426+ optional (try (string "{}")))
426427 <|> raw
427428
428429unlessParseRaw :: LP ()