emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master e1e1bd8: Fix conversion of text/html->multipart/related


From: Lars Ingebrigtsen
Subject: master e1e1bd8: Fix conversion of text/html->multipart/related
Date: Wed, 19 Feb 2020 08:51:52 -0500 (EST)

branch: master
commit e1e1bd8f85c53fea9f61b6ec99b461ddd93461b9
Author: Jeremy Compostella <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Fix conversion of text/html->multipart/related
    
    * lisp/gnus/mml.el (mml-expand-all-html-into-multipart-related):
    New function (bug#39230).
    (mml-generate-mime): Use it to expand all HTML parts, no matter
    where in the MIME tree.
---
 lisp/gnus/mml.el | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index cdd8f3d..3d86c5b 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -487,11 +487,8 @@ type detected."
                 (= (length cont) 1)
                 content-type)
        (setcdr (assq 'type (cdr (car cont))) content-type))
-      (when (and (consp (car cont))
-                (= (length cont) 1)
-                (fboundp 'libxml-parse-html-region)
-                (equal (cdr (assq 'type (car cont))) "text/html"))
-       (setq cont (mml-expand-html-into-multipart-related (car cont))))
+      (when (fboundp 'libxml-parse-html-region)
+       (setq cont (mapcar 'mml-expand-all-html-into-multipart-related cont)))
       (prog1
          (with-temp-buffer
            (set-buffer-multibyte nil)
@@ -510,6 +507,18 @@ type detected."
            (buffer-string))
        (setq message-options options)))))
 
+(defun mml-expand-all-html-into-multipart-related (cont)
+  (cond ((and (eq (car cont) 'part)
+             (equal (cdr (assq 'type cont)) "text/html"))
+        (mml-expand-html-into-multipart-related cont))
+       ((eq (car cont) 'multipart)
+        (let ((cur (cdr cont)))
+          (while (consp cur)
+            (setcar cur (mml-expand-all-html-into-multipart-related (car cur)))
+            (setf cur (cdr cur))))
+        cont)
+       (t cont)))
+
 (defun mml-expand-html-into-multipart-related (cont)
   (let ((new-parts nil)
        (cid 1))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]