Merge changes made in Gnus trunk.
[bpt/emacs.git] / lisp / gnus / mm-decode.el
index 7562e57..e98d666 100644 (file)
         ,disposition ,description ,cache ,id))
 
 (defcustom mm-text-html-renderer
-  (cond ((executable-find "w3m") 'gnus-article-html)
+  (cond ((fboundp 'libxml-parse-html-region) 'mm-shr)
+       ((executable-find "w3m") 'gnus-article-html)
        ((executable-find "links") 'links)
        ((executable-find "lynx") 'lynx)
        ((locate-library "w3") 'w3)
@@ -1674,6 +1675,14 @@ If RECURSIVE, search recursively."
         (and (eq (mm-body-7-or-8) '7bit)
              (not (mm-long-lines-p 76))))))
 
+(defun mm-shr (handle)
+  (let ((article-buffer (current-buffer)))
+    (unless handle
+      (setq handle (mm-dissect-buffer t)))
+    (shr-insert-document
+     (mm-with-part handle
+       (libxml-parse-html-region (point-min) (point-max))))))
+
 (provide 'mm-decode)
 
 ;;; mm-decode.el ends here