summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnMacFarlane <>2017-08-18 18:52:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2017-08-18 18:52:00 (GMT)
commitd833b4daba0e11679379c5fd079c79eaf333a611 (patch)
treed62595ad707d15622d9dc66ba97d6ad007d6c794
parent93627b2511edb335ef167bae05c20f0b0a957a57 (diff)
version 0.11.10.11.1
-rw-r--r--changelog6
-rw-r--r--pandoc-citeproc.cabal2
-rw-r--r--src/Text/CSL/Exception.hs4
-rw-r--r--src/Text/CSL/Pandoc.hs7
4 files changed, 15 insertions, 4 deletions
diff --git a/changelog b/changelog
index b9073b7..74f9071 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,9 @@
+pandoc-citeproc (0.11.1)
+
+ * Don't produce ??? with empty suppress-author citation (#156).
+ * Added Typeable, Data instances for CiteprocException. This
+ is needed for some older ghc versions.
+
pandoc-citeproc (0.11)
* Add Text.CSL.Exception module exporting CiteprocException [API change].
diff --git a/pandoc-citeproc.cabal b/pandoc-citeproc.cabal
index a2d50c9..5147e10 100644
--- a/pandoc-citeproc.cabal
+++ b/pandoc-citeproc.cabal
@@ -1,5 +1,5 @@
name: pandoc-citeproc
-version: 0.11
+version: 0.11.1
cabal-version: >= 1.12
synopsis: Supports using pandoc with citeproc
diff --git a/src/Text/CSL/Exception.hs b/src/Text/CSL/Exception.hs
index bb433f8..4faadd6 100644
--- a/src/Text/CSL/Exception.hs
+++ b/src/Text/CSL/Exception.hs
@@ -1,6 +1,8 @@
{-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE DeriveDataTypeable #-}
module Text.CSL.Exception (CiteprocException(..)) where
import Control.Exception (Exception)
+import Data.Data
data CiteprocException =
ErrorParsingReferences String
@@ -11,7 +13,7 @@ data CiteprocException =
| ErrorSplittingDate
| MacroNotFound String
| DependentStyleHasItselfAsParent String
- deriving Show
+ deriving (Show, Data, Typeable)
instance Exception CiteprocException
diff --git a/src/Text/CSL/Pandoc.hs b/src/Text/CSL/Pandoc.hs
index 5f00b47..72b360d 100644
--- a/src/Text/CSL/Pandoc.hs
+++ b/src/Text/CSL/Pandoc.hs
@@ -239,8 +239,11 @@ decodeEntities (x:xs) = x : decodeEntities xs
processCite :: Style -> M.Map [Citation] Formatted -> Inline -> Inline
processCite s cs (Cite t _) =
case M.lookup t cs of
- Just (Formatted (x:xs)) -> Cite t (renderPandoc s (Formatted (x:xs)))
- _ -> Strong [Str "???"] -- TODO raise error instead?
+ Just (Formatted xs)
+ | not (null xs) || all isSuppressAuthor t
+ -> Cite t (renderPandoc s (Formatted xs))
+ _ -> Strong [Str "???"] -- TODO raise error instead?
+ where isSuppressAuthor c = citationMode c == SuppressAuthor
processCite _ _ x = x
isNote :: Inline -> Bool