shr: Do not change state to nil if we just inserting spaces
authorJulien Danjou <julien@danjou.info>
Mon, 11 Oct 2010 16:53:16 +0000 (18:53 +0200)
committerJulien Danjou <julien@danjou.info>
Mon, 11 Oct 2010 16:53:16 +0000 (18:53 +0200)
Signed-off-by: Julien Danjou <julien@danjou.info>
lisp/ChangeLog
lisp/shr.el

index cca2848..cf4a077 100644 (file)
@@ -3,6 +3,8 @@
        * shr.el (shr-hr-line): Add.
        (shr-tag-hr): Use shr-hr-line to specify which character to use to
        display hr lines.
+       (shr-max-columns): Do not change state to nil if we just inserting
+       spaces.
 
 2010-10-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
index 86cbf31..2ad49dd 100644 (file)
@@ -193,7 +193,8 @@ redirects somewhere else."
       (shr-descend sub)))))
 
 (defun shr-insert (text)
-  (when (eq shr-state 'image)
+  (when (and (eq shr-state 'image)
+             (not (string-match "^\\s-*$" text)))
     (insert "\n")
     (setq shr-state nil))
   (cond