From 7014b875c7c66e28eede1520c6d97ca5468f373c Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 19 Nov 2013 01:36:16 -0500 Subject: [PATCH] Protect all contractions in full-text content, not just first nsISemanticUnitScanner doesn't seem to be able to deal with single quotes, so protect those. (There might be other characters it doesn't handle, but this is ancient code, so it stays as is for now.) --- chrome/content/zotero/xpcom/fulltext.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/fulltext.js b/chrome/content/zotero/xpcom/fulltext.js index 5c30eee4a..d6730f6f0 100644 --- a/chrome/content/zotero/xpcom/fulltext.js +++ b/chrome/content/zotero/xpcom/fulltext.js @@ -1613,13 +1613,13 @@ Zotero.Fulltext = new function(){ function _markTroubleChars(text){ - text = text.replace("'", "zoteroapostrophe"); + text = text.replace(/'/g, "zoteroapostrophe"); return text; } function _restoreTroubleChars(text){ - text = text.replace("zoteroapostrophe", "'"); + text = text.replace(/zoteroapostrophe/g, "'"); return text; } }