unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50763: Markdown blocks in Gnus messages
@ 2021-09-23 15:47 Juri Linkov
  2021-09-23 21:19 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Juri Linkov @ 2021-09-23 15:47 UTC (permalink / raw)
  To: 50763

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.





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#50763: Markdown blocks in Gnus messages
  2021-09-23 15:47 bug#50763: Markdown blocks in Gnus messages Juri Linkov
@ 2021-09-23 21:19 ` Lars Ingebrigtsen
  2021-09-24  6:45   ` Juri Linkov
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-23 21:19 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 50763

Juri Linkov <juri@linkov.net> writes:

> 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:

Makes sense to me; please go ahead and push.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#50763: Markdown blocks in Gnus messages
  2021-09-23 21:19 ` Lars Ingebrigtsen
@ 2021-09-24  6:45   ` Juri Linkov
  0 siblings, 0 replies; 3+ messages in thread
From: Juri Linkov @ 2021-09-24  6:45 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 50763

tags 50763 fixed
close 50763 28.0.50
quit

>> 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:
>
> Makes sense to me; please go ahead and push.

Pushed and closed.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-24  6:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-23 15:47 bug#50763: Markdown blocks in Gnus messages Juri Linkov
2021-09-23 21:19 ` Lars Ingebrigtsen
2021-09-24  6:45   ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).