diff options
| author | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2026-04-02 19:45:48 +0300 |
|---|---|---|
| committer | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2026-04-02 19:45:48 +0300 |
| commit | 6911b452531f4bec3a6af9682702d4c91290a115 (patch) | |
| tree | 088d5b88961cf48f9db91e4627158ea64315b0ee | |
| parent | 08d669d9b515ac5a8a960c466a94413795196cec (diff) | |
mu4e-view: don't make clickables when already
Don't make clickable links when displaying in html mode already, since
in that case the html-render handles it, and we shouldn't mess up the
display.
As discussed in issue #2094.
| -rw-r--r-- | mu4e/mu4e-view.el | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el index 418d7f7..13849d3 100644 --- a/mu4e/mu4e-view.el +++ b/mu4e/mu4e-view.el @@ -543,11 +543,19 @@ determine which browser function to use." (xwidget-webkit-browse-url url)))) (mu4e-action-view-in-browser msg))) +(defun mu4e--view-html-displayed-p () + "Is any text/html MIME part currently displayed? +Uses the MIME handle alist populated by Gnus after rendering." + (seq-find (lambda (handle) + (and (equal (mm-handle-media-type (cdr handle)) "text/html") + (mm-handle-displayed-p (cdr handle)))) + gnus-article-mime-handle-alist)) + (defun mu4e--view-render-buffer (msg) "Render current buffer with MSG using Gnus' article mode. The buffer must already contain the raw message. This function decodes and displays it, sets up the original-article-buffer, and -activates URLs." +activates URLs (in plain-text mode only)." (let* ((inhibit-read-only t) ;; Let gnus-summary-buffer be nil; all gnus-art.el code ;; guards its usage with `gnus-buffer-live-p' or @@ -585,7 +593,11 @@ activates URLs." ;; just continue if some of the decoding fails. (ignore-errors (run-hooks 'gnus-article-decode-hook)) (gnus-article-prepare-display) - (mu4e--view-activate-urls) + ;; Only activate URLs in plain-text mode; in HTML mode + ;; the renderer already provides its own clickable links + ;; (#2094). + (unless (mu4e--view-html-displayed-p) + (mu4e--view-activate-urls)) (kill-local-variable 'bookmark-make-record-function) (setq mu4e~gnus-article-mime-handles gnus-article-mime-handles gnus-article-decoded-p gnus-article-decode-hook) |
