(shr-insert): Don't leave trailing spaces.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Thu, 7 Oct 2010 13:24:43 +0000 (15:24 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Thu, 7 Oct 2010 13:24:43 +0000 (15:24 +0200)
lisp/ChangeLog
lisp/shr.el

index ee85479..eb5accd 100644 (file)
@@ -3,6 +3,7 @@
        * shr.el (shr-render-td): Use a cache for the table rendering function
        to avoid getting an exponential rendering behaviour in nested tables.
        (shr-insert): Rework the line-breaking algorithm.
+       (shr-insert): Don't leave trailing spaces.
 
 2010-10-07  Katsumi Yamaoka  <yamaoka@jpl.org>
 
index 6124ff7..9acb557 100644 (file)
@@ -208,7 +208,9 @@ redirects somewhere else."
            (when (> shr-indentation 0)
              (shr-indent))
            (end-of-line)))
-       (insert " "))))))
+       (insert " "))
+      (unless (string-match "[ \t\n]\\'" text)
+       (delete-char -1))))))
 
 (defun shr-ensure-newline ()
   (unless (zerop (current-column))