fix pixelfed post editing
This commit is contained in:
@@ -196,7 +196,13 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
||||
args.putBoolean("navigateToStatus", true);
|
||||
}
|
||||
}
|
||||
if(!redraft && TextUtils.isEmpty(item.status.content) && TextUtils.isEmpty(item.status.spoilerText)){
|
||||
boolean isPixelfed = item.parentFragment.isInstancePixelfed();
|
||||
boolean textEmpty = TextUtils.isEmpty(item.status.content) && TextUtils.isEmpty(item.status.spoilerText);
|
||||
if(!redraft && (isPixelfed || textEmpty)){
|
||||
if (isPixelfed) {
|
||||
args.putString("sourceText", HtmlParser.text(item.status.content));
|
||||
args.putString("sourceSpoiler", item.status.spoilerText);
|
||||
}
|
||||
Nav.go(item.parentFragment.getActivity(), ComposeFragment.class, args);
|
||||
}else if(item.scheduledStatus!=null){
|
||||
args.putString("sourceText", item.status.text);
|
||||
|
||||
@@ -251,6 +251,10 @@ public class HtmlParser{
|
||||
return Jsoup.clean(html, Safelist.none());
|
||||
}
|
||||
|
||||
public static String text(String html) {
|
||||
return Jsoup.parse(html).body().wholeText();
|
||||
}
|
||||
|
||||
public static CharSequence parseLinks(String text){
|
||||
Matcher matcher=URL_PATTERN.matcher(text);
|
||||
if(!matcher.find()) // Return the original string if there are no URLs
|
||||
|
||||
Reference in New Issue
Block a user