From c95c51907e18edfc25d5bbca9257d5506166ee7e Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 28 Sep 2009 20:18:15 +0000 Subject: [PATCH] Don't create invalid RTF when citations have brackets --- chrome/content/zotero/xpcom/csl.js | 2 +- chrome/content/zotero/xpcom/integration.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/csl.js b/chrome/content/zotero/xpcom/csl.js index 3fa334f523..f4f93242bf 100644 --- a/chrome/content/zotero/xpcom/csl.js +++ b/chrome/content/zotero/xpcom/csl.js @@ -2817,7 +2817,7 @@ Zotero.CSL.FormattedString.prototype.append = function(string, element, dontDeli } if(this.format == "RTF") { - string = string.replace(/[\x7F-\uFFFF]/g, Zotero.CSL.FormattedString._rtfEscapeFunction) + string = string.replace(/[{}\x7F-\uFFFF]/g, Zotero.CSL.FormattedString._rtfEscapeFunction) .replace("\t", "\\tab ", "g"); if(string.substr(string.length-5) == "\\tab ") { diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index 47a94b1151..27a63553fc 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -607,7 +607,7 @@ Zotero.Integration.Document.prototype._updateDocument = function(forceCitations, var citationText = citation.properties.custom; // XML uses real RTF, rather than the format used for // integration, so we have to escape things properly - citationText = citationText.replace(/[\x7F-\uFFFF]/g, + citationText = citationText.replace(/[{}\x7F-\uFFFF]/g, Zotero.Integration.Session._rtfEscapeFunction). replace("\t", "\\tab ", "g"); } else {