Subject: Markdown blocks in Gnus messages

From: Juri Linkov <[email-masked]>
Date: Thu, 23 Sep 2021 18:47:51 +0300

Tags: patch

People use markdown blocks on e.g. Reddit, StackOverflow, etc.
and maybe this is the reason why such blocks are used in bug reports.
But without proper highlighting such bug reports as bug#50752
are unreadable.  This patch adds support for highlighting
of such blocks:

```patch
diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el
index 494221adee..b6acd2e32a 100644
--- a/lisp/gnus/mm-uu.el
+++ b/lisp/gnus/mm-uu.el
@@ -145,6 +145,14 @@ mm-uu-type-alist
      ,#'mm-uu-pgp-key-extract
      ,#'mm-uu-gpg-key-skip-to-last
      nil)
+    (markdown-emacs-sources
+     "^```\\(?:elisp\\|emacs-lisp\\|(\\|\n(\\)"
+     "^```$"
+     ,#'mm-uu-emacs-sources-extract)
+    (markdown-diff ;; this should be higher than `git-format-patch'
+     "^```\\(?:diff\\|patch\\|\ndiff --git \\)"
+     "^```$"
+     ,#'mm-uu-diff-extract)
     (emacs-sources
      "^;;;?[ \t]*[^ \t]+\\.el[ \t]*--"
      "^;;;?[ \t]*\\([^ \t]+\\.el\\)[ \t]+ends here"
```

PS: This patch is highlighted properly in Gnus when the same patch is applied.