1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-15 09:47:20 +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." "Face used for rendering <code> blocks."
:version "29.1") :version "29.1")
(defface shr-mark
'((t :background "yellow" :foreground "black"))
"Face used for <mark> elements."
:version "29.1")
(defcustom shr-inhibit-images nil (defcustom shr-inhibit-images nil
"If non-nil, inhibit loading images." "If non-nil, inhibit loading images."
:version "28.1" :version "28.1"
@ -1422,6 +1427,14 @@ ones, in case fg and bg are nil."
;; The `tt' tag is deprecated in favor of `code'. ;; The `tt' tag is deprecated in favor of `code'.
(shr-tag-code dom)) (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) (defun shr-tag-ins (cont)
(let* ((start (point)) (let* ((start (point))
(color "green") (color "green")