Merge branch 'readonly-p4-donut' into donut

This commit is contained in:
Andy Stadler 2009-05-22 12:16:41 -07:00 committed by The Android Open Source Project
commit b5343c4cc5

View File

@ -950,7 +950,12 @@ public class MessageView extends Activity
Matcher m = Regex.WEB_URL_PATTERN.matcher(text); Matcher m = Regex.WEB_URL_PATTERN.matcher(text);
while (m.find()) { while (m.find()) {
int start = m.start(); int start = m.start();
if (start != 0 && text.charAt(start - 1) != '@') { /*
* WEB_URL_PATTERN may match domain part of email address. To detect
* this false match, the character just before the matched string
* should not be '@'.
*/
if (start == 0 || text.charAt(start - 1) != '@') {
m.appendReplacement(sb, "<a href=\"$0\">$0</a>"); m.appendReplacement(sb, "<a href=\"$0\">$0</a>");
} }
else { else {