Skip to content

Commit aa5ff52

Browse files
authored
Merge pull request #267 from zepinglee/issue#266
2 parents 053f79b + c0efa92 commit aa5ff52

File tree

4 files changed

+106
-3
lines changed

4 files changed

+106
-3
lines changed

citeproc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4745,7 +4745,7 @@ CSL.Doppeler = function(rexStr, stringMangler) {
47454745
match[i] = "";
47464746
}
47474747
var tag = match[i];
4748-
if (tag === "\'" && split[i+1].length > 0) {
4748+
if (tag === "\'" && split[i + 1].length > 0 && split[i + 1][0] !== " ") {
47494749
// Fixes https://forums.zotero.org/discussion/comment/294317
47504750
split[i+1] = match[i] + split[i+1];
47514751
match[i] = "";

citeproc_commonjs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4745,7 +4745,7 @@ CSL.Doppeler = function(rexStr, stringMangler) {
47454745
match[i] = "";
47464746
}
47474747
var tag = match[i];
4748-
if (tag === "\'" && split[i+1].length > 0) {
4748+
if (tag === "\'" && split[i + 1].length > 0 && split[i + 1][0] !== " ") {
47494749
// Fixes https://forums.zotero.org/discussion/comment/294317
47504750
split[i+1] = match[i] + split[i+1];
47514751
match[i] = "";
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
>>===== MODE =====>>
2+
citation
3+
<<===== MODE =====<<
4+
5+
6+
>>===== DESCRIPTION =====>>
7+
<https://github.com/Juris-M/citeproc-js/issues/266>
8+
<<===== DESCRIPTION =====<<
9+
10+
11+
>>===== RESULT =====>>
12+
Word Word Word Word
13+
Word “Word” Word Word
14+
Word “Word” Word Word
15+
Word “Word” “Word” Word
16+
Word “Word” Word “Word”
17+
<<===== RESULT =====<<
18+
19+
20+
>>===== CITATION-ITEMS =====>>
21+
[
22+
[
23+
{
24+
"id": "ITEM-1"
25+
}
26+
],
27+
[
28+
{
29+
"id": "ITEM-2"
30+
}
31+
],
32+
[
33+
{
34+
"id": "ITEM-3"
35+
}
36+
],
37+
[
38+
{
39+
"id": "ITEM-4"
40+
}
41+
],
42+
[
43+
{
44+
"id": "ITEM-5"
45+
}
46+
]
47+
]
48+
<<===== CITATION-ITEMS =====<<
49+
50+
51+
>>===== CSL =====>>
52+
<style
53+
xmlns="http://purl.org/net/xbiblio/csl"
54+
class="note"
55+
version="1.0">
56+
<info>
57+
<id />
58+
<title />
59+
<updated>2026-02-02T12:58:17+00:00</updated>
60+
</info>
61+
<citation>
62+
<layout>
63+
<text variable="title" text-case="title"/>
64+
</layout>
65+
</citation>
66+
</style>
67+
<<===== CSL =====<<
68+
69+
70+
>>===== INPUT =====>>
71+
[
72+
{
73+
"id": "ITEM-1",
74+
"type": "book",
75+
"title": "Word word word word"
76+
},
77+
{
78+
"id": "ITEM-2",
79+
"type": "book",
80+
"title": "Word \"word\" word word"
81+
},
82+
{
83+
"id": "ITEM-3",
84+
"type": "book",
85+
"title": "Word 'word' word word"
86+
},
87+
{
88+
"id": "ITEM-4",
89+
"type": "book",
90+
"title": "Word 'word' 'word' word"
91+
},
92+
{
93+
"id": "ITEM-5",
94+
"type": "book",
95+
"title": "Word 'word' word 'word'"
96+
}
97+
]
98+
<<===== INPUT =====<<
99+
100+
101+
>>===== VERSION =====>>
102+
1.0
103+
<<===== VERSION =====<<

src/util_processor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ CSL.Doppeler = function(rexStr, stringMangler) {
135135
match[i] = "";
136136
}
137137
var tag = match[i];
138-
if (tag === "\'" && split[i+1].length > 0) {
138+
if (tag === "\'" && split[i + 1].length > 0 && split[i + 1][0] !== " ") {
139139
// Fixes https://forums.zotero.org/discussion/comment/294317
140140
split[i+1] = match[i] + split[i+1];
141141
match[i] = "";

0 commit comments

Comments
 (0)