diff --git a/chrome/content/zotero/xpcom/data/items.js b/chrome/content/zotero/xpcom/data/items.js index 9db9fac948..2e30e8af98 100644 --- a/chrome/content/zotero/xpcom/data/items.js +++ b/chrome/content/zotero/xpcom/data/items.js @@ -1686,6 +1686,18 @@ Zotero.Items = function() { _sortCreatorSQL = sql; return sql; } + + + let _stripFromSortTitle = [ + '', + '', + '', + '', + '', + '', + '', + '\\p{P}' + ].map(re => Zotero.Utilities.XRegExp(re, 'g')); this.getSortTitle = function (title) { @@ -1697,17 +1709,7 @@ Zotero.Items = function() { return title.toString(); } - let toRemove = [ - '', - '', - '', - '', - '', - '', - '', - '\\p{P}' - ].map(re => new RegExp(re, 'g')); - for (let re of toRemove) { + for (let re of _stripFromSortTitle) { title = title.replace(re, ''); } return title;