Don't create invalid RTF when citations have brackets
This commit is contained in:
parent
40b1b1da23
commit
c95c51907e
|
@ -2817,7 +2817,7 @@ Zotero.CSL.FormattedString.prototype.append = function(string, element, dontDeli
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.format == "RTF") {
|
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");
|
.replace("\t", "\\tab ", "g");
|
||||||
|
|
||||||
if(string.substr(string.length-5) == "\\tab ") {
|
if(string.substr(string.length-5) == "\\tab ") {
|
||||||
|
|
|
@ -607,7 +607,7 @@ Zotero.Integration.Document.prototype._updateDocument = function(forceCitations,
|
||||||
var citationText = citation.properties.custom;
|
var citationText = citation.properties.custom;
|
||||||
// XML uses real RTF, rather than the format used for
|
// XML uses real RTF, rather than the format used for
|
||||||
// integration, so we have to escape things properly
|
// integration, so we have to escape things properly
|
||||||
citationText = citationText.replace(/[\x7F-\uFFFF]/g,
|
citationText = citationText.replace(/[{}\x7F-\uFFFF]/g,
|
||||||
Zotero.Integration.Session._rtfEscapeFunction).
|
Zotero.Integration.Session._rtfEscapeFunction).
|
||||||
replace("\t", "\\tab ", "g");
|
replace("\t", "\\tab ", "g");
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user