diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-02-22 21:15:25 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-02-22 21:15:25 +0100 |
commit | f4a452f89174828fea77614a4b6a067fc4675ba5 (patch) | |
tree | 948773b229c2eb609a8341d9fb42d59127f92bfb /src | |
parent | e51b32a475ac9f1633ac996121df7a6c10e05283 (diff) | |
download | pandoc-f4a452f89174828fea77614a4b6a067fc4675ba5.tar.gz |
When parsing raw LaTeX commands, include trailing space.
Otherwise things like `\noindent foo` break and turn into
`\noindentfoo`.
Affects `-f latex+raw_tex` and `-f markdown` (and other formats
that allow `raw_tex`).
Closes #1773.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 9f9a79535..fbbdc1873 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -435,7 +435,7 @@ section (ident, classes, kvs) lvl = do inlineCommand :: PandocMonad m => LP m Inlines inlineCommand = try $ do - name <- anyControlSeq + (name, raw') <- withRaw anyControlSeq guard $ name /= "begin" && name /= "end" guard $ not $ isBlockCommand name exts <- getOption readerExtensions @@ -444,7 +444,7 @@ inlineCommand = try $ do let raw = do rawargs <- withRaw (skipangles *> skipopts *> option "" dimenarg *> many braced) - let rawcommand = '\\' : name ++ star ++ snd rawargs + let rawcommand = raw' ++ star ++ snd rawargs transformed <- applyMacros' rawcommand if transformed /= rawcommand then parseFromString inlines transformed |