From 7bf86c053fedc4814a93f74a3ca263b9d132e113 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 5 Jul 2026 17:41:42 +0200 Subject: [PATCH] Markdown improvements --- FAQ.md | 16 +++++----- .../eu/faircode/email/FragmentCompose.java | 29 ++++++++++++------- app/src/main/res/layout/fragment_compose.xml | 7 +++-- index.html | 10 ++++--- 4 files changed, 37 insertions(+), 25 deletions(-) diff --git a/FAQ.md b/FAQ.md index be9c2888a1..046fac17dc 100644 --- a/FAQ.md +++ b/FAQ.md @@ -344,7 +344,7 @@ Anything on this list is in random order and *might* be added in the near future * [(96) Where can I find the IMAP and SMTP settings?](#faq96) * [(97) What is 'cleanup'?](#faq97) * [(98) Why can I still pick contacts after revoking contacts permissions?](#faq98) -* [(99) Can you add a rich text or markdown editor?](#faq99) +* [(99) What should I know about Markdown?](#faq99) * [(100) How can I synchronize Gmail categories?](#faq100) * [(101) What does the blue/orange dot at the bottom of the conversations mean?](#faq101) * [(102) How can I enable auto rotation of images?](#faq102) @@ -3851,16 +3851,18 @@ However, picking contacts is delegated to and done by Android and not by FairEma
-**(99) Can you add a rich text or markdown editor?** +**(99) What should I know about Markdown?** 🌎 [Google Translate](https://translate.google.com/translate?sl=en&u=https%3A%2F%2Fm66b.github.io%2FFairEmail%2F%23faq99) -FairEmail provides common text formatting (bold, italic, underline, text size and color) via a toolbar that appears after selecting some text. +FairEmail provides common text formatting (bold, italic, underline, text size and color, etc.) via a toolbar that appears after selecting some text. -A [Rich text](https://en.wikipedia.org/wiki/Formatted_text) or [Markdown](https://en.wikipedia.org/wiki/Markdown) editor -would not be used by many people on a small mobile device and, more important, -Android doesn't support a rich text editor and most rich text editor open source projects are abandoned. -See [here](https://forum.xda-developers.com/showpost.php?p=79061829&postcount=4919) for some more details about this. +Alternatively, you can use [Markdown](https://en.wikipedia.org/wiki/Markdown). +You can enable Markdown support via the three-dot overflow menu at the top right of the message editor. + +Please be aware that **normal styling will be ignored** when using Markdown, or, in other words, you can mix. + +Markdown is an experimental feature.
diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 5ac9ada29f..e836a14722 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -268,7 +268,7 @@ public class FragmentCompose extends FragmentBase { private TextView tvResend; private TextView tvPlainTextOnly; private EditTextCompose etBody; - private ImageView ivMarkdown; + private ImageView ibMarkdown; private TextView tvNoInternet; private TextView tvSignature; private CheckBox cbSignature; @@ -432,7 +432,7 @@ public class FragmentCompose extends FragmentBase { tvResend = view.findViewById(R.id.tvResend); tvPlainTextOnly = view.findViewById(R.id.tvPlainTextOnly); etBody = view.findViewById(R.id.etBody); - ivMarkdown = view.findViewById(R.id.ivMarkdown); + ibMarkdown = view.findViewById(R.id.ibMarkdown); tvNoInternet = view.findViewById(R.id.tvNoInternet); tvSignature = view.findViewById(R.id.tvSignature); cbSignature = view.findViewById(R.id.cbSignature); @@ -925,6 +925,13 @@ public class FragmentCompose extends FragmentBase { } }); + ibMarkdown.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Helper.viewFAQ(v.getContext(), 99); + } + }); + if (compose_color != Color.TRANSPARENT) tvSignature.setTextColor(compose_color); tvSignature.setTypeface(StyleHelper.getTypeface(compose_font, getContext())); @@ -1225,7 +1232,7 @@ public class FragmentCompose extends FragmentBase { tvPlainTextOnly.setVisibility(View.GONE); etBody.setText(null); etBody.setHint(null); - ivMarkdown.setVisibility(View.GONE); + ibMarkdown.setVisibility(View.GONE); grpHeader.setVisibility(View.GONE); grpExtra.setVisibility(View.GONE); @@ -6525,15 +6532,15 @@ public class FragmentCompose extends FragmentBase { for (EntityAttachment attachment : attachments) if (attachment.subsequence == null ? !attachment.isEncryption() && - (cid.contains(attachment.cid) || - !("reply".equals(action) || "reply_all".equals(action))) + (cid.contains(attachment.cid) || + !("reply".equals(action) || "reply_all".equals(action))) : "forward".equals(action) && - tnef.size() == 1 && + tnef.size() == 1 && attachment.sequence.equals(tnef.get(0).sequence) && - !"subject.txt".equals(attachment.name) && - !"body.html".equals(attachment.name) && - !"body.rtf".equals(attachment.name) && - !"attributes.txt".equals(attachment.name)) { + !"subject.txt".equals(attachment.name) && + !"body.html".equals(attachment.name) && + !"body.rtf".equals(attachment.name) && + !"attributes.txt".equals(attachment.name)) { if (attachment.available) { File source = attachment.getFile(context); @@ -8376,7 +8383,7 @@ public class FragmentCompose extends FragmentBase { etBody.setHint(hint); grpBody.setVisibility(View.VISIBLE); - ivMarkdown.setVisibility(markdown ? View.VISIBLE : View.GONE); + ibMarkdown.setVisibility(markdown ? View.VISIBLE : View.GONE); cbSignature.setChecked(draft.signature); ibSignature.setEnabled(draft.signature); diff --git a/app/src/main/res/layout/fragment_compose.xml b/app/src/main/res/layout/fragment_compose.xml index e384695091..b68bc8f6d0 100644 --- a/app/src/main/res/layout/fragment_compose.xml +++ b/app/src/main/res/layout/fragment_compose.xml @@ -382,17 +382,18 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvPlainTextOnly" /> - + app:tint="?attr/colorWarning" /> (96) Where can I find the IMAP and SMTP settings?
  • (97) What is ‘cleanup’?
  • (98) Why can I still pick contacts after revoking contacts permissions?
  • -
  • (99) Can you add a rich text or markdown editor?
  • +
  • (99) What should I know about Markdown?
  • (100) How can I synchronize Gmail categories?
  • (101) What does the blue/orange dot at the bottom of the conversations mean?
  • (102) How can I enable auto rotation of images?
  • @@ -2047,10 +2047,12 @@ Y1 OK CAPABILITY completed

    🌎 Google Translate

    After revoking contacts permissions Android does not allow FairEmail access to your contacts anymore. However, picking contacts is delegated to and done by Android and not by FairEmail, so this will still be possible without contacts permissions.


    -

    (99) Can you add a rich text or markdown editor?

    +

    (99) What should I know about Markdown?

    🌎 Google Translate

    -

    FairEmail provides common text formatting (bold, italic, underline, text size and color) via a toolbar that appears after selecting some text.

    -

    A Rich text or Markdown editor would not be used by many people on a small mobile device and, more important, Android doesn’t support a rich text editor and most rich text editor open source projects are abandoned. See here for some more details about this.

    +

    FairEmail provides common text formatting (bold, italic, underline, text size and color, etc.) via a toolbar that appears after selecting some text.

    +

    Alternatively, you can use Markdown. You can enable Markdown support via the three-dot overflow menu at the top right of the message editor.

    +

    Please be aware that normal styling will be ignored when using Markdown, or, in other words, you can mix.

    +

    Markdown is an experimental feature.


    (100) How can I synchronize Gmail categories?

    🌎 Google Translate