From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.bugs Subject: bug#73641: 30.0.90; Math in EWW/shr Date: Sat, 12 Oct 2024 19:13:48 +0200 Message-ID: <87bjzpjlbn.fsf@gmail.com> References: <87ttdqmywv.fsf@gmail.com> <8634lawp14.fsf@gnu.org> <87bjzsa28z.fsf@gmail.com> <8634l42yiu.fsf@gnu.org> <87ldyw5j2x.fsf@gmail.com> <86r08o19ao.fsf@gnu.org> <878quvln9c.fsf@jeremybryant.net> <87plo5jt6b.fsf@gmail.com> <86zfn9uzpe.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13931"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: jb@jeremybryant.net, sacha@sachachua.com, 73641@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 12 19:16:04 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1szfim-0003Tm-Em for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Oct 2024 19:16:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1szfie-0004hv-KQ; Sat, 12 Oct 2024 13:15:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1szfic-0004hm-LB for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2024 13:15:54 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1szfiV-00074V-US for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2024 13:15:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=Swgbk3s6O22veAMcTvqERnHi/bphhHYZ4YH7ch95EiA=; b=Devxv9hrYZ4C4jTUZyXSg7CgOpu8ni+udqPwglPgOi7VL3MQBoUlp8fSsyJ6RfhI5/K+HGK8/82YPpH/zFHb1Fq/990AoB99n8Z2LreMrg5A0DT8PsJHKd1KGzQmTn/Gc8WiHF1lIxZ9pDGZ2x4Oj0E3x5AHqmuiVhseFQC8Ay4hZNVZTgfSpmcDsNzYxcn/mrarXfOxNO2tZ71WS/PMRSYQ9cJA6a5DzaYCY36O6xd41IEMbCY2upM+WtI8WLh0O2hdoocDmSl9dMRte/2dhzNxkZ83J6HfaLD/WbTfDntwQR48DYa7gHqjDzGZST0Kv3qbUfzcH8+G0lBRxZGgYg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1szfij-0005mX-R1 for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2024 13:16:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Augusto Stoffel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Oct 2024 17:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73641 X-GNU-PR-Package: emacs Original-Received: via spool by 73641-submit@debbugs.gnu.org id=B73641.172875331321667 (code B ref 73641); Sat, 12 Oct 2024 17:16:01 +0000 Original-Received: (at 73641) by debbugs.gnu.org; 12 Oct 2024 17:15:13 +0000 Original-Received: from localhost ([127.0.0.1]:53528 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szfhx-0005dP-2k for submit@debbugs.gnu.org; Sat, 12 Oct 2024 13:15:13 -0400 Original-Received: from mail-ej1-f48.google.com ([209.85.218.48]:51609) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szfhu-0005dA-L5 for 73641@debbugs.gnu.org; Sat, 12 Oct 2024 13:15:11 -0400 Original-Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a93c1cc74fdso472914366b.3 for <73641@debbugs.gnu.org>; Sat, 12 Oct 2024 10:14:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728753230; x=1729358030; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=Swgbk3s6O22veAMcTvqERnHi/bphhHYZ4YH7ch95EiA=; b=DmBHngs6LRrWZtyYRztMVQ+SpF5Y1miQOtJp8I9MP3LQUouMoD8XaB8LZrDj+M8HCG +kT0sQGpob8D57q+qKg4XZVeR3KH2jpPXsuDIGFp+B2yKtdviOuRjWLZjsaYaR9d1sRC +j0smFnEAyHeAGGHTE+fkwWJz87WercJZ4aVfhx2PMluD+zTPooOOPDeg5CQUsq/BUC7 o5HEEng/uJZvHPe582/bTw+pSr0rWWKjpN7DJRXlmFcIFvj+PdcFcpfAWRzwdOybVuwI mNo7553yGEZu8Mh7CCXlLul6Bv5FfxEaRMSCp2eIsLgPEBoZSn43M9wnVWIzNLnRkxB7 aBvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728753230; x=1729358030; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Swgbk3s6O22veAMcTvqERnHi/bphhHYZ4YH7ch95EiA=; b=VejlTq3ocwaJXtY3Lxt0mZcUnnJl6W+nLW91aIdAZW2BsW7h/ht12KMSdspSga4L9J FJPswyoCIzPh0aGHCQo3biY/C5xoDj48BU2MR8onC3RmfMgnhFDBi8LPibWUeEOFK+CR kMuZdhzcQNRJnfalO4oDtqmJTTVaPpM0KJ4hl5fxdL9M3WCvk/r5sdXy+czKKC0uRhzq 1IYi8Z2u7E16apN8ybm+KElOlP4MKgHijMCslMt0Fi2EzsHL8IeAl1y5Fdfjpq4j7vld /RUBUecUZniyDqj6p3XBLMcBU92N56t1TU1K7eVew4/C4Fhd+NYFDL0tYKD1tRlxACN9 trHA== X-Forwarded-Encrypted: i=1; AJvYcCWz5UmJB3VQy44/gyLzKt0eY+V2tI+S0DoRFwD7tGao7USmowuvDBatj0gdSWYtCZyW03AW0A==@debbugs.gnu.org X-Gm-Message-State: AOJu0YywUlYUltgH/gH3Y20Mw5wBXdzrQ4+6tHCmbpFmo4u0mwRtaMqo PFq9vlRHzKa0IlwDU1m25IWlgCv+nEJC1OhMtrennVNOLBlty/fn8olThA== X-Google-Smtp-Source: AGHT+IFSPBaQYqtNrMEYksusmqW3DAEr3JNGRQS4M5fmIRrV0c4dOYq4UXJpUZ0fVe5jjfCD9seHtw== X-Received: by 2002:a17:907:d17:b0:a99:ee42:1f38 with SMTP id a640c23a62f3a-a99ee421fdamr236507766b.31.1728753230197; Sat, 12 Oct 2024 10:13:50 -0700 (PDT) Original-Received: from ars3 ([2a02:8109:8a87:ff00::d6f6]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99a80dd875sm346771066b.178.2024.10.12.10.13.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 10:13:49 -0700 (PDT) In-Reply-To: <86zfn9uzpe.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 12 Oct 2024 18:07:41 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:293468 Archived-At: --=-=-= Content-Type: text/plain On Sat, 12 Oct 2024 at 18:07, Eli Zaretskii wrote: > Thanks, but can we please have a comment here explaining why we do > that? How about this? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-shr.el-Define-rendering-rule-for-math-tag.patch >From 0d3f0ad219e9cd0c9f79113d137cab5bbdeed2e1 Mon Sep 17 00:00:00 2001 From: Augusto Stoffel 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 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lisp/net/shr.el b/lisp/net/shr.el index f1062acf7e4..0c37ef67bbb 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -2264,6 +2264,18 @@ shr-tag-bdi (shr-generic dom) (insert ?\N{POP DIRECTIONAL ISOLATE})) +(defun shr-tag-math (dom) + ;; Sometimes a math element contains a plain text annotation + ;; (typically TeX notation) in addition to MathML markup. If we pass + ;; that to `dom-generic', the formula is printed twice. So we select + ;; only the annotation 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 --=-=-=--