shr.el (shr-column-specs): Protect against TDs with "width: 0%".

This commit is contained in:
Lars Magne Ingebrigtsen 2012-02-25 13:20:57 +00:00 committed by Katsumi Yamaoka
parent 91027d08b5
commit 5d8522565e
2 changed files with 8 additions and 4 deletions

View 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-23 Katsumi Yamaoka <yamaoka@jpl.org>
* nntp.el (nntp-send-authinfo): Work for secure nntp entry in authinfo.

View file

@ -1364,10 +1364,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))