git.iko.soy/typeable/pandoc
on master help sign in
Properly support optional cite argument for `\blockquote`.

(LaTeX reader) Closes #6802.

commit8f75a535429abdd8bd089f83a04a783baa60ce31 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 3 Nov 2020, 10:25 (6 years ago) parentb9d1137
2 files changed+17−7
src/Text/Pandoc/Readers/LaTeX.hs+8−7 test/command/6802.md+9
src/Text/Pandoc/Readers/LaTeX.hs+8−7
@@ -309,18 +309,19 @@ enquote starred mblang = do
309309 else doubleQuoted . langspan <$> withQuoteContext InDoubleQuote tok
310310
311311blockquote :: PandocMonad m => Bool -> Maybe Text -> LP m Blocks
312−blockquote citations mblang = do
313− citePar <- if citations
314− then do
315− cs <- cites NormalCitation False
316− return $ para (cite cs mempty)
317− else return mempty
312+blockquote cvariant mblang = do
313+ citepar <- if cvariant
314+ then (\xs -> para (cite xs mempty))
315+ <$> cites NormalCitation False
316+ else option mempty $ para <$> bracketed inline
318317 let lang = mblang >>= babelLangToBCP47
319318 let langdiv = case lang of
320319 Nothing -> id
321320 Just l -> divWith ("",[],[("lang", renderLang l)])
321+ _closingPunct <- option mempty $ bracketed inline -- currently ignored
322322 bs <- grouped block
323− return $ blockQuote . langdiv $ (bs <> citePar)
323+ optional $ symbolIn (".:;?!" :: [Char]) -- currently ignored
324+ return $ blockQuote . langdiv $ (bs <> citepar)
324325
325326doAcronym :: PandocMonad m => Text -> LP m Inlines
326327doAcronym form = do
test/command/6802.mdnew file+9
@@ -0,0 +1,9 @@
1+```
2+% pandoc -f latex -t native
3+\blockquote[test][]{quote}
4+^D
5+[BlockQuote
6+ [Para [Str "quote"]
7+ ,Para [Str "test"]]]
8+
9+```