Only in zotero-trunk/chrome/content/zotero: addCitationDialog.js.orig
Only in zotero-trunk/chrome/content/zotero: addCitationDialog.js.rej
diff -r -u zotero-trunk.orig/chrome/content/zotero/xpcom/csl.js zotero-trunk/chrome/content/zotero/xpcom/csl.js
|
old
|
new
|
|
| 269 | 269 | if(Zotero.CSL._textCharRegexp.test(prefix[prefix.length-1])) prefix += " "; |
| 270 | 270 | |
| 271 | 271 | citationString.append(prefix); |
| | 272 | citationString.has_prefix = true; |
| 272 | 273 | } |
| 273 | 274 | |
| 274 | 275 | this._processElements(citationItem.item, context.layout, citationString, |
| 275 | 276 | context, citationItem, ignore); |
| 276 | 277 | |
| 277 | 278 | // add suffix |
| | 279 | var hasSuffixPunctuation; |
| 278 | 280 | if(citationItem.suffix) { |
| 279 | 281 | var suffix = citationItem.suffix; |
| | 282 | var sfx = suffix.replace(/^\s*/g, "").replace(/\s*$/g, ""); |
| | 283 | var pnct = Zotero.CSL.FormattedString._punctuation; |
| | 284 | if (pnct.indexOf(sfx[sfx.length-1]) != -1) { |
| | 285 | hasSuffixPunctuation = true; |
| | 286 | } else { |
| | 287 | hasSuffixPunctuation = false; |
| | 288 | } |
| 280 | 289 | |
| 281 | 290 | // add space to suffix if last char is alphanumeric |
| 282 | 291 | if(Zotero.CSL._textCharRegexp.test(suffix[0])) suffix = " "+suffix; |
| … |
… |
|
| 285 | 294 | } |
| 286 | 295 | |
| 287 | 296 | string.concat(citationString); |
| | 297 | string.hasSuffixPunctuation = hasSuffixPunctuation; |
| 288 | 298 | } |
| 289 | 299 | |
| 290 | 300 | var returnString = string.clone(); |