From 50f64a3653f4b55b2ef39970120a9445dcafabed Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Tue, 10 Feb 2015 16:54:13 +1100 Subject: [PATCH] (shr-tag-hr): Compute the right length when using fonts. --- lisp/ChangeLog | 1 + lisp/net/shr.el | 8 ++++++-- 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 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)) -- 2.39.2