From: Lars Ingebrigtsen Date: Fri, 1 Jul 2022 11:45:52 +0000 (+0200) Subject: Add support for in shr X-Git-Tag: emacs-29.0.90~1447^2~1299 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=474f5b21b43efd4c2f60bfdfa385c8b522bf12c8;p=emacs.git Add support for in shr * lisp/net/shr.el (shr-mark): New face (bug#48211). (shr-tag-mark): New function --- diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 0645f4721a3..63f313bbf44 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -232,6 +232,11 @@ temporarily blinks with this face." "Face used for rendering blocks." :version "29.1") +(defface shr-mark + '((t :background "yellow" :foreground "black")) + "Face used for 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")