GNU bug report logs - #50763
Markdown blocks in Gnus messages

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Thu, 23 Sep 2021 16:01:01 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Markdown blocks in Gnus messages
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.




This bug report was last modified 3 years and 240 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.