citeproc 0.3.0.1 → 0.3.0.2
raw patch · 10 files changed
+764/−37 lines, 10 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +8/−0
- app/Main.hs +5/−5
- citeproc.cabal +1/−1
- man/citeproc.1 +2/−2
- src/Citeproc.hs +4/−4
- src/Citeproc/CslJson.hs +2/−1
- src/Citeproc/Eval.hs +13/−15
- src/Citeproc/Types.hs +3/−3
- test/Spec.hs +5/−6
- test/extra/issue38.txt +721/−0
CHANGELOG.md view
@@ -1,5 +1,13 @@ # citeproc changelog +## 0.3.0.2++ * Don't use cite-group delimiter if ANY citation in group has+ locator (#38). This seems to be citeproc.js's behavior and it gives+ better results for chicago-author-date: we want both+ `[@foo20; @foo21, p. 3]` and `[@foo20, p. 3; @foo21]` to produce+ a semicolon separator, rather than a comma.+ ## 0.3.0.1 * Better handle `initialize-with` that ends in a nonbreaking space.
app/Main.hs view
@@ -6,6 +6,7 @@ import Citeproc.CslJson import Control.Monad (when, unless) import Control.Applicative ((<|>))+import Data.Bifunctor (second) import Data.Maybe (fromMaybe) import Data.Text (Text) import qualified Data.Text as T@@ -29,10 +30,10 @@ let opt = foldr ($) defaultOpt opts when (optHelp opt) $ do putStr $ usageInfo "citeproc [OPTIONS] [FILE]" options- exitWith ExitSuccess+ exitSuccess when (optVersion opt) $ do putStrLn $ "citeproc version " <> VERSION_citeproc- exitWith ExitSuccess+ exitSuccess format <- case optFormat opt of Just "html" -> return Html Just "json" -> return Json@@ -90,9 +91,8 @@ map (cslJsonToJson locale) (resultCitations result)) , ("bibliography", Aeson.toJSON $- map (\(id',ent) ->- (id', cslJsonToJson locale ent))- (resultBibliography result))+ map (second $ cslJsonToJson locale)+ (resultBibliography result)) , ("warnings", Aeson.toJSON $ resultWarnings result) ] Html -> Aeson.toJSON result
citeproc.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: citeproc-version: 0.3.0.1+version: 0.3.0.2 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.3+.\" Automatically generated by Pandoc 2.11.3.1 .\"-.TH "citeproc" "1" "" "citeproc 0.3.0.1" ""+.TH "citeproc" "1" "" "citeproc 0.3.0.2" "" .hy .SH NAME .PP
src/Citeproc.hs view
@@ -9,6 +9,7 @@ , citeproc , Result(..) ) where+import Data.Bifunctor (second) import qualified Data.Text as T import qualified Data.Set as Set import Citeproc.Types@@ -34,10 +35,9 @@ , resultWarnings = warnings ++ noPrintedFormWarnings } where rCitations = map (trimR . movePunct . renderOutput opts) citationOs- rBibliography = map (\(ident, out) ->- (ident, trimR . movePunct .- renderOutput opts{ linkCitations = False } $ out))- bibliographyOs+ rBibliography = map (second (trimR . movePunct .+ renderOutput opts{ linkCitations = False }))+ bibliographyOs locale = mergeLocales mblang style trimR = dropTextWhileEnd (== ' ') movePunct = case localePunctuationInQuote locale of
src/Citeproc/CslJson.hs view
@@ -37,6 +37,7 @@ import Data.Maybe (fromMaybe) import qualified Data.Text as T import qualified Data.Map as M+import Data.Foldable (fold) import Data.Functor.Identity import Data.Attoparsec.Text as P import Data.Aeson (FromJSON(..), ToJSON(..), Value(..), object)@@ -100,7 +101,7 @@ biplate = plateSelf instance CiteprocOutput (CslJson Text) where- toText = foldMap id+ toText = fold fromText = parseCslJson mempty dropTextWhile = dropTextWhile' dropTextWhileEnd = dropTextWhileEnd'
src/Citeproc/Eval.hs view
@@ -726,6 +726,7 @@ noCollapse = ws == y:ys noYearSuffixCollapse = ws == ys' hasLocator u = not $ null [x | x@(Tagged TagLocator _) <- universe u]+ anyHasLocator = any hasLocator ws -- https://github.com/citation-style-language/test-suite/issues/36 : flippedAfterCollapseDelim = collapseType == CollapseYear addCGDelim u [] = [u]@@ -733,7 +734,7 @@ Formatted mempty{ formatSuffix = if noCollapse || noYearSuffixCollapse && not (flippedAfterCollapseDelim &&- hasLocator u)+ anyHasLocator) then Just citeGroupDelim else afterCollapseDelim <|> formatDelimiter f } [u] : us@@ -1043,7 +1044,7 @@ else id) . (case citationItemPrefix item of Just t | isNote- , ". " `T.isSuffixOf` (toText t)+ , ". " `T.isSuffixOf` toText t , T.count " " (toText t) > 1 -- exclude single word -> capitalizeInitialTerm _ -> id)@@ -1336,7 +1337,7 @@ Tagged TagCitationLabel $ grouped $ Literal (fromText t)- : maybe [] (:[]) mbsuff+ : maybeToList mbsuff Just (FancyVal x) -> return $ Tagged TagCitationLabel $ grouped $@@ -1455,7 +1456,7 @@ ("locator", Just loc, Just lab) -> getTerm lab (TextVal loc) ("locator", Just loc, Nothing) | beginsWithSpace loc -> return NullOutput- | ". " `T.isPrefixOf` (T.dropWhile isLetter loc)+ | ". " `T.isPrefixOf` T.dropWhile isLetter loc -> return NullOutput | otherwise -> getTerm "page" (TextVal loc) ("page", Just loc, _) ->@@ -1470,7 +1471,7 @@ | "." `T.isPrefixOf` suff -> case term' of Literal x- | "." `T.isSuffixOf` (toText x)+ | "." `T.isSuffixOf` toText x , not (formatStripPeriods formatting) -> formatted formatting{ formatSuffix =@@ -1848,15 +1849,12 @@ _ -> "" PrecedesAlways -> delim PrecedesNever -> ""- let andPreSpace =- if T.null beforeLastDelim- then case formatSuffix formatting of- Just t | endsWithSpace t -> ""- _ -> " "- else- if endsWithSpace beforeLastDelim- then ""- else " "+ let andPreSpace = case beforeLastDelim of+ "" -> case formatSuffix formatting of+ Just t | endsWithSpace t -> ""+ _ -> " "+ t | endsWithSpace t -> ""+ _ -> " " let andPostSpace = case formatPrefix formatting of Just t | beginsWithSpace t -> "" _ -> " "@@ -1930,7 +1928,7 @@ formatName nameFormat formatting order name = do disamb <- gets (referenceDisambiguation . stateReference) let nameFormat' =- case disambNameMap <$> disamb >>= M.lookup name of+ case M.lookup name . disambNameMap =<< disamb of Nothing -> nameFormat Just AddInitials -> nameFormat{ nameForm = LongName }
src/Citeproc/Types.hs view
@@ -109,7 +109,7 @@ import qualified Data.Scientific as S import qualified Data.CaseInsensitive as CI import Control.Monad (foldM, guard, mzero)-import Control.Applicative ((<|>))+import Control.Applicative ((<|>), optional) import Data.Char (isLower, isDigit, isLetter, isSpace) import Data.Text (Text) import qualified Data.Text as T@@ -253,7 +253,7 @@ parseJSON = withObject "CitationItem" $ \v -> CitationItem <$> (v .: "id" >>= fmap ItemId . asText) <*> v .:? "label"- <*> (Just <$> (v .: "locator" >>= asText) <|> pure Nothing)+ <*> optional (v .: "locator" >>= asText) <*> ( (v .: "type") <|> (do suppressAuth <- v .:? "suppress-author" authorOnly <- v .:? "author-only"@@ -922,7 +922,7 @@ = case variableType k of NameVariable -> (k, Array- (V.fromList [String t | (k',t) <- ((k,v):kvs), k' == k])) :+ (V.fromList [String t | (k',t) <- (k,v):kvs, k' == k])) : consolidateNameVariables (filter ((/= k) . fst) kvs) _ -> (k, String v) : consolidateNameVariables kvs
test/Spec.hs view
@@ -13,7 +13,6 @@ import System.Environment (getArgs) import System.Exit import System.Directory (getDirectoryContents, doesFileExist)-import Data.Char (isDigit) import Data.Text (Text) import qualified Data.Set as Set import qualified Text.PrettyPrint as Pretty@@ -21,7 +20,7 @@ import qualified Data.Text.IO as TIO import Data.List (foldl', isInfixOf, intersperse, sortOn, sort) import Data.Containers.ListUtils (nubOrdOn)-import Data.Char (isLetter, toLower)+import Data.Char (isDigit, isLetter, toLower) import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as B import qualified Data.ByteString.Lazy as L@@ -88,7 +87,7 @@ case skipReason test of Just reason -> doSkip reason Nothing ->- case parseStyle (\_ -> Nothing) (decodeUtf8 $ csl test) of+ case parseStyle (const Nothing) (decodeUtf8 $ csl test) of Nothing -> doError $ CiteprocParseError "Could not fetch independent parent" Just (Left err) -> doError err@@ -259,7 +258,7 @@ takeExtension x == ".txt" && case args of [] -> True- _ -> any (\arg -> map toLower arg `isInfixOf` (map toLower x)) args+ _ -> any (\arg -> map toLower arg `isInfixOf` map toLower x) args overrides <- if any ('/' `elem`) args then return [] else filter matchesPattern <$>@@ -318,10 +317,10 @@ (length (errored counts)) (length (skipped counts)) case length (failed counts) + length (errored counts) of- 0 -> exitWith ExitSuccess+ 0 -> exitSuccess n | n <= 63 -> do putStrLn "We have passed all the CSL tests we expect to..."- exitWith ExitSuccess+ exitSuccess | otherwise -> exitWith $ ExitFailure n data Counts =
+ test/extra/issue38.txt view
@@ -0,0 +1,721 @@+>>===== MODE =====>>+citation+<<===== MODE =====<<+++++>>===== RESULT =====>>+(Díaz-León 2016; 2015, 333)+(Díaz-León 2016, 333; 2015)+<<===== RESULT =====<<+++>>===== CSL =====>>++<?xml version="1.0" encoding="utf-8"?>+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="display-and-sort" page-range-format="chicago">+ <info>+ <title>Chicago Manual of Style 17th edition (author-date)</title>+ <id>http://www.zotero.org/styles/chicago-author-date</id>+ <link href="http://www.zotero.org/styles/chicago-author-date" rel="self"/>+ <link href="http://www.chicagomanualofstyle.org/tools_citationguide.html" rel="documentation"/>+ <author>+ <name>Julian Onions</name>+ <email>julian.onions@gmail.com</email>+ </author>+ <contributor>+ <name>Sebastian Karcher</name>+ </contributor>+ <contributor>+ <name>Richard Karnesky</name>+ <email>karnesky+zotero@gmail.com</email>+ <uri>http://arc.nucapt.northwestern.edu/Richard_Karnesky</uri>+ </contributor>+ <contributor>+ <name>Andrew Dunning</name>+ <email>andrew.dunning@utoronto.ca</email>+ <uri>https://orcid.org/0000-0003-0464-5036</uri>+ </contributor>+ <contributor>+ <name>Matthew Roth</name>+ <email>matthew.g.roth@yale.edu</email>+ <uri> https://orcid.org/0000-0001-7902-6331</uri>+ </contributor>+ <category citation-format="author-date"/>+ <category field="generic-base"/>+ <summary>The author-date variant of the Chicago style</summary>+ <updated>2018-01-24T12:00:00+00:00</updated>+ <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>+ </info>+ <locale xml:lang="en">+ <terms>+ <term name="editor" form="verb-short">ed.</term>+ <term name="container-author" form="verb">by</term>+ <term name="translator" form="verb-short">trans.</term>+ <term name="editortranslator" form="verb">edited and translated by</term>+ <term name="translator" form="short">trans.</term>+ </terms>+ </locale>+ <macro name="secondary-contributors">+ <choose>+ <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="none">+ <group delimiter=". ">+ <names variable="editor translator" delimiter=". ">+ <label form="verb" text-case="capitalize-first" suffix=" "/>+ <name and="text" delimiter=", "/>+ </names>+ <names variable="director" delimiter=". ">+ <label form="verb" text-case="capitalize-first" suffix=" "/>+ <name and="text" delimiter=", "/>+ </names>+ </group>+ </if>+ </choose>+ </macro>+ <macro name="container-contributors">+ <choose>+ <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">+ <group prefix=", " delimiter=", ">+ <names variable="container-author" delimiter=", ">+ <label form="verb" suffix=" "/>+ <name and="text" delimiter=", "/>+ </names>+ <names variable="editor translator" delimiter=", ">+ <label form="verb" suffix=" "/>+ <name and="text" delimiter=", "/>+ </names>+ </group>+ </if>+ </choose>+ </macro>+ <macro name="editor">+ <names variable="editor">+ <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>+ <label form="short" prefix=", "/>+ </names>+ </macro>+ <macro name="translator">+ <names variable="translator">+ <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>+ <label form="short" prefix=", "/>+ </names>+ </macro>+ <macro name="recipient">+ <choose>+ <if type="personal_communication">+ <choose>+ <if variable="genre">+ <text variable="genre" text-case="capitalize-first"/>+ </if>+ <else>+ <text term="letter" text-case="capitalize-first"/>+ </else>+ </choose>+ </if>+ </choose>+ <names variable="recipient" delimiter=", ">+ <label form="verb" prefix=" " text-case="lowercase" suffix=" "/>+ <name and="text" delimiter=", "/>+ </names>+ </macro>+ <macro name="substitute-title">+ <choose>+ <if type="article-magazine article-newspaper review review-book" match="any">+ <text macro="container-title"/>+ </if>+ </choose>+ </macro>+ <macro name="contributors">+ <group delimiter=". ">+ <names variable="author">+ <name and="text" name-as-sort-order="first" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>+ <label form="short" prefix=", "/>+ <substitute>+ <names variable="editor"/>+ <names variable="translator"/>+ <names variable="director"/>+ <text macro="substitute-title"/>+ <text macro="title"/>+ </substitute>+ </names>+ <text macro="recipient"/>+ </group>+ </macro>+ <macro name="contributors-short">+ <names variable="author">+ <name form="short" and="text" delimiter=", " initialize-with=". "/>+ <substitute>+ <names variable="editor"/>+ <names variable="translator"/>+ <names variable="director"/>+ <text macro="substitute-title"/>+ <text macro="title"/>+ </substitute>+ </names>+ </macro>+ <macro name="interviewer">+ <names variable="interviewer" delimiter=", ">+ <label form="verb" prefix=" " text-case="capitalize-first" suffix=" "/>+ <name and="text" delimiter=", "/>+ </names>+ </macro>+ <macro name="archive">+ <group delimiter=". ">+ <text variable="archive_location" text-case="capitalize-first"/>+ <text variable="archive"/>+ <text variable="archive-place"/>+ </group>+ </macro>+ <macro name="access">+ <group delimiter=". ">+ <choose>+ <if type="graphic report" match="any">+ <text macro="archive"/>+ </if>+ <else-if type="article-journal bill book chapter legal_case legislation motion_picture paper-conference" match="none">+ <text macro="archive"/>+ </else-if>+ </choose>+ <choose>+ <if type="webpage post-weblog" match="any">+ <date variable="issued" form="text"/>+ </if>+ </choose>+ <choose>+ <if variable="issued" match="none">+ <group delimiter=" ">+ <text term="accessed" text-case="capitalize-first"/>+ <date variable="accessed" form="text"/>+ </group>+ </if>+ </choose>+ <choose>+ <if type="legal_case" match="none">+ <choose>+ <if variable="DOI">+ <text variable="DOI" prefix="https://doi.org/"/>+ </if>+ <else>+ <text variable="URL"/>+ </else>+ </choose>+ </if>+ </choose>+ </group>+ </macro>+ <macro name="title">+ <choose>+ <if variable="title" match="none">+ <choose>+ <if type="personal_communication" match="none">+ <text variable="genre" text-case="capitalize-first"/>+ </if>+ </choose>+ </if>+ <else-if type="bill book graphic legislation motion_picture song" match="any">+ <text variable="title" text-case="title" font-style="italic"/>+ <group prefix=" (" suffix=")" delimiter=" ">+ <text term="version"/>+ <text variable="version"/>+ </group>+ </else-if>+ <else-if variable="reviewed-author">+ <choose>+ <if variable="reviewed-title">+ <group delimiter=". ">+ <text variable="title" text-case="title" quotes="true"/>+ <group delimiter=", ">+ <text variable="reviewed-title" text-case="title" font-style="italic" prefix="Review of "/>+ <names variable="reviewed-author">+ <label form="verb-short" text-case="lowercase" suffix=" "/>+ <name and="text" delimiter=", "/>+ </names>+ </group>+ </group>+ </if>+ <else>+ <group delimiter=", ">+ <text variable="title" text-case="title" font-style="italic" prefix="Review of "/>+ <names variable="reviewed-author">+ <label form="verb-short" text-case="lowercase" suffix=" "/>+ <name and="text" delimiter=", "/>+ </names>+ </group>+ </else>+ </choose>+ </else-if>+ <else-if type="legal_case interview patent" match="any">+ <text variable="title"/>+ </else-if>+ <else>+ <text variable="title" text-case="title" quotes="true"/>+ </else>+ </choose>+ </macro>+ <macro name="edition">+ <choose>+ <if type="bill book graphic legal_case legislation motion_picture report song" match="any">+ <choose>+ <if is-numeric="edition">+ <group delimiter=" " prefix=". ">+ <number variable="edition" form="ordinal"/>+ <text term="edition" form="short" strip-periods="true"/>+ </group>+ </if>+ <else>+ <text variable="edition" text-case="capitalize-first" prefix=". "/>+ </else>+ </choose>+ </if>+ <else-if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">+ <choose>+ <if is-numeric="edition">+ <group delimiter=" " prefix=", ">+ <number variable="edition" form="ordinal"/>+ <text term="edition" form="short"/>+ </group>+ </if>+ <else>+ <text variable="edition" prefix=", "/>+ </else>+ </choose>+ </else-if>+ </choose>+ </macro>+ <macro name="locators">+ <choose>+ <if type="article-journal">+ <choose>+ <if variable="volume">+ <text variable="volume" prefix=" "/>+ <group prefix=" (" suffix=")">+ <choose>+ <if variable="issue">+ <text variable="issue"/>+ </if>+ <else>+ <date variable="issued">+ <date-part name="month"/>+ </date>+ </else>+ </choose>+ </group>+ </if>+ <else-if variable="issue">+ <group delimiter=" " prefix=", ">+ <text term="issue" form="short"/>+ <text variable="issue"/>+ <date variable="issued" prefix="(" suffix=")">+ <date-part name="month"/>+ </date>+ </group>+ </else-if>+ <else>+ <date variable="issued" prefix=", ">+ <date-part name="month"/>+ </date>+ </else>+ </choose>+ </if>+ <else-if type="legal_case">+ <text variable="volume" prefix=", "/>+ <text variable="container-title" prefix=" "/>+ <text variable="page" prefix=" "/>+ </else-if>+ <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">+ <group prefix=". " delimiter=". ">+ <group>+ <text term="volume" form="short" text-case="capitalize-first" suffix=" "/>+ <number variable="volume" form="numeric"/>+ </group>+ <group>+ <number variable="number-of-volumes" form="numeric"/>+ <text term="volume" form="short" prefix=" " plural="true"/>+ </group>+ </group>+ </else-if>+ <else-if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">+ <choose>+ <if variable="page" match="none">+ <group prefix=". ">+ <text term="volume" form="short" text-case="capitalize-first" suffix=" "/>+ <number variable="volume" form="numeric"/>+ </group>+ </if>+ </choose>+ </else-if>+ </choose>+ </macro>+ <macro name="locators-chapter">+ <choose>+ <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">+ <choose>+ <if variable="page">+ <group prefix=", ">+ <text variable="volume" suffix=":"/>+ <text variable="page"/>+ </group>+ </if>+ </choose>+ </if>+ </choose>+ </macro>+ <macro name="locators-article">+ <choose>+ <if type="article-newspaper">+ <group prefix=", " delimiter=", ">+ <group delimiter=" ">+ <text variable="edition"/>+ <text term="edition"/>+ </group>+ <group>+ <text term="section" form="short" suffix=" "/>+ <text variable="section"/>+ </group>+ </group>+ </if>+ <else-if type="article-journal">+ <choose>+ <if variable="volume issue" match="any">+ <text variable="page" prefix=": "/>+ </if>+ <else>+ <text variable="page" prefix=", "/>+ </else>+ </choose>+ </else-if>+ </choose>+ </macro>+ <macro name="point-locators">+ <choose>+ <if variable="locator">+ <choose>+ <if locator="page" match="none">+ <choose>+ <if type="bill book graphic legal_case legislation motion_picture report song" match="any">+ <choose>+ <if variable="volume">+ <group>+ <text term="volume" form="short" suffix=" "/>+ <number variable="volume" form="numeric"/>+ <label variable="locator" form="short" prefix=", " suffix=" "/>+ </group>+ </if>+ <else>+ <label variable="locator" form="short" suffix=" "/>+ </else>+ </choose>+ </if>+ <else>+ <label variable="locator" form="short" suffix=" "/>+ </else>+ </choose>+ </if>+ <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">+ <number variable="volume" form="numeric" suffix=":"/>+ </else-if>+ </choose>+ <text variable="locator"/>+ </if>+ </choose>+ </macro>+ <macro name="container-prefix">+ <text term="in" text-case="capitalize-first"/>+ </macro>+ <macro name="container-title">+ <choose>+ <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">+ <text macro="container-prefix" suffix=" "/>+ </if>+ </choose>+ <choose>+ <if type="webpage">+ <text variable="container-title" text-case="title"/>+ </if>+ <else-if type="legal_case" match="none">+ <group delimiter=" ">+ <text variable="container-title" text-case="title" font-style="italic"/>+ <choose>+ <if type="post-weblog">+ <text value="(blog)"/>+ </if>+ </choose>+ </group>+ </else-if>+ </choose>+ </macro>+ <macro name="publisher">+ <group delimiter=": ">+ <text variable="publisher-place"/>+ <text variable="publisher"/>+ </group>+ </macro>+ <macro name="date">+ <choose>+ <if variable="issued">+ <group delimiter=" ">+ <date variable="original-date" form="text" date-parts="year" prefix="(" suffix=")"/>+ <date variable="issued">+ <date-part name="year"/>+ </date>+ </group>+ </if>+ <else-if variable="status">+ <text variable="status" text-case="capitalize-first"/>+ </else-if>+ <else>+ <text term="no date" form="short"/>+ </else>+ </choose>+ </macro>+ <macro name="date-in-text">+ <choose>+ <if variable="issued">+ <group delimiter=" ">+ <date variable="original-date" form="text" date-parts="year" prefix="[" suffix="]"/>+ <date variable="issued">+ <date-part name="year"/>+ </date>+ </group>+ </if>+ <else-if variable="status">+ <text variable="status"/>+ </else-if>+ <else>+ <text term="no date" form="short"/>+ </else>+ </choose>+ </macro>+ <macro name="day-month">+ <date variable="issued">+ <date-part name="month"/>+ <date-part name="day" prefix=" "/>+ </date>+ </macro>+ <macro name="collection-title">+ <choose>+ <if match="none" type="article-journal">+ <choose>+ <if match="none" is-numeric="collection-number">+ <group delimiter=", ">+ <text variable="collection-title" text-case="title"/>+ <text variable="collection-number"/>+ </group>+ </if>+ <else>+ <group delimiter=" ">+ <text variable="collection-title" text-case="title"/>+ <text variable="collection-number"/>+ </group>+ </else>+ </choose>+ </if>+ </choose>+ </macro>+ <macro name="collection-title-journal">+ <choose>+ <if type="article-journal">+ <group delimiter=" ">+ <text variable="collection-title"/>+ <text variable="collection-number"/>+ </group>+ </if>+ </choose>+ </macro>+ <macro name="event">+ <group>+ <text term="presented at" suffix=" "/>+ <text variable="event"/>+ </group>+ </macro>+ <macro name="description">+ <choose>+ <if type="interview">+ <group delimiter=". ">+ <text macro="interviewer"/>+ <text variable="medium" text-case="capitalize-first"/>+ </group>+ </if>+ <else-if type="patent">+ <group delimiter=" " prefix=". ">+ <text variable="authority"/>+ <text variable="number"/>+ </group>+ </else-if>+ <else>+ <text variable="medium" text-case="capitalize-first" prefix=". "/>+ </else>+ </choose>+ <choose>+ <if variable="title" match="none"/>+ <else-if type="thesis personal_communication speech" match="any"/>+ <else>+ <group delimiter=" " prefix=". ">+ <text variable="genre" text-case="capitalize-first"/>+ <choose>+ <if type="report">+ <text variable="number"/>+ </if>+ </choose>+ </group>+ </else>+ </choose>+ </macro>+ <macro name="issue">+ <choose>+ <if type="legal_case">+ <text variable="authority" prefix=". "/>+ </if>+ <else-if type="speech">+ <group prefix=". " delimiter=", ">+ <group delimiter=" ">+ <text variable="genre" text-case="capitalize-first"/>+ <text macro="event"/>+ </group>+ <text variable="event-place"/>+ <text macro="day-month"/>+ </group>+ </else-if>+ <else-if type="article-newspaper article-magazine personal_communication" match="any">+ <date variable="issued" form="text" prefix=", "/>+ </else-if>+ <else-if type="patent">+ <group delimiter=", " prefix=", ">+ <group delimiter=" ">+ <!--Needs Localization-->+ <text value="filed"/>+ <date variable="submitted" form="text"/>+ </group>+ <group delimiter=" ">+ <choose>+ <if variable="issued submitted" match="all">+ <text term="and"/>+ </if>+ </choose>+ <!--Needs Localization-->+ <text value="issued"/>+ <date variable="issued" form="text"/>+ </group>+ </group>+ </else-if>+ <else-if type="article-journal" match="any"/>+ <else>+ <group prefix=". " delimiter=", ">+ <choose>+ <if type="thesis">+ <text variable="genre" text-case="capitalize-first"/>+ </if>+ </choose>+ <text macro="publisher"/>+ </group>+ </else>+ </choose>+ </macro>+ <citation et-al-min="4" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true" givenname-disambiguation-rule="primary-name" collapse="year" after-collapse-delimiter="; ">+ <layout prefix="(" suffix=")" delimiter="; ">+ <group delimiter=", ">+ <choose>+ <if variable="issued accessed" match="any">+ <group delimiter=" ">+ <text macro="contributors-short"/>+ <text macro="date-in-text"/>+ </group>+ </if>+ <!---comma before forthcoming and n.d.-->+ <else>+ <group delimiter=", ">+ <text macro="contributors-short"/>+ <text macro="date-in-text"/>+ </group>+ </else>+ </choose>+ <text macro="point-locators"/>+ </group>+ </layout>+ </citation>+ <bibliography/>+</style>+<<===== CSL =====<<+++>>===== CITATION-ITEMS =====>>+[ [ {"id":"diaz2016"},+{"id":"diaz2015","locator":"333","label":"page"} ],+ [ {"id":"diaz2016","locator":"333","label":"page"},+ {"id":"diaz2015"} ]+]+<<===== CITATION-ITEMS =====<<++++>>===== INPUT =====>>+[+ {+ "id": "diaz2015",+ "type": "article-journal",+ "title": "In Defence of Historical Constructivism about Races",+ "container-title": "Ergo, an Open Access Journal of Philosophy",+ "volume": "2",+ "URL": "http://hdl.handle.net/2027/spo.12405314.0002.021",+ "DOI": "10.3998/ergo.12405314.0002.021",+ "ISSN": "2330-4014",+ "author": [+ {+ "family": "Díaz-León",+ "given": "Esa"+ }+ ],+ "issued": {+ "date-parts": [+ [+ 2015+ ]+ ]+ }+ },+ {+ "id": "diaz2016",+ "type": "article-journal",+ "title": "<i>Woman</i> as a Politically Significant Term: A Solution to the Puzzle",+ "container-title": "Hypatia",+ "page": "245-258",+ "URL": "http://onlinelibrary.wiley.com.uaccess.univie.ac.at/doi/10.1111/hypa.12234/abstract",+ "DOI": "10.1111/hypa.12234",+ "ISSN": "1527-2001",+ "title-short": "<i>Woman</i> as a Politically Significant Term",+ "language": "en",+ "author": [+ {+ "family": "Díaz-León",+ "given": "Esa"+ }+ ],+ "issued": {+ "date-parts": [+ [+ 2016,+ 2,+ 1+ ]+ ]+ },+ "accessed": {+ "date-parts": [+ [+ 2016,+ 2,+ 18+ ]+ ]+ },+ "container-title-short": "Hypatia"+ }+]+<<===== INPUT =====<<+++>>===== VERSION =====>>+1.0+<<===== VERSION =====<<+