Fix URL shortener + count
This commit is contained in:
parent
dab00c5089
commit
d99b15f353
|
@ -3065,9 +3065,7 @@ public class TootActivity extends BaseActivity implements OnPostActionInterface,
|
||||||
int matchEnd = matcherALink.end();
|
int matchEnd = matcherALink.end();
|
||||||
final String url = content.substring(matcherALink.start(1), matcherALink.end(1));
|
final String url = content.substring(matcherALink.start(1), matcherALink.end(1));
|
||||||
if( matchEnd <= content.length() && matchEnd >= matchStart){
|
if( matchEnd <= content.length() && matchEnd >= matchStart){
|
||||||
if( url.length() > 23){
|
content = content.replaceFirst(url,"abcdefghijklmnopkrstuvw");
|
||||||
content = content.replaceFirst(url,"abcdefghijklmnopkrstuvw");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -560,11 +560,10 @@ public class Status implements Parcelable{
|
||||||
|
|
||||||
Pattern aLink = Pattern.compile("<a href=\"([^\"]*)\"[^>]*(((?!<\\/a).)*)<\\/a>");
|
Pattern aLink = Pattern.compile("<a href=\"([^\"]*)\"[^>]*(((?!<\\/a).)*)<\\/a>");
|
||||||
Matcher matcherALink = aLink.matcher(content);
|
Matcher matcherALink = aLink.matcher(content);
|
||||||
|
|
||||||
while (matcherALink.find()){
|
while (matcherALink.find()){
|
||||||
String beforemodification;
|
String beforemodification;
|
||||||
String urlText = matcherALink.group(2);
|
String urlText = matcherALink.group(2);
|
||||||
//urlText += content.substring(matcherALink.start(3), matcherALink.end(3));
|
|
||||||
urlText = urlText.substring(1);
|
urlText = urlText.substring(1);
|
||||||
beforemodification = urlText;
|
beforemodification = urlText;
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||||
|
@ -578,7 +577,7 @@ public class Status implements Parcelable{
|
||||||
urlText += '…';
|
urlText += '…';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
content = content.replaceAll(beforemodification,urlText);
|
content = content.replaceAll(Pattern.quote(beforemodification),urlText);
|
||||||
}
|
}
|
||||||
spannableStringContent = new SpannableString(content);
|
spannableStringContent = new SpannableString(content);
|
||||||
String spoilerText = "";
|
String spoilerText = "";
|
||||||
|
|
Loading…
Reference in New Issue