From b3c93a02c20069c4b26982620cf1915cad881ddc Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Mon, 4 Oct 2010 21:04:19 +0200 Subject: [PATCH] * shr.el (shr-render-td): Protect against too-wide text. --- lisp/ChangeLog | 4 ++++ lisp/shr.el | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ba752c59b..3ce2eebd8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2010-10-04 Lars Magne Ingebrigtsen + + * shr.el (shr-render-td): Protect against too-wide text. + 2010-10-04 Julien Danjou * gravatar.el (gravatar-retrieved): Kill buffer when gravatar has been diff --git a/lisp/shr.el b/lisp/shr.el index 857a51c9e..ca7d8bfc4 100644 --- a/lisp/shr.el +++ b/lisp/shr.el @@ -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))))) -- 2.25.1