[gnus git] branch master updated: m0-3-88-gea43095 =1= Further shr vertical white space fixups
Lars Magne Ingebrigtsen <[email protected]>
| Newsgroups | gmane.emacs.gnus.cvs |
|---|---|
| Message-ID | <[email protected]> |
via ea43095d03f49b57ef853bb54a642c8af13f98a4 (commit)
from ce032b26f290db41cd8ab1b15b722ecf2e1a4e44 (commit)
- Log -----------------------------------------------------------------
commit ea43095d03f49b57ef853bb54a642c8af13f98a4
Author: Lars Magne Ingebrigtsen <[email protected]>
Date: Mon Mar 19 22:34:35 2012 +0100
Further shr vertical white space fixups
(shr-tag-br): Allow <br> to end lines or to make a single blank line.
(shr-ensure-paragraph): Consider lines with white space to be blank.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b35f080..cd294d6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -3,6 +3,8 @@
* shr.el (shr-insert): Treat non-breaking space just like normal
space. This seems to produce more pleasing results.
(shr-insert): Only insert a blank line if we're starting from an image.
+ (shr-tag-br): Allow <br> to end lines or to make a single blank line.
+ (shr-ensure-paragraph): Consider lines with white space to be blank.
2012-03-15 Elias Pipping <[email protected]>
diff --git a/lisp/shr.el b/lisp/shr.el
index 281a7b1..b0cbc1b 100644
--- a/lisp/shr.el
+++ b/lisp/shr.el
@@ -501,7 +501,7 @@ size, and full-buffer size."
(if (save-excursion
(beginning-of-line)
(looking-at " *$"))
- (insert "\n")
+ (delete-region (match-beginning 0) (match-end 0))
(insert "\n\n")))))
(defun shr-indent ()
@@ -1044,7 +1044,12 @@ ones, in case fg and bg are nil."
(shr-generic cont)))
(defun shr-tag-br (cont)
- (unless (bobp)
+ (when (and (not (bobp))
+ ;; Only add a newline if we break the current line, or
+ ;; the previous line isn't a blank line.
+ (or (not (bolp))
+ (and (> (- (point) 2) (point-min))
+ (not (= (char-after (- (point) 2)) ?\n)))))
(insert "\n")
(shr-indent))
(shr-generic cont))
-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.
Summary of changes:
lisp/ChangeLog | 2 ++
lisp/shr.el | 9 +++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".
The branch, master has been updated
hooks/post-receive
--
Gnus Project