summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-09-22 15:10:30 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-09-22 16:02:42 +0200
commit69b5d5431157fdb6e83ca94b9e48cef0586ec902 (patch)
treeac3e7e53c165c8cdbb0e5c603157105054da0b17
parentde6844b62468258b3dc89ba40fc63480dc4d854c (diff)
downloademacs-69b5d5431157fdb6e83ca94b9e48cef0586ec902.tar.gz
Fix filling problem in shr due to zero-width id tagging
* lisp/net/shr.el (shr-descend): Fix problem with filling lines that have a zero-width ID tag at the start.
-rw-r--r--lisp/net/shr.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index dcb64155d4b..efa1dba9536 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -555,7 +555,10 @@ size, and full-buffer size."
;; If the element was empty, we don't have anything to put the
;; anchor on. So just insert a dummy character.
(when (= start (point))
- (insert ? )
+ (if (not (bolp))
+ (insert ? )
+ (insert ? )
+ (shr-mark-fill start))
(put-text-property (1- (point)) (point) 'display ""))
(put-text-property start (1+ start) 'shr-target-id id))
;; If style is set, then this node has set the color.