From 5e27a750105335383d44ef2f1348526c6bf3034e Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 9 Aug 2023 07:49:12 -0400 Subject: [PATCH] Switch to better sentence-caser from zotero/utilities#26 Closes #293 --- chrome/content/zotero/elements/itemBox.js | 9 +-------- chrome/content/zotero/xpcom/utilities | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/chrome/content/zotero/elements/itemBox.js b/chrome/content/zotero/elements/itemBox.js index a98e0474dc..35eb4e1f31 100644 --- a/chrome/content/zotero/elements/itemBox.js +++ b/chrome/content/zotero/elements/itemBox.js @@ -2134,14 +2134,7 @@ case 'title': return Zotero.Utilities.capitalizeTitle(val.toLowerCase(), true); case 'sentence': - // capitalize the first letter, including after beginning punctuation - // capitalize after ?, ! and remove space(s) before those as well as colon analogous to capitalizeTitle function - // also deal with initial punctuation here - open quotes and Spanish beginning punctuation marks - val = val.toLowerCase().replace(/\s*:/, ":"); - val = val.replace(/(([?!]\s*|^)(['"¡¿“‘„«\s]+)?[^\s])/g, function (x) { - return x.replace(/\s+/m, " ").toUpperCase(); - }); - return val; + return Zotero.Utilities.sentenceCase(val); default: throw new Error("Invalid transform mode '" + mode + "' in ItemBox.textTransformString()"); } diff --git a/chrome/content/zotero/xpcom/utilities b/chrome/content/zotero/xpcom/utilities index cccf1235a3..27c9818aa6 160000 --- a/chrome/content/zotero/xpcom/utilities +++ b/chrome/content/zotero/xpcom/utilities @@ -1 +1 @@ -Subproject commit cccf1235a318c259345fc623d5e9d6770ba19df7 +Subproject commit 27c9818aa669cc0512c55a78fd0fa2c8f0feb13f