From 725d3249951d956d278249c513b9bc7e694e0e73 Mon Sep 17 00:00:00 2001 From: nuclearfog Date: Mon, 12 Jun 2023 23:34:07 +0200 Subject: [PATCH] bug fix --- .../twidda/backend/api/mastodon/impl/MastodonStatus.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/nuclearfog/twidda/backend/api/mastodon/impl/MastodonStatus.java b/app/src/main/java/org/nuclearfog/twidda/backend/api/mastodon/impl/MastodonStatus.java index 164ff762..83efb6c0 100644 --- a/app/src/main/java/org/nuclearfog/twidda/backend/api/mastodon/impl/MastodonStatus.java +++ b/app/src/main/java/org/nuclearfog/twidda/backend/api/mastodon/impl/MastodonStatus.java @@ -98,8 +98,9 @@ public class MastodonStatus implements Status { jsoupDoc.outputSettings(OUTPUT_SETTINGS); jsoupDoc.select("br").after("\\n"); jsoupDoc.select("p").before("\\n"); - String str = jsoupDoc.html().replaceAll("\\\\n", "\n"); + String str = jsoupDoc.html().replace("\\n", "\n"); text = Jsoup.clean(str, "", Safelist.none(), OUTPUT_SETTINGS); + text = text.replace("<", "<").replace(">", ">").replace("&", "&"); if (text.startsWith("\n")) { text = text.substring(1); }