[evolution] I#1705 - text-highlight: Add Markdown language



commit 7f1bf7f0123065260446de2894c969f0870c75f4
Author: Milan Crha <mcrha redhat com>
Date:   Mon Nov 22 18:36:00 2021 +0100

    I#1705 - text-highlight: Add Markdown language
    
    Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1705

 src/modules/text-highlight/e-mail-display-popup-text-highlight.c | 8 ++++++++
 src/modules/text-highlight/languages.c                           | 5 +++++
 2 files changed, 13 insertions(+)
---
diff --git a/src/modules/text-highlight/e-mail-display-popup-text-highlight.c 
b/src/modules/text-highlight/e-mail-display-popup-text-highlight.c
index 51cd3acbe8..606024b8a6 100644
--- a/src/modules/text-highlight/e-mail-display-popup-text-highlight.c
+++ b/src/modules/text-highlight/e-mail-display-popup-text-highlight.c
@@ -158,6 +158,14 @@ reformat (GtkAction *old,
        g_hash_table_replace (
                query, g_strdup ("__force_highlight"), (gpointer) "true");
 
+       #ifdef HAVE_MARKDOWN
+       if (g_strcmp0 (gtk_action_get_name (action), "markdown") == 0) {
+               g_hash_table_remove (query, "__formatas");
+               g_hash_table_remove (query, "__force_highlight");
+               g_hash_table_replace (query, g_strdup ("mime_type"), (gpointer) "text/markdown");
+       }
+       #endif
+
        soup_uri_set_query_from_form (soup_uri, query);
        g_hash_table_destroy (query);
 
diff --git a/src/modules/text-highlight/languages.c b/src/modules/text-highlight/languages.c
index 4571f2dba9..b8554f5faf 100644
--- a/src/modules/text-highlight/languages.c
+++ b/src/modules/text-highlight/languages.c
@@ -93,6 +93,11 @@ static Language languages[] = {
                              (gchar[]) { "text/x-patch" }, NULL }
        },
 
+       { "markdown", N_("_Markdown"),
+         (const gchar *[]) { (gchar[]) { "md" }, NULL },
+         (const gchar *[]) { NULL }
+       },
+
        { "perl", N_("_Perl"),
          (const gchar *[]) { (gchar[]) { "perl" }, (gchar[]) { "cgi"},
                              (gchar[]) { "perl" }, (gchar[]) { "pl" },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]