unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Augusto Stoffel <arstoffel@gmail.com>
To: Jeremy Bryant <jb@jeremybryant.net>
Cc: Eli Zaretskii <eliz@gnu.org>, Sacha Chua <sacha@sachachua.com>,
	73641@debbugs.gnu.org
Subject: bug#73641: 30.0.90; Math in EWW/shr
Date: Sat, 12 Oct 2024 16:24:12 +0200	[thread overview]
Message-ID: <87plo5jt6b.fsf@gmail.com> (raw)
In-Reply-To: <878quvln9c.fsf@jeremybryant.net> (Jeremy Bryant's message of "Thu, 10 Oct 2024 21:24:31 +0100")

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

On Thu, 10 Oct 2024 at 21:24, Jeremy Bryant wrote:

> As this is related to shr and displaying svg images, this reminds me of
> a patch of Sacha earlier this year.
>
> Perhaps Sacha you have a suggestion on this?

Independent of that, I've attached a patch containing the "baseline"
action that can be later refined.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-shr.el-Define-rendering-rule-for-math-tag.patch --]
[-- Type: text/x-patch, Size: 989 bytes --]

From 8b772c709eb8527fd8e7ebfab65980d64dfa2f02 Mon Sep 17 00:00:00 2001
From: Augusto Stoffel <arstoffel@gmail.com>
Date: Sat, 12 Oct 2024 16:20:47 +0200
Subject: [PATCH] shr.el: Define rendering rule for math tag

* lisp/net/shr.el (shr-tag-math): New function, see bug#73641.
---
 lisp/net/shr.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index f1062acf7e4..fff478a69c9 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -2264,6 +2264,15 @@ shr-tag-bdi
   (shr-generic dom)
   (insert ?\N{POP DIRECTIONAL ISOLATE}))
 
+(defun shr-tag-math (dom)
+  ;; Display an annotation (typically TeX notation) if available.
+  (shr-generic
+   (thread-first
+     dom
+     (dom-child-by-tag 'semantics)
+     (dom-child-by-tag 'annotation)
+     (or dom))))
+
 ;;; Outline Support
 (defun shr-outline-search (&optional bound move backward looking-at)
   "A function that can be used as `outline-search-function' for rendered html.
-- 
2.46.2


  reply	other threads:[~2024-10-12 14:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-05 14:01 bug#73641: 30.0.90; Math in EWW/shr Augusto Stoffel
2024-10-05 15:24 ` Eli Zaretskii
2024-10-10  6:41   ` Augusto Stoffel
2024-10-10  7:43     ` Eli Zaretskii
2024-10-10 10:49       ` Augusto Stoffel
2024-10-10 11:34         ` Eli Zaretskii
2024-10-10 20:24           ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-12 14:24             ` Augusto Stoffel [this message]
2024-10-12 15:07               ` Eli Zaretskii
2024-10-12 17:13                 ` Augusto Stoffel
2024-10-12 18:16                   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87plo5jt6b.fsf@gmail.com \
    --to=arstoffel@gmail.com \
    --cc=73641@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jb@jeremybryant.net \
    --cc=sacha@sachachua.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).