summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-03-02 09:33:18 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2018-03-02 09:33:18 -0800
commitadefd86cd4c2273e9bf5fefe136c1aff1b13151a (patch)
treeedbb4c9ca5660c056271d85599e4ba87adeb6ad2
parent991b57733c508634d6093e2aeb2ffb3feec13c42 (diff)
LaTeX reader: Fix regression in package options including underscore.
Closes #4424.
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs2
-rw-r--r--test/command/4424.md10
2 files changed, 11 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 7ca1cb5a5..57d2803ba 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -1162,7 +1162,7 @@ singleChar = try $ do
else return $ Tok pos toktype t
opt :: PandocMonad m => LP m Inlines
-opt = bracketed inline
+opt = bracketed inline <|> (str . T.unpack <$> rawopt)
rawopt :: PandocMonad m => LP m Text
rawopt = do
diff --git a/test/command/4424.md b/test/command/4424.md
new file mode 100644
index 000000000..b0b95510b
--- /dev/null
+++ b/test/command/4424.md
@@ -0,0 +1,10 @@
+```
+% pandoc -f latex -t native
+\documentclass{article}
+\usepackage[sortlocale=en_GB]{biblatex}
+\begin{document}
+Test
+\end{document}
+^D
+[Para [Str "Test"]]
+```