summaryrefslogtreecommitdiff
path: root/mu4e
diff options
context:
space:
mode:
authorChristophe Troestler <Christophe.Troestler@umons.ac.be>2019-04-21 21:58:42 +0200
committerChristophe Troestler <Christophe.Troestler@umons.ac.be>2019-04-21 21:59:10 +0200
commit325c6235759f87512ad56f48348b0ba43e210e7b (patch)
treec86bafef778620355604d2d4c00b23add9ff9638 /mu4e
parent2a8c57e56d4f6502ffd9b57605708157f1894260 (diff)
Escape HTML entities
Diffstat (limited to 'mu4e')
-rw-r--r--mu4e/mu4e-actions.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/mu4e/mu4e-actions.el b/mu4e/mu4e-actions.el
index 8e4b245..4523c1b 100644
--- a/mu4e/mu4e-actions.el
+++ b/mu4e/mu4e-actions.el
@@ -79,9 +79,14 @@ Works for the message view."
(replace-regexp-in-string "[[:cntrl:]]" "" (car c))))
(email (when (cdr c)
(replace-regexp-in-string "[[:cntrl:]]" "" (cdr c))))
- (short (or name email)) ;; name may be nil
- (long (if name (format "%s <%s>" name email) email)))
- (if mu4e-view-show-addresses long short)))
+ (addr (if mu4e-view-show-addresses
+ (if name (format "%s <%s>" name email) email)
+ (short (or name email)))) ;; name may be nil
+ ;; Escape HTML entities
+ (addr (replace-regexp-in-string "&" "&amp;" addr))
+ (addr (replace-regexp-in-string "<" "&lt;" addr))
+ (addr (replace-regexp-in-string ">" "&gt;" addr)))
+ addr))
(mu4e-message-field msg field) ", "))
(defun mu4e~write-body-to-html (msg)