* shr.el (shr-render-td): Protect against too-wide text.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 4 Oct 2010 19:04:19 +0000 (21:04 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 4 Oct 2010 19:04:19 +0000 (21:04 +0200)
lisp/ChangeLog
lisp/shr.el

index ba752c5..3ce2eeb 100644 (file)
@@ -1,3 +1,7 @@
+2010-10-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * shr.el (shr-render-td): Protect against too-wide text.
+
 2010-10-04  Julien Danjou  <julien@danjou.info>
 
        * gravatar.el (gravatar-retrieved): Kill buffer when gravatar has been
index 857a51c..ca7d8bf 100644 (file)
@@ -471,7 +471,8 @@ Return a string with image data."
 
 (defun shr-render-td (cont width fill)
   (with-temp-buffer
-    (let ((shr-width width))
+    (let ((shr-width width)
+         (shr-indentation 0))
       (shr-generic cont))
     (while (re-search-backward "\n *$" nil t)
       (delete-region (match-beginning 0) (match-end 0)))
@@ -485,7 +486,8 @@ Return a string with image data."
        (goto-char (point-min))
        (while (not (eobp))
          (end-of-line)
-         (insert (make-string (- width (current-column)) ? ))
+         (when (> (- width (current-column)) 0)
+           (insert (make-string (- width (current-column)) ? )))
          (forward-line 1)))
       (list max (count-lines (point-min) (point-max)) (buffer-string)))))