Autolink workarounds

This commit is contained in:
M66B 2020-10-14 16:01:43 +02:00
parent ae51a3397b
commit 97757c9b89
1 changed files with 11 additions and 4 deletions

View File

@ -914,11 +914,18 @@ public class HtmlHelper {
int start = matcher.start();
int end = matcher.end();
// Workaround for links between parenthesis
if (group.endsWith(")") &&
start > 0 && text.charAt(start - 1) == '(') {
group = group.substring(0, group.length() - 1);
// Workarounds
if (group.endsWith(".")) {
end--;
group = group.substring(0, group.length() - 1);
}
if (group.startsWith("(")) {
start++;
group = group.substring(1);
}
if (group.endsWith(")")) {
end--;
group = group.substring(0, group.length() - 1);
}
boolean email = group.contains("@") && !group.contains(":");