Merge remote-tracking branch 'origin/no-gnus'
[gnus] / lisp / mm-decode.el
index 03bcaa1..1278d11 100644 (file)
@@ -659,6 +659,15 @@ Postpone undisplaying of viewers for types in
            (if (equal "text/plain" (car ctl))
                (assoc 'format ctl)
              t))
+    ;; Guess what the type of application/octet-stream parts should
+    ;; really be.
+    (let ((filename (cdr (assq 'filename (cdr cdl)))))
+      (when (and (equal (car ctl) "application/octet-stream")
+                filename
+                (string-match "\\.\\([^.]+\\)$" filename))
+       (let ((new-type (mailcap-extension-to-mime (match-string 1 filename))))
+         (when new-type
+           (setcar ctl new-type)))))
     (let ((handle
           (mm-make-handle
            (mm-copy-to-buffer) ctl cte nil cdl description nil id))
@@ -1763,6 +1772,10 @@ If RECURSIVE, search recursively."
                                    (string-to-number (match-string 2)))
                                  mm-extra-numeric-entities)))
             (replace-match (char-to-string char))))
+        ;; Remove "soft hyphens".
+        (goto-char (point-min))
+        (while (search-forward "­" nil t)
+          (replace-match "" t t))
         (libxml-parse-html-region (point-min) (point-max))))
       (unless (bobp)
        (insert "\n"))