From 4282330646d589fed9391e32d05c18fa04fbe76f Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 26 Jun 2021 11:34:56 +0200 Subject: [PATCH] Added Markwon html plugin --- app/build.gradle | 1 + .../main/java/eu/faircode/email/FragmentDialogMarkdown.java | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 2412c2852f..d59184f93a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -432,6 +432,7 @@ dependencies { // https://github.com/noties/Markwon // https://mvnrepository.com/artifact/io.noties.markwon/core implementation "io.noties.markwon:core:$markwon_version" + implementation "io.noties.markwon:html:$markwon_version" // // https://github.com/QuadFlask/colorpicker implementation "com.github.QuadFlask:colorpicker:$colorpicker_version" diff --git a/app/src/main/java/eu/faircode/email/FragmentDialogMarkdown.java b/app/src/main/java/eu/faircode/email/FragmentDialogMarkdown.java index 5282611c1b..50f4a59428 100644 --- a/app/src/main/java/eu/faircode/email/FragmentDialogMarkdown.java +++ b/app/src/main/java/eu/faircode/email/FragmentDialogMarkdown.java @@ -35,6 +35,7 @@ import androidx.annotation.Nullable; import java.io.InputStream; import io.noties.markwon.Markwon; +import io.noties.markwon.html.HtmlPlugin; public class FragmentDialogMarkdown extends FragmentDialogBase { @NonNull @@ -84,7 +85,9 @@ public class FragmentDialogMarkdown extends FragmentDialogBase { "https://github.com/M66B/FairEmail/blob/master/FAQ.md", "https://github.com/M66B/FairEmail/blob/master/docs/FAQ-" + locale + ".md"); - Markwon markwon = Markwon.create(context); + Markwon markwon = Markwon.builder(context) + .usePlugin(HtmlPlugin.create()) + .build(); return markwon.toMarkdown(markdown); }