From ba0fc54cbc4859fa754371d0648f5e3727c420d1 Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 7 Aug 2023 17:09:30 +0200 Subject: [PATCH] Fix maths converter --- .../fedilab/android/mastodon/ui/drawer/StatusAdapter.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java index d31ce7ea..741a12fe 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java @@ -762,7 +762,11 @@ public class StatusAdapter extends RecyclerView.Adapter MathJaxView mathview = new MathJaxView(context, mathJaxConfig); holder.binding.statusContentMaths.addView(mathview); if (status.contentSpan != null) { - String input = status.contentSpan.toString(); + String input; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) + input = new SpannableString(Html.fromHtml(status.content, Html.FROM_HTML_MODE_LEGACY)).toString(); + else + input = new SpannableString(Html.fromHtml(status.content)).toString(); input = input.replaceAll("'", "'"); input = input.replaceAll("\"", """); mathview.setInputText(input);