Skip recognized domain names before 'at' sign

This commit is contained in:
M66B 2019-06-04 17:43:51 +02:00
parent 273f377789
commit d5eca31bc3
1 changed files with 6 additions and 4 deletions

View File

@ -237,13 +237,15 @@ public class HtmlHelper {
parent = parent.parent();
}
boolean atStart = (matcher.start() > 0 && text.charAt(matcher.start() - 1) == '@');
boolean atEnd = (matcher.end() < text.length() && text.charAt(matcher.end()) == '@');
if (BuildConfig.DEBUG)
Log.i("Web url=" + matcher.group() +
" " + matcher.start() + "..." + matcher.end() +
" linked=" + linked);
" " + matcher.start() + "..." + matcher.end() + "/" + text.length() +
" linked=" + linked + " start=" + atStart + " end=" + atEnd);
if (linked ||
(matcher.start() > 0 && text.charAt(matcher.start() - 1) == '@'))
if (linked || atStart || atEnd)
span.appendText(text.substring(pos, matcher.end()));
else {
span.appendText(text.substring(pos, matcher.start()));