From 610680a8d38f3895e8e39caf60c2d937d9d33d8e Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 31 Oct 2021 16:20:10 +0100 Subject: [PATCH] Fix rendering of title-less tags in shr * lisp/net/shr.el (shr-tag-abbr): Render tags that have no title (bug#51525). --- lisp/net/shr.el | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lisp/net/shr.el b/lisp/net/shr.el index a8e15c1e0ae..f33272fad85 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1574,15 +1574,14 @@ ones, in case fg and bg are nil." (shr-urlify (or shr-start start) (shr-expand-url url) title)))) (defun shr-tag-abbr (dom) - (when-let* ((title (dom-attr dom 'title)) - (start (point))) + (let ((title (dom-attr dom 'title)) + (start (point))) (shr-generic dom) (shr-add-font start (point) 'shr-abbreviation) - (add-text-properties - start (point) - (list - 'help-echo title - 'mouse-face 'highlight)))) + (when title + (add-text-properties start (point) + (list 'help-echo title + 'mouse-face 'highlight))))) (defun shr-tag-acronym (dom) ;; `acronym' is deprecated in favor of `abbr'. -- 2.39.5