From a720473ad1001d3a72f9b3f3155f5488726cabde Mon Sep 17 00:00:00 2001 From: Nick Drozd Date: Mon, 1 Jul 2019 23:46:10 -0500 Subject: [PATCH] Handle 'abbr' and 'acronym' tags in shr.el * lisp/net/shr.el: Add 'abbr' and 'acronym' tag handling. * etc/NEWS: Announce change in shr behavrior. --- etc/NEWS | 3 +++ lisp/net/shr.el | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index abbece374a..464dae2454 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -989,6 +989,9 @@ This attribute is meant to tell screen readers to ignore a tag. --- *** The tag is now handled. +--- +*** The and tags are now handled. + ** Htmlfontify *** The functions 'hfy-color', 'hfy-color-vals' and diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 7fdb3212d4..3af3db637a 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1470,6 +1470,21 @@ shr-tag-a (when url (shr-urlify (or shr-start start) (shr-expand-url url) title)))) +(defun shr-tag-abbr (dom) + (let ((title (dom-attr dom 'title)) + (start (point))) + (shr-generic dom) + (shr-add-font start (point) 'diary) + (add-text-properties + start (point) + (list + 'help-echo title + 'mouse-face 'highlight)))) + +(defun shr-tag-acronym (dom) + ;; `acronym' is deprecated in favor of `abbr'. + (shr-tag-abbr dom)) + (defun shr-tag-object (dom) (unless shr-inhibit-images (let ((start (point)) -- 2.17.1