This commit is contained in:
adam3smith 2014-04-21 16:50:05 -06:00
parent f70d0c0b29
commit 96bd07b172

View file

@ -1950,10 +1950,10 @@
break; break;
case 'sentence': case 'sentence':
// capitalize the first letter, including after beginning punctuation // capitalize the first letter, including after beginning punctuation
// capitalize after :, ?, ! and remove space(s) before those analogous to capitalizeTitle function // 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 quotation marks // also deal with initial punctuation here - open quotes and Spanish beginning punctuation marks
newVal = val.toLowerCase(); newVal = val.toLowerCase().replace(/\s*:/, ":");
newVal = newVal.replace(/(([:\?!]\s*|^)([\'\"¡¿“‘„«\s]+)?[^\s])/g, function (x) { newVal = newVal.replace(/(([\?!]\s*|^)([\'\"¡¿“‘„«\s]+)?[^\s])/g, function (x) {
return x.replace(/\s+/m, " ").toUpperCase();}); return x.replace(/\s+/m, " ").toUpperCase();});
break; break;
default: default: