Skip parenthesis when highlighting headers

This commit is contained in:
M66B 2022-01-06 22:37:36 +01:00
parent 41eefbe3b4
commit 956f2c1219
1 changed files with 9 additions and 1 deletions

View File

@ -2443,15 +2443,23 @@ public class HtmlHelper {
ssb.append('\n');
int j = 0;
boolean p = false;
String[] w = h.split("\\s+");
while (j < w.length) {
if (w[j].startsWith("("))
p = true;
if (j > 0)
ssb.append(' ');
s = ssb.length();
ssb.append(w[j]);
if (words.contains(w[j].toLowerCase(Locale.ROOT)))
if (!p && words.contains(w[j].toLowerCase(Locale.ROOT)))
ssb.setSpan(new ForegroundColorSpan(textColorLink), s, ssb.length(), 0);
if (w[j].endsWith(")"))
p = false;
j++;
}
ssb.append("\n\n");