mirror of https://github.com/M66B/FairEmail.git
Implemented text-transform=capitalize
This commit is contained in:
parent
0853694aa2
commit
3a2130dc3c
|
@ -924,7 +924,18 @@ public class HtmlHelper {
|
|||
String text = tnode.getWholeText();
|
||||
switch (value) {
|
||||
case "capitalize":
|
||||
// TODO: capitalize
|
||||
for (int i = 0; i < text.length(); ) {
|
||||
int codepoint = text.codePointAt(i);
|
||||
if (Character.isLetter(codepoint)) {
|
||||
tnode.text(text.substring(0, i) +
|
||||
text.substring(i, i + 1).toUpperCase(Locale.ROOT) +
|
||||
text.substring(i + 1));
|
||||
break;
|
||||
} else if (!Character.isWhitespace(codepoint))
|
||||
break;
|
||||
else
|
||||
i += Character.charCount(codepoint);
|
||||
}
|
||||
break;
|
||||
case "uppercase":
|
||||
tnode.text(text.toUpperCase(Locale.ROOT));
|
||||
|
|
Loading…
Reference in New Issue