projects
/
gnus
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* shr.el (shr-insert): Don't insert double spaces.
[gnus]
/
lisp
/
shr.el
diff --git
a/lisp/shr.el
b/lisp/shr.el
index
ff3474c
..
daafa61
100644
(file)
--- a/
lisp/shr.el
+++ b/
lisp/shr.el
@@
-30,6
+30,7
@@
;;; Code:
;;; Code:
+(eval-when-compile (require 'cl))
(require 'browse-url)
(defgroup shr nil
(require 'browse-url)
(defgroup shr nil
@@
-187,7
+188,8
@@
redirects somewhere else."
(let ((first t)
column)
(when (and (string-match "\\`[ \t\n]" text)
(let ((first t)
column)
(when (and (string-match "\\`[ \t\n]" text)
- (not (bolp)))
+ (not (bolp))
+ (not (eq (char-after (1- (point))) ? )))
(insert " "))
(dolist (elem (split-string text))
(when (and (bolp)
(insert " "))
(dolist (elem (split-string text))
(when (and (bolp)
@@
-404,11
+406,14
@@
Return a string with image data."
(defun shr-tag-ul (cont)
(shr-ensure-paragraph)
(let ((shr-list-mode 'ul))
(defun shr-tag-ul (cont)
(shr-ensure-paragraph)
(let ((shr-list-mode 'ul))
- (shr-generic cont)))
+ (shr-generic cont))
+ (shr-ensure-paragraph))
(defun shr-tag-ol (cont)
(defun shr-tag-ol (cont)
+ (shr-ensure-paragraph)
(let ((shr-list-mode 1))
(let ((shr-list-mode 1))
- (shr-generic cont)))
+ (shr-generic cont))
+ (shr-ensure-paragraph))
(defun shr-tag-li (cont)
(shr-ensure-newline)
(defun shr-tag-li (cont)
(shr-ensure-newline)
@@
-445,6
+450,10
@@
Return a string with image data."
(defun shr-tag-h6 (cont)
(shr-heading cont))
(defun shr-tag-h6 (cont)
(shr-heading cont))
+(defun shr-tag-hr (cont)
+ (shr-ensure-newline)
+ (insert (make-string shr-width ?-) "\n"))
+
;;; Table rendering algorithm.
;; Table rendering is the only complicated thing here. We do this by
;;; Table rendering algorithm.
;; Table rendering is the only complicated thing here. We do this by
@@
-540,8
+549,8
@@
Return a string with image data."
(aset natural-widths i (max (aref natural-widths i)
(cadr column)))
(setq i (1+ i)))))
(aset natural-widths i (max (aref natural-widths i)
(cadr column)))
(setq i (1+ i)))))
- (let ((extra (- (
reduce '+ suggested-widths
)
- (
reduce '+ widths
)))
+ (let ((extra (- (
apply '+ (append suggested-widths nil)
)
+ (
apply '+ (append widths nil)
)))
(expanded-columns 0))
(when (> extra 0)
(dotimes (i length)
(expanded-columns 0))
(when (> extra 0)
(dotimes (i length)