[patch] For superscript brackets in citation layout

The problem descripted here:
http://forums.zotero.org/discussion/4286/in-csl-should-prefixsuffix-match-verticalalign/
http://forums.zotero.org/discussion/11104/superscript-brackets-in-citation/
http://forums.zotero.org/discussion/10969/problem-with-superscript-and-word-plugin/

This patch for zotero-2.0.8.xpi\chrome\zotero.jar\content\zotero\xpcom\csl.js solved it. So the citation [2-6] changed to [2-6], when using

<layout vertical-align="sup" prefix="[" suffix="]" delimiter=",">
<text variable="citation-number" />
</layout>

The patch is here:

--- /zotero-2.0.8.xpi/chrome/zotero.jar/content/zotero/xpcom/csl.js Sat Sep 04 18:50:38 2010
+++ /zotero/csl/csl.js Thu Oct 07 11:32:12 2010
@@ -2609,8 +2609,14 @@
this.closePunctuation += formattedString.closePunctuation;
}

- // append suffix, if we didn't before
- if(haveAppended && suffix !== false) this.append(suffix, null, true);
+
+ if(haveAppended && suffix !== false)
+ {
+ var oldCloseFormatting = this.closeFormatting;
+ this.closeFormatting = "";
+ this.append(suffix, null, true);
+ this.string += oldCloseFormatting;
+ }

return haveAppended;
}
@@ -2841,7 +2847,8 @@
}
}

- this.string += addBefore+string;
+ //this.string += addBefore+string;
+ this.string = addBefore+ this.string + string;

if(element && element.@suffix.length()) {
this.append(element.@suffix.toString(), null, true);
Sign In or Register to comment.