Fix linkify when URL follows HTML tag
This commit is contained in:
parent
27bc562ebe
commit
2e20ddf6a5
2 changed files with 10 additions and 1 deletions
|
@ -13,7 +13,7 @@ import android.text.TextUtils;
|
|||
public class UriLinkifier {
|
||||
private static final Pattern URI_SCHEME;
|
||||
private static final Map<String, UriParser> SUPPORTED_URIS;
|
||||
private static final String SCHEME_SEPARATORS = " (\\n";
|
||||
private static final String SCHEME_SEPARATORS = " (\\n>";
|
||||
private static final String ALLOWED_SEPARATORS_PATTERN = "(?:^|[" + SCHEME_SEPARATORS + "])";
|
||||
|
||||
static {
|
||||
|
|
|
@ -136,4 +136,13 @@ public class UriLinkifierTest {
|
|||
"<a href=\"http://uri2.example.org/path\">http://uri2.example.org/path</a> postfix",
|
||||
outputBuffer.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void uriSurroundedByHtmlTags() {
|
||||
String text = "<br>http://uri.example.org<hr>";
|
||||
|
||||
UriLinkifier.linkifyText(text, outputBuffer);
|
||||
|
||||
assertEquals("<br><a href=\"http://uri.example.org\">http://uri.example.org</a><hr>", outputBuffer.toString());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue