1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-14 09:39:42 +00:00

Add support for <mark> in shr

* lisp/net/shr.el (shr-mark): New face (bug#48211).
(shr-tag-mark): New function
This commit is contained in:
Lars Ingebrigtsen 2022-07-01 13:45:52 +02:00
parent 3a4c408a7b
commit 474f5b21b4

View File

@ -232,6 +232,11 @@ temporarily blinks with this face."
"Face used for rendering <code> blocks."
:version "29.1")
(defface shr-mark
'((t :background "yellow" :foreground "black"))
"Face used for <mark> elements."
:version "29.1")
(defcustom shr-inhibit-images nil
"If non-nil, inhibit loading images."
:version "28.1"
@ -1422,6 +1427,14 @@ ones, in case fg and bg are nil."
;; The `tt' tag is deprecated in favor of `code'.
(shr-tag-code dom))
(defun shr-tag-mark (dom)
(when (and (not (bobp))
(not (= (char-after (1- (point))) ?\s)))
(insert " "))
(let ((start (point)))
(shr-generic dom)
(shr-add-font start (point) 'shr-mark)))
(defun shr-tag-ins (cont)
(let* ((start (point))
(color "green")