Fix mentions with delete&redraft for Pleroma

This commit is contained in:
tom79 2020-01-29 15:16:29 +01:00
parent d561f51d5f
commit 223e610d1c
1 changed files with 6 additions and 0 deletions

View File

@ -3193,6 +3193,12 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
content = matcher.replaceAll("$3@$2");
}
Pattern mentionLinkPleroma = Pattern.compile("(<\\s?a\\s?href=\"https?:\\/\\/([\\da-z\\.-]+\\.[a-z\\.]{2,10})\\/users/([\\/\\w._-]*)\"\\s?[^.]*<\\s?\\/\\s?a\\s?>)");
Matcher matcherPleroma = mentionLinkPleroma.matcher(content);
if (matcherPleroma.find()) {
content = matcherPleroma.replaceAll("@$3@$2");
}
if (removed) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
content = Html.fromHtml(content, Html.FROM_HTML_MODE_LEGACY).toString();