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(); 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) if (BuildConfig.DEBUG)
Log.i("Web url=" + matcher.group() + Log.i("Web url=" + matcher.group() +
" " + matcher.start() + "..." + matcher.end() + " " + matcher.start() + "..." + matcher.end() + "/" + text.length() +
" linked=" + linked); " linked=" + linked + " start=" + atStart + " end=" + atEnd);
if (linked || if (linked || atStart || atEnd)
(matcher.start() > 0 && text.charAt(matcher.start() - 1) == '@'))
span.appendText(text.substring(pos, matcher.end())); span.appendText(text.substring(pos, matcher.end()));
else { else {
span.appendText(text.substring(pos, matcher.start())); span.appendText(text.substring(pos, matcher.start()));