diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-01-31 10:52:46 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-01-31 10:52:46 -0800 |
commit | 18745585c1300cb5a900f06c854068961fa38d3e (patch) | |
tree | 8ea9df0a9326e78528d491c387ed3b09216c719a /src | |
parent | a02c26d9f46aceda695bd357cdcd85d705aaf14c (diff) | |
download | pandoc-18745585c1300cb5a900f06c854068961fa38d3e.tar.gz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 3 |
1 files changed, 2 insertions, 1 deletions
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 () |