summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnMacFarlane <>2018-11-08 20:13:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-11-08 20:13:00 (GMT)
commit941a9fafc0b0713fdcbfbb41f8eb3fa35556a074 (patch)
treecb2cac224a9061c6eda696ef9a6e36f488261538
parent66939ec4d424f04f3cd1ad5647cd3fcd029af5fc (diff)
version 0.14.8.10.14.8.1
-rw-r--r--changelog8
-rw-r--r--pandoc-citeproc.cabal2
-rw-r--r--src/Text/CSL/Eval/Names.hs2
-rw-r--r--src/Text/CSL/Proc/Collapse.hs5
-rw-r--r--tests/issue360.expected.native5
-rw-r--r--tests/issue360.in.native2
-rw-r--r--tests/jats.csl208
7 files changed, 21 insertions, 211 deletions
diff --git a/changelog b/changelog
index 8bcfe9f..49c95c7 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,11 @@
+pandoc-citeproc (0.14.8.1)
+
+ * Avoid putting a space after nonbreaking space at end of prefix.
+ Previously this resulted in overly long spaces after abbreviations
+ like 'cf.' at the end of prefixes.
+ * Fix bug which caused names with apostrophes to be treated like
+ East Asian names in certain styles (#360).
+
pandoc-citeproc (0.14.8)
* Add disambiguation to undated references (n.d.a, n.d.b) (#325).
diff --git a/pandoc-citeproc.cabal b/pandoc-citeproc.cabal
index e189d44..7d82d28 100644
--- a/pandoc-citeproc.cabal
+++ b/pandoc-citeproc.cabal
@@ -1,5 +1,5 @@
name: pandoc-citeproc
-version: 0.14.8
+version: 0.14.8.1
cabal-version: 1.12
synopsis: Supports using pandoc with citeproc
diff --git a/src/Text/CSL/Eval/Names.hs b/src/Text/CSL/Eval/Names.hs
index b19c029..0a8573b 100644
--- a/src/Text/CSL/Eval/Names.hs
+++ b/src/Text/CSL/Eval/Names.hs
@@ -319,7 +319,7 @@ formatName m b f fm ops np n
(c >= '\x1f00' && c <= '\x1fff') ||
(c >= '\x0600' && c <= '\x06ff') ||
(c >= '\x200c' && c <= '\x200e') ||
- (c >= '\x2018' && c <= '\x0219') ||
+ (c >= '\x2018' && c <= '\x2019') ||
(c >= '\x021a' && c <= '\x021b') ||
(c >= '\x202a' && c <= '\x202e')
diff --git a/src/Text/CSL/Proc/Collapse.hs b/src/Text/CSL/Proc/Collapse.hs
index efb14ef..8f77e2f 100644
--- a/src/Text/CSL/Proc/Collapse.hs
+++ b/src/Text/CSL/Proc/Collapse.hs
@@ -206,7 +206,10 @@ addCiteAffixes c x =
case y of
Formatted [] -> []
Formatted ils
- | isprefix -> [OPan ils, OSpace]
+ | isprefix -> case reverse ils of
+ (Str zs@(_:_):_) |
+ last zs == '\160' -> [OPan ils]
+ _ -> [OPan ils, OSpace]
| otherwise -> case ils of
(Str (z:_):_)
| isAlphaNum z ||
diff --git a/tests/issue360.expected.native b/tests/issue360.expected.native
new file mode 100644
index 0000000..0fcc4a9
--- /dev/null
+++ b/tests/issue360.expected.native
@@ -0,0 +1,5 @@
+Pandoc (Meta {unMeta = fromList [("csl",MetaInlines [Str "tests/chicago-fullnote-bibliography.csl"]),("references",MetaList [MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "L\8217Estrange"]),("given",MetaInlines [Str "Michael"])]),MetaMap (fromList [("family",MetaInlines [Str "Merchant"]),("given",MetaInlines [Str "Stephen"])])]),("id",MetaInlines [Str "lestrange2017"]),("issued",MetaList [MetaMap (fromList [("day",MetaInlines [Str "18"]),("month",MetaInlines [Str "7"]),("year",MetaInlines [Str "2017"])])]),("language",MetaInlines [Str "en-US"]),("title",MetaInlines [Str "2017",Space,Str "Independent",Space,Str "Intelligence",Space,Str "Review"]),("title-short",MetaInlines [Str "Independent",Space,Str "Intelligence",Space,Str "Review"]),("type",MetaInlines [Str "report"])])])]})
+[Para [Cite [Citation {citationId = "lestrange2017", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 1}] [Note [Para [Str "Michael",Space,Str "L\8217Estrange",Space,Str "and",Space,Str "Stephen",Space,Str "Merchant,",Space,Emph [Str "2017",Space,Str "Independent",Space,Str "Intelligence",Space,Str "Review"],Str ",",Space,Str "July",Space,Str "18,",Space,Str "2017."]]]]
+,Div ("refs",["references"],[])
+ [Div ("ref-lestrange2017",[],[])
+ [Para [Str "L\8217Estrange,",Space,Str "Michael,",Space,Str "and",Space,Str "Stephen",Space,Str "Merchant.",Space,Emph [Str "2017",Space,Str "Independent",Space,Str "Intelligence",Space,Str "Review"],Str ",",Space,Str "July",Space,Str "18,",Space,Str "2017."]]]]
diff --git a/tests/issue360.in.native b/tests/issue360.in.native
new file mode 100644
index 0000000..70dcdd3
--- /dev/null
+++ b/tests/issue360.in.native
@@ -0,0 +1,2 @@
+Pandoc (Meta {unMeta = fromList [("csl",MetaInlines [Str "tests/chicago-fullnote-bibliography.csl"]),("references",MetaList [MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "L\8217Estrange"]),("given",MetaInlines [Str "Michael"])]),MetaMap (fromList [("family",MetaInlines [Str "Merchant"]),("given",MetaInlines [Str "Stephen"])])]),("id",MetaInlines [Str "lestrange2017"]),("issued",MetaList [MetaMap (fromList [("day",MetaInlines [Str "18"]),("month",MetaInlines [Str "7"]),("year",MetaInlines [Str "2017"])])]),("language",MetaInlines [Str "en-US"]),("title",MetaInlines [Str "2017",Space,Str "Independent",Space,Str "Intelligence",Space,Str "Review"]),("title-short",MetaInlines [Str "Independent",Space,Str "Intelligence",Space,Str "Review"]),("type",MetaInlines [Str "report"])])])]})
+[Para [Cite [Citation {citationId = "lestrange2017", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "[@lestrange2017]"]]]
diff --git a/tests/jats.csl b/tests/jats.csl
deleted file mode 100644
index 6487286..0000000
--- a/tests/jats.csl
+++ /dev/null
@@ -1,208 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" default-locale="en-US">
- <info>
- <title>Journal Article Tag Suite</title>
- <title-short>JATS</title-short>
- <id>http://www.zotero.org/styles/journal-article-tag-suite</id>
- <link href="https://github.com/MartinPaulEve/JATS-CSL/blob/master/jats.csl" rel="self"/>
- <link rel="documentation" href="http://jats.nlm.nih.gov/archiving/tag-library/1.0/index.html"/>
- <author>
- <name>Martin Paul Eve</name>
- <email>martin@martineve.com</email>
- </author>
- <category citation-format="numeric"/>
- <category field="medicine"/>
- <category field="biology"/>
- <summary>Use this style to generate bibliographic data in Journal Article Tagging Suite (JATS) 1.0 XML format</summary>
- <updated>2014-06-21T17:41:26+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. Originally by Martin Fenner.</rights>
- </info>
- <locale xml:lang="en">
- <terms>
- <term name="et-al">{{jats}}&lt;etal/&gt;{{/jats}}</term>
- </terms>
- </locale>
- <macro name="citation-number">
- <text variable="citation-number" prefix="{{jats}}id=&quot;ref-{{/jats}}" suffix="{{jats}}&quot;&gt;{{/jats}}"/>
- </macro>
- <macro name="author">
- <names variable="author">
- <name prefix="{{jats}}&lt;name&gt;{{/jats}}" suffix="{{jats}}&lt;/name&gt;{{/jats}}" name-as-sort-order="all" sort-separator="">
- <name-part name="family" text-case="capitalize-first" prefix="{{jats}}&lt;surname&gt;{{/jats}}" suffix="{{jats}}&lt;/surname&gt;{{/jats}}"/>
- <name-part name="given" text-case="capitalize-first" prefix="{{jats}}&lt;given-names&gt;{{/jats}}" suffix="{{jats}}&lt;/given-names&gt;{{/jats}}"/>
- </name>
- <substitute>
- <names variable="editor"/>
- </substitute>
- </names>
- </macro>
-
- <macro name="editor">
- <names variable="editor" prefix="{{jats}}&lt;person-group person-group-type=&quot;editor&quot;&gt;{{/jats}}" suffix="{{jats}}&lt;/person-group&gt;{{/jats}}">
- <name prefix="{{jats}}&lt;name&gt;{{/jats}}" suffix="{{jats}}&lt;/name&gt;{{/jats}}" name-as-sort-order="all" sort-separator="">
- <name-part name="family" text-case="capitalize-first" prefix="{{jats}}&lt;surname&gt;{{/jats}}" suffix="{{jats}}&lt;/surname&gt;{{/jats}}"/>
- <name-part name="given" text-case="capitalize-first" prefix="{{jats}}&lt;given-names&gt;{{/jats}}" suffix="{{jats}}&lt;/given-names&gt;{{/jats}}"/>
- </name>
- <substitute>
- <names variable="editor"/>
- </substitute>
- </names>
- </macro>
-
- <macro name="editor">
- <group delimiter=": ">
- <names variable="editor">
- <name prefix="{{jats}}&lt;name&gt;{{/jats}}" suffix="{{jats}}&lt;/name&gt;{{/jats}}" name-as-sort-order="all" sort-separator="">
- <name-part name="family" text-case="capitalize-first" prefix="{{jats}}&lt;surname&gt;{{/jats}}" suffix="{{jats}}&lt;/surname&gt;{{/jats}}"/>
- <name-part name="given" text-case="capitalize-first" prefix="{{jats}}&lt;given-names&gt;{{/jats}}" suffix="{{jats}}&lt;given-names&gt;{{/jats}}"/>
- </name>
- </names>
- </group>
- </macro>
- <macro name="title">
- <choose>
- <if type="book" match="any">
- <group prefix="{{jats}}&lt;source&gt;{{/jats}}" suffix="{{jats}}&lt;/source&gt;{{/jats}}">
- <text variable="title"/>
- </group>
- </if>
- <else>
- <group prefix="{{jats}}&lt;article-title&gt;{{/jats}}" suffix="{{jats}}&lt;/article-title&gt;{{/jats}}">
- <text variable="title"/>
- </group>
- </else>
- </choose>
- </macro>
- <macro name="container-title">
- <text variable="container-title" form="short" prefix="{{jats}}&lt;source&gt;{{/jats}}" suffix="{{jats}}&lt;/source&gt;{{/jats}}"/>
- </macro>
- <macro name="publisher">
- <text variable="publisher" prefix="{{jats}}&lt;publisher-name&gt;{{/jats}}" suffix="{{jats}}&lt;/publisher-name&gt;{{/jats}}"/>
- <text variable="publisher-place" prefix="{{jats}}&lt;publisher-loc&gt;{{/jats}}" suffix="{{jats}}&lt;/publisher-loc&gt;{{/jats}}"/>
- </macro>
- <macro name="link">
- <choose>
- <if match="any" variable="DOI">
- <group prefix="{{jats}}&lt;pub-id pub-id-type=&quot;doi&quot;&gt;{{/jats}}" suffix="{{jats}}&lt;/pub-id&gt;{{/jats}}">
- <text variable="DOI"/>
- </group>
- </if>
- </choose>
- <choose>
- <if match="any" variable="PMID">
- <group prefix="{{jats}}&lt;ext-link ext-link-type=&quot;pmid&quot; {{/jats}}" suffix="{{jats}}&lt;/ext-link&gt;{{/jats}}">
- <text variable="PMID" prefix="{{jats}}xlink:href=&quot;http://www.ncbi.nlm.nih.gov/pubmed/{{/jats}}" suffix="{{jats}}&quot; xlink:type=&quot;simple&quot;&gt;{{/jats}}"/>
- <text variable="PMID"/>
- </group>
- </if>
- </choose>
- <choose>
- <if variable="URL" match="any">
- <group prefix="{{jats}}&lt;ext-link ext-link-type=&quot;uri&quot; {{/jats}}" suffix="{{jats}}&lt;/ext-link&gt;{{/jats}}">
- <text variable="URL" prefix="{{jats}}xlink:href=&quot;{{/jats}}" suffix="{{jats}}&quot; xlink:type=&quot;simple&quot;&gt;{{/jats}}"/>
- <text variable="URL"/>
- </group>
- </if>
- </choose>
- </macro>
- <macro name="date">
- <choose>
- <if type="article-journal article-magazine article-newspaper report patent book" match="any">
- <group prefix="{{jats}}&lt;date&gt;{{/jats}}" suffix="{{jats}}&lt;/date&gt;{{/jats}}">
- <date variable="issued">
- <date-part name="day" form="numeric-leading-zeros" prefix="{{jats}}&lt;day&gt;{{/jats}}" suffix="{{jats}}&lt;/day&gt;{{/jats}}"/>
- <date-part name="month" form="numeric-leading-zeros" prefix="{{jats}}&lt;month&gt;{{/jats}}" suffix="{{jats}}&lt;/month&gt;{{/jats}}"/>
- <date-part name="year" prefix="{{jats}}&lt;year&gt;{{/jats}}" suffix="{{jats}}&lt;/year&gt;{{/jats}}"/>
- </date>
- </group>
- </if>
- <else>
- <group prefix="{{jats}}&lt;date-in-citation content-type=&quot;access-date&quot;{{/jats}}" suffix="{{jats}}&lt;/date-in-citation&gt;{{/jats}}">
- <date variable="accessed" prefix="{{jats}} iso-8601-date=&quot;{{/jats}}" suffix="{{jats}}&quot;&gt;{{/jats}}">
- <date-part name="year"/>
- <date-part name="month" form="numeric-leading-zeros" prefix="{{jats}}-{{/jats}}"/>
- <date-part name="day" form="numeric-leading-zeros" prefix="{{jats}}-{{/jats}}"/>
- </date>
- <date variable="accessed">
- <date-part name="day" prefix="{{jats}}&lt;day&gt;{{/jats}}" suffix="{{jats}}&lt;/day&gt;{{/jats}}"/>
- <date-part name="month" form="numeric-leading-zeros" prefix="{{jats}}&lt;month&gt;{{/jats}}" suffix="{{jats}}&lt;/month&gt;{{/jats}}"/>
- <date-part name="year" prefix="{{jats}}&lt;year&gt;{{/jats}}" suffix="{{jats}}&lt;/year&gt;{{/jats}}"/>
- </date>
- </group>
- </else>
- </choose>
- </macro>
- <macro name="location">
- <choose>
- <if type="article-journal article-magazine" match="any">
- <text variable="volume" prefix="{{jats}}&lt;volume&gt;{{/jats}}" suffix="{{jats}}&lt;/volume&gt;{{/jats}}"/>
- <text variable="issue" prefix="{{jats}}&lt;issue&gt;{{/jats}}" suffix="{{jats}}&lt;/issue&gt;{{/jats}}"/>
- </if>
- </choose>
- <choose>
- <if type="article-journal article-magazine article-newspaper chapter" match="any">
- <text variable="page-first" prefix="{{jats}}&lt;fpage&gt;{{/jats}}" suffix="{{jats}}&lt;/fpage&gt;{{/jats}}"/>
- </if>
- </choose>
- </macro>
- <macro name="publication-type">
- <group prefix="{{jats}} publication-type=&quot;{{/jats}}" suffix="{{jats}}&quot;&gt;{{/jats}}">
- <choose>
- <if type="article-journal article-magazine article-newspaper" match="any">
- <text value="journal"/>
- </if>
- <else-if type="book" match="any">
- <text value="book"/>
- </else-if>
- <else-if type="chapter" match="any">
- <text value="bookchapter"/>
- </else-if>
- <else-if type="dataset" match="any">
- <text value="dataset"/>
- </else-if>
- <else-if type="patent" match="any">
- <text value="patent"/>
- </else-if>
- <else-if type="report" match="any">
- <text value="report"/>
- </else-if>
- <else-if type="review" match="any">
- <text value="review"/>
- </else-if>
- <else>
- <text value="standard"/>
- </else>
- </choose>
- </group>
- </macro>
- <citation collapse="citation-number">
- <sort>
- <key variable="citation-number"/>
- </sort>
- <layout delimiter=",">
- <group prefix="{{jats}}&lt;xref ref-type=&quot;bibr&quot; rid=&quot;{{/jats}}" suffix="{{jats}}&lt;/xref&gt;{{/jats}}">
- <text variable="citation-number" prefix="{{jats}}ref-{{/jats}}" suffix="{{jats}}&quot;&gt;{{/jats}}"/>
- <text variable="citation-number"/>
- </group>
- </layout>
- </citation>
- <bibliography sort-separator="">
- <layout>
- <group prefix="{{jats}}&lt;ref {{/jats}}" suffix="{{jats}}&lt;/ref&gt;{{/jats}}">
- <text macro="citation-number"/>
- <group prefix="{{jats}}&lt;element-citation{{/jats}}" suffix="{{jats}}&lt;/element-citation&gt;{{/jats}}">
- <text macro="publication-type"/>
- <text macro="author" prefix="{{jats}}&lt;person-group person-group-type=&quot;author&quot;&gt;{{/jats}}" suffix="{{jats}}&lt;/person-group&gt;{{/jats}}"/>
- <text macro="title" />
- <text macro="container-title"/>
- <text macro="editor"/>
- <text macro="publisher"/>
- <text macro="date"/>
- <text macro="location"/>
- <text macro="link"/>
- </group>
- </group>
- </layout>
- </bibliography>
-</style>
-