From 4ef6bfccf2db22374ed43aaa6feebc2a3af60d64 Mon Sep 17 00:00:00 2001 From: Rahguzar Date: Wed, 25 Oct 2023 15:20:29 +0200 Subject: [PATCH 5/5] Don't insert subscript on a newline * lisp/net/shr.el (shr-tag-sub): see above --- lisp/net/shr.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 38a79107f68..3e022df236c 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1451,6 +1451,13 @@ shr-tag-sup (add-face-text-property start (point) 'shr-sup))) (defun shr-tag-sub (dom) + ;; Why would a subscript be at the beginning of a line? It does + ;; happen sometimes because of a
tag and the intent seems to be + ;; alignment of subscript and superscript but I don't think that is + ;; possible in Emacs. So we remove the newline in that case. + (when (bolp) + (forward-char -1) + (delete-char 1)) (let ((start (point))) (shr-generic dom) (put-text-property start (point) 'display `(raise ,shr-sub-raise-factor)) -- 2.42.0