diff --git a/FAQ.md b/FAQ.md
index fcd70e5977..bc5d278804 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -2537,7 +2537,7 @@ Reformatting and displaying such messages will take too long. You can try to use
**(125) What are the current experimental features?**
-Currently, there are no experimental features.
+* Custom rendering of reformatted messages
diff --git a/app/src/main/java/eu/faircode/email/ActivityEML.java b/app/src/main/java/eu/faircode/email/ActivityEML.java
index f6ea69b5c7..86a3c0a035 100644
--- a/app/src/main/java/eu/faircode/email/ActivityEML.java
+++ b/app/src/main/java/eu/faircode/email/ActivityEML.java
@@ -179,7 +179,7 @@ public class ActivityEML extends ActivityBase {
if (html != null) {
Document parsed = JsoupEx.parse(html);
Document document = HtmlHelper.sanitizeView(context, parsed, false);
- result.body = HtmlHelper.fromDocument(document);
+ result.body = HtmlHelper.fromDocument(context, document);
}
return result;
diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java
index 16e1affce5..847b6a56c5 100644
--- a/app/src/main/java/eu/faircode/email/AdapterMessage.java
+++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java
@@ -1924,7 +1924,7 @@ public class AdapterMessage extends RecyclerView.Adapter";
}
Document document = HtmlHelper.sanitizeCompose(context, html, false);
- Spanned paste = HtmlHelper.fromDocument(document);
+ Spanned paste = HtmlHelper.fromDocument(context, document);
int colorPrimary = Helper.resolveColor(context, R.attr.colorPrimary);
diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java
index 8bef584062..89e99c34a8 100644
--- a/app/src/main/java/eu/faircode/email/HtmlHelper.java
+++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java
@@ -1756,12 +1756,15 @@ public class HtmlHelper {
return false;
}
- static Spanned fromDocument(@NonNull Document document) {
- return fromDocument(document, null, null);
+ static Spanned fromDocument(Context context, @NonNull Document document) {
+ return fromDocument(context, document, null, null);
}
- static Spanned fromDocument(@NonNull Document document, @Nullable Html.ImageGetter imageGetter, @Nullable Html.TagHandler tagHandler) {
- if (BuildConfig.DEBUG) {
+ static Spanned fromDocument(Context context, @NonNull Document document, @Nullable Html.ImageGetter imageGetter, @Nullable Html.TagHandler tagHandler) {
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+ boolean experiments = prefs.getBoolean("experiments", false);
+
+ if (experiments) {
// https://developer.android.com/guide/topics/text/spans
SpannableStringBuilder ssb = new SpannableStringBuilder();
diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml
index 55795b419d..a85cc4c35e 100644
--- a/app/src/main/res/layout/fragment_options_misc.xml
+++ b/app/src/main/res/layout/fragment_options_misc.xml
@@ -187,9 +187,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
- android:checked="true"
android:text="@string/title_advanced_experiments"
- android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swUpdates"
@@ -205,7 +203,6 @@
android:text="@string/title_advanced_experiments_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorLink"
- android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swExperiments" />