From cae52ecc315a0635f81cb2547b4f268ec8a8befa Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 17 Mar 2013 08:48:29 -0700 Subject: Revert "LaTeX reader: citation handling changes." This reverts commit f7229b147314042f946dfded3b441ab0fae260a0. --- src/Text/Pandoc/Readers/LaTeX.hs | 11 +++-------- src/Text/Pandoc/Writers/Markdown.hs | 3 +-- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 880997a6d..5a2ab599b 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -1021,10 +1021,7 @@ cites mode multi = try $ do citation :: String -> CitationMode -> Bool -> LP Inlines citation name mode multi = do (c,raw) <- withRaw $ cites mode multi - refs <- getOption readerReferences - return $ if null refs - then rawInline "latex" $ "\\" ++ name ++ raw - else cite c mempty + return $ cite c (rawInline "latex" $ "\\" ++ name ++ raw) complexNatbibCitation :: CitationMode -> LP Inlines complexNatbibCitation mode = try $ do @@ -1043,10 +1040,8 @@ complexNatbibCitation mode = try $ do optional $ char ';' return $ addPrefix pref $ addSuffix suff $ cits' (c:cits, raw) <- withRaw $ grouped parseOne - refs <- getOption readerReferences - return $ if null refs - then rawInline "latex" $ "\\citetext" ++ raw - else cite (c{ citationMode = mode}:cits) mempty + return $ cite (c{ citationMode = mode }:cits) + (rawInline "latex" $ "\\citetext" ++ raw) -- tables diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 876485552..b496c8011 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -644,8 +644,7 @@ inlineToMarkdown opts (LineBreak) | otherwise = return $ " " <> cr inlineToMarkdown _ Space = return space inlineToMarkdown opts (Cite (c:cs) lst) - | not (null lst) = inlineListToMarkdown opts lst - -- if lst is null, citeproc wasn't run; print a pandoc markdown citation + | not (isEnabled Ext_citations opts) = inlineListToMarkdown opts lst | citationMode c == AuthorInText = do suffs <- inlineListToMarkdown opts $ citationSuffix c rest <- mapM convertOne cs -- cgit v1.2.3