diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-11-03 10:25:56 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-11-03 10:25:56 -0800 |
commit | 8f75a535429abdd8bd089f83a04a783baa60ce31 (patch) | |
tree | 3b9fb5f874b00b60ce9a75ad432a306bc7fe7966 /src | |
parent | b9d11379df402e1a931e2400bc350b4598fcda87 (diff) | |
download | pandoc-8f75a535429abdd8bd089f83a04a783baa60ce31.tar.gz |
Properly support optional cite argument for `\blockquote`.
(LaTeX reader)
Closes #6802.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 8e73af4ae..5e46caedb 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -309,18 +309,19 @@ enquote starred mblang = do else doubleQuoted . langspan <$> withQuoteContext InDoubleQuote tok blockquote :: PandocMonad m => Bool -> Maybe Text -> LP m Blocks -blockquote citations mblang = do - citePar <- if citations - then do - cs <- cites NormalCitation False - return $ para (cite cs mempty) - else return mempty +blockquote cvariant mblang = do + citepar <- if cvariant + then (\xs -> para (cite xs mempty)) + <$> cites NormalCitation False + else option mempty $ para <$> bracketed inline let lang = mblang >>= babelLangToBCP47 let langdiv = case lang of Nothing -> id Just l -> divWith ("",[],[("lang", renderLang l)]) + _closingPunct <- option mempty $ bracketed inline -- currently ignored bs <- grouped block - return $ blockQuote . langdiv $ (bs <> citePar) + optional $ symbolIn (".:;?!" :: [Char]) -- currently ignored + return $ blockQuote . langdiv $ (bs <> citepar) doAcronym :: PandocMonad m => Text -> LP m Inlines doAcronym form = do |