packages feed

pandoc-citeproc 0.14.1.1 → 0.14.1.2

raw patch · 3 files changed

+18/−11 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

changelog view
@@ -1,3 +1,10 @@+pandoc-citeproc (0.14.1.2)++  * Fix regression in JSON output for date-parts (#321).+    Previous versions of represented dates as:+    `"issued": {"date-parts": [[2006]]}`.  pandoc-citeproc 0.14+    did instead: `"issued": [{"date-parts": [2006]}]`.+ pandoc-citeproc (0.14.1.1)    * Fix regression in movement of punctuation inside quotes before note.
pandoc-citeproc.cabal view
@@ -1,5 +1,5 @@ name:               pandoc-citeproc-version:            0.14.1.1+version:            0.14.1.2 cabal-version:      >= 1.12 synopsis:           Supports using pandoc with citeproc 
src/Text/CSL/Reference.hs view
@@ -56,7 +56,7 @@ where  import           Control.Applicative ((<|>))-import           Control.Monad       (guard, mplus)+import           Control.Monad       (guard, mplus, msum) import           Data.Aeson          hiding (Value) import qualified Data.Aeson          as Aeson import           Data.Aeson.Types    (Parser)@@ -258,20 +258,20 @@  instance OVERLAPS          ToJSON [RefDate] where-  toJSON [] = Array V.empty-  toJSON xs = toJSON $ map toJSONDate xs+  toJSON = toJSONDate -toJSONDate :: RefDate -> Aeson.Value-toJSONDate rd = object' $-  [ "date-parts" .= dateparts | not (emptyDatePart dateparts) ] ++-  ["circa" .= (1 :: Int) | circa rd] ++-  (case season rd of+toJSONDate :: [RefDate] -> Aeson.Value+toJSONDate [] = Array V.empty+toJSONDate ds = object' $+  [ "date-parts" .= dateparts | not (null dateparts) ] +++  ["circa" .= (1 :: Int) | any circa ds] +++  (case msum (map season ds) of         Just (RawSeason s) -> ["season" .= s]         _                  -> []) ++-  (case other rd of+  (case mconcat (map other ds) of         Literal l | not (null l) -> ["literal" .= l]         _                        -> [])-  where dateparts = toDatePart rd+  where dateparts = filter (not . emptyDatePart) $ map toDatePart ds         emptyDatePart [] = True         emptyDatePart xs = all (== 0) xs