Switch to better sentence-caser from zotero/utilities#26

Closes #293
This commit is contained in:
Dan Stillman 2023-08-09 07:49:12 -04:00
parent 3b04c012b3
commit 5e27a75010
2 changed files with 2 additions and 9 deletions

View file

@ -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()");
}

@ -1 +1 @@
Subproject commit cccf1235a318c259345fc623d5e9d6770ba19df7
Subproject commit 27c9818aa669cc0512c55a78fd0fa2c8f0feb13f