* shr.el (shr-column-specs): Protect against TDs with "width: 0%".
authorLars Magne Ingebrigtsen <larsi@stories.(none)>
Sat, 25 Feb 2012 11:24:33 +0000 (12:24 +0100)
committerLars Magne Ingebrigtsen <larsi@stories.(none)>
Sat, 25 Feb 2012 11:24:33 +0000 (12:24 +0100)
lisp/ChangeLog
lisp/shr.el

index 33d0f8d..cc7b38d 100644 (file)
@@ -1,3 +1,7 @@
+2012-02-25  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * shr.el (shr-column-specs): Protect against TDs with "width: 0%".
+
 2012-02-20  Lars Ingebrigtsen  <larsi@gnus.org>
 
        * gnus-start.el (gnus-clean-old-newsrc): Allow a FORCE parameter.
index 954e974..7e617f0 100644 (file)
@@ -1423,10 +1423,10 @@ ones, in case fg and bg are nil."
            (when (memq (car column) '(td th))
              (let ((width (cdr (assq :width (cdr column)))))
                (when (and width
-                          (string-match "\\([0-9]+\\)%" width))
-                 (aset columns i
-                       (/ (string-to-number (match-string 1 width))
-                          100.0))))
+                          (string-match "\\([0-9]+\\)%" width)
+                          (not (zerop (setq width (string-to-number
+                                                   (match-string 1 width))))))
+                 (aset columns i (/ width 100.0))))
              (setq i (1+ i)))))))
     columns))