aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/LaTeX.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-10-09 14:39:42 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-10-09 14:39:42 -0700
commit114103d67fcb100dda8edde45fa3eee680cdd678 (patch)
tree5deb6b673716210aae28b7c12339da7229421de9 /src/Text/Pandoc/Readers/LaTeX.hs
parent8944ccdaca411840ff2418e6d56350308da1badd (diff)
downloadpandoc-114103d67fcb100dda8edde45fa3eee680cdd678.tar.gz
LaTeX reader: don't eat excess whitespace after macros.
Really close #2446.
Diffstat (limited to 'src/Text/Pandoc/Readers/LaTeX.hs')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 6efa64ec8..0e144dd0d 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -234,8 +234,8 @@ blocks = mconcat <$> many block
getRawCommand :: String -> LP String
getRawCommand name' = do
- rawargs <- withRaw (opt `sepBy` (optional sp) *>
- option "" (optional sp *> dimenarg) *>
+ rawargs <- withRaw (many (try (optional sp *> opt)) *>
+ option "" (try (optional sp *> dimenarg)) *>
many braced)
return $ '\\' : name' ++ snd rawargs
@@ -818,10 +818,10 @@ tok :: LP Inlines
tok = try $ grouped inline <|> inlineCommand <|> str <$> count 1 inlineChar
opt :: LP Inlines
-opt = bracketed inline <* optional sp
+opt = bracketed inline
skipopts :: LP ()
-skipopts = skipMany opt
+skipopts = skipMany (opt *> optional sp)
inlineText :: LP Inlines
inlineText = str <$> many1 inlineChar