packages feed

citeproc 0.1.0.2 → 0.1.0.3

raw patch · 4 files changed

+24/−9 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,5 +1,13 @@ # citeproc changelog +## 0.1.0.3++  * Better handling of author-only/suppress-author.+    Previously all results of "names" elements were treated+    as authors.  But only the first should be (generally this+    is the author, but it could be the editor of an edited+    volume with no author).  See jgm/pandoc#6765.+ ## 0.1.0.2    * Don't enclose contents of e:choose in a Formatted element (#19).
citeproc.cabal view
@@ -1,6 +1,6 @@ cabal-version:       2.2 name:                citeproc-version:             0.1.0.2+version:             0.1.0.3 synopsis:            Generates citations and bibliography from CSL styles. description:         citeproc parses CSL style files and uses them to                      generate a list of formatted citations and bibliography
man/citeproc.1 view
@@ -1,6 +1,6 @@-.\" Automatically generated by Pandoc 2.11.0.1+.\" Automatically generated by Pandoc 2.11.0.2 .\"-.TH "citeproc" "1" "" "citeproc 0.1.0.2" ""+.TH "citeproc" "1" "" "citeproc 0.1.0.3" "" .hy .SH NAME .PP
src/Citeproc/Eval.hs view
@@ -213,9 +213,14 @@                        (layoutCollapse layoutOpts))                       cs +      let removeIfEqual x y+           | x == y    = NullOutput+           | otherwise = y       let removeNamesIfSuppressAuthor            (Tagged (TagItem SuppressAuthor cid') x)-             = Tagged (TagItem SuppressAuthor cid') (transform removeNames x)+             = let y = getAuthors x+                in Tagged (TagItem SuppressAuthor cid')+                     (transform (removeIfEqual y) x)           removeNamesIfSuppressAuthor x = x        -- we need to do this after disambiguation and collapsing@@ -1011,7 +1016,7 @@                                                   (citationItemId item)) x)         . formatted mempty         . (if citationItemType item == AuthorOnly-              then filter isNames . concatMap universe+              then map getAuthors               else id)         . (case citationItemPrefix item of              Just t | isNote@@ -1029,10 +1034,12 @@         $ xs  -isNames :: Output a -> Bool-isNames (Tagged TagNames{} _) = True-isNames _ = False-+-- | The first-occurring element tagged as Names will be+-- treated as the "author"; generally that is the author+-- but it might be the editor if it's an edited volume.+getAuthors :: Output a -> Output a+getAuthors x =+  headDef NullOutput [y | y@(Tagged TagNames{} _) <- universe x]  removeNames :: Output a -> Output a removeNames (Tagged TagNames{} _) = NullOutput