git.iko.soy/typeable/pandoc
on master help sign in
Improve LaTeX option parsing...

in cases where we run into trouble parsing inlines til the closing `]`, e.g. quotes, we return a plain string with the option contents. Previously we mistakenly included the brackets in this string. Closes #6869.

commit9a4097640f052468054105cde8ef342ac8a1db30 authorJohn MacFarlane <jgm@berkeley.edu> dateFri 20 Nov 2020, 13:39 (6 years ago) parent797db8d
2 files changed+9−1
src/Text/Pandoc/Readers/LaTeX.hs+3−1 test/command/6869.md+6
src/Text/Pandoc/Readers/LaTeX.hs+3−1
@@ -559,7 +559,9 @@ tok = try $ spaces >> grouped inline <|> inlineCommand' <|> singleChar'
559559 return $ str t
560560
561561opt :: PandocMonad m => LP m Inlines
562−opt = bracketed inline <|> (str <$> rawopt)
562+opt = bracketed inline
563+ <|>
564+ (str . T.dropWhile (=='[') . T.dropWhileEnd (==']') <$> rawopt)
563565
564566paropt :: PandocMonad m => LP m Inlines
565567paropt = parenWrapped inline
test/command/6869.mdnew file+6
@@ -0,0 +1,6 @@
1+```
2+% pandoc -f latex -t native
3+\cite[„Aber“]{key}
4+^D
5+[Para [Cite [Citation {citationId = "key", citationPrefix = [], citationSuffix = [Str "\8222Aber\8220"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [RawInline (Format "latex") "\\cite[\8222Aber\8220]{key}"]]]
6+```