summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen <larsi@gnus.org>2015-02-10 16:54:13 +1100
committerLars Magne Ingebrigtsen <larsi@gnus.org>2015-02-10 16:54:13 +1100
commit50f64a3653f4b55b2ef39970120a9445dcafabed (patch)
treecac4fe597842528dca7605ab4d807baf8ddb4306
parent6a319400ccb77f7783db793bbb114d8df47bde3e (diff)
downloademacs-50f64a3653f4b55b2ef39970120a9445dcafabed.tar.gz
(shr-tag-hr): Compute the right length when using fonts.
-rw-r--r--lisp/ChangeLog1
-rw-r--r--lisp/net/shr.el8
2 files changed, 7 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c4c329ef5ce..035cdd9e809 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -34,6 +34,7 @@
(shr-dom-max-natural-width): New function.
(shr-tag-h1): Don't use variable-pitch fonts on fontless rendering.
(shr-tag-tt): New function.
+ (shr-tag-hr): Compute the right length when using fonts.
2015-02-10 Fabián Ezequiel Gallina <fgallina@gnu.org>
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index e929f48b5fd..aa4c2227def 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -1476,8 +1476,12 @@ The preference is a float determined from `shr-prefer-media-type'."
(defun shr-tag-hr (_dom)
(shr-ensure-newline)
- ;; FIXME: Should try to make a line of the required pixel size.
- (insert (make-string (window-width) shr-hr-line) "\n"))
+ (insert (make-string (if (not shr-use-fonts)
+ shr-internal-width
+ (1+ (/ shr-internal-width
+ shr-table-separator-pixel-width)))
+ shr-hr-line)
+ "\n"))
(defun shr-tag-title (dom)
(shr-heading dom 'bold 'underline))