* shr.el (shr-tag-img): Don't align images.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 16 Oct 2010 18:03:44 +0000 (20:03 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 16 Oct 2010 18:03:44 +0000 (20:03 +0200)
Since we're not rescaling, this often leads to ugly displays.

lisp/ChangeLog
lisp/shr.el

index 1a66ec9..36ba67e 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * shr.el (shr-tag-img): Don't align images -- since we're not
+       rescaling, this often leads to ugly displays.
+
 2010-10-15  Andrew Cohen  <cohen@andy.bu.edu>
 
        * gnus-sum.el (gnus-summary-refer-thread): unconditionally ignore
index 6499b35..998ad30 100644 (file)
@@ -426,27 +426,7 @@ Return a string with image data."
               (not (eq shr-state 'image)))
       (insert "\n"))
     (let ((alt (cdr (assq :alt cont)))
-         (url (cdr (assq :src cont)))
-         (width (cdr (assq :width cont))))
-      ;; Only respect align if width specified.
-      (when width
-       ;; Check that width is not larger than max width, otherwise ignore
-       ;; align
-       (let ((max-width (* shr-width (frame-char-width)))
-             (width (string-to-number width)))
-         (when (< width max-width)
-           (let ((align (cdr (assq :align cont))))
-             (cond
-              ((string= align "right")
-               (insert (propertize
-                        " " 'display
-                        `(space . (:align-to
-                                   ,(list (- max-width width)))))))
-              ((string= align "center")
-               (insert (propertize
-                        " " 'display
-                        `(space . (:balign-to
-                                   ,(list (- (/ max-width 2) width))))))))))))
+         (url (cdr (assq :src cont))))
       (let ((start (point-marker)))
        (when (zerop (length alt))
          (setq alt "[img]"))