From 6a18d8ef03ba90d684c966daca03a1302251c349 Mon Sep 17 00:00:00 2001 From: Grishka Date: Fri, 25 Oct 2024 04:37:11 +0300 Subject: [PATCH] Replace characters Android doesn't like (AND-193), fix #890 --- .../main/java/org/joinmastodon/android/ui/text/HtmlParser.java | 1 + 1 file changed, 1 insertion(+) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/text/HtmlParser.java b/mastodon/src/main/java/org/joinmastodon/android/ui/text/HtmlParser.java index 17723bab..c0d70e0a 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/text/HtmlParser.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/text/HtmlParser.java @@ -93,6 +93,7 @@ public class HtmlParser{ Map tagsByTag=tags.stream().distinct().collect(Collectors.toMap(t->t.name.toLowerCase(), Function.identity())); Map mentionsByID=mentions.stream().distinct().collect(Collectors.toMap(m->m.id, Function.identity())); + source=source.replaceAll("[\u2028\u2029]", "
"); final SpannableStringBuilder ssb=new SpannableStringBuilder(); Jsoup.parseBodyFragment(source).body().traverse(new NodeVisitor(){ private final ArrayList openSpans=new ArrayList<>();