From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#63518: 28.2; shr.el seems to break inline latex (mathjax) in html Date: Mon, 15 May 2023 17:29:36 +0300 Message-ID: <83cz311xdb.fsf@gnu.org> References: <13cc2bdf-67fc-9e2f-ba01-cbf2bb3e1624@riseup.net> <83ednh1yno.fsf@gnu.org> <6843949b-5e22-de5e-2e6f-e9e951bbe1ff@riseup.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17883"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63518@debbugs.gnu.org To: mousebot Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 15 16:30:26 2023 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 1pyZDW-0004VX-F2 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 May 2023 16:30:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pyZDA-00065f-VD; Mon, 15 May 2023 10:30:04 -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 1pyZD8-000656-Sb for bug-gnu-emacs@gnu.org; Mon, 15 May 2023 10:30:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pyZD8-0004Cf-Gx for bug-gnu-emacs@gnu.org; Mon, 15 May 2023 10:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pyZD8-0001A7-BM for bug-gnu-emacs@gnu.org; Mon, 15 May 2023 10:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 May 2023 14:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63518 X-GNU-PR-Package: emacs Original-Received: via spool by 63518-submit@debbugs.gnu.org id=B63518.16841609824417 (code B ref 63518); Mon, 15 May 2023 14:30:02 +0000 Original-Received: (at 63518) by debbugs.gnu.org; 15 May 2023 14:29:42 +0000 Original-Received: from localhost ([127.0.0.1]:44114 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pyZCo-00019A-03 for submit@debbugs.gnu.org; Mon, 15 May 2023 10:29:42 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46952) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pyZCj-00018t-Tk for 63518@debbugs.gnu.org; Mon, 15 May 2023 10:29:40 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pyZCe-00049l-3y; Mon, 15 May 2023 10:29:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ssQ3Dr8HNPAFbh1VYBwsfixmghRsiYgk0ThfPPTUjEY=; b=QYF0oNVxjRj+ 9fx8Cnlqh4uPdpMWYHnJU1m9FWSt/PU15yVyFgVEZ1R/l0ZxMX0/gx24gYblD9sKGZ5HCOVtrfg+i SnlmH+BRPeVmQ78N4/q10tIpfTzqR6zqgBW4/ALlAxbV2H+0cw/xC+/HppJiTykgtG8nZglHAaCwY N7GUJw+cr2ZLRtbS6osCLiLTMrODrbJbD8w6yDUxZ9io7cyg4rV+AIp1CCMbBjQkGCxkG3KuQ0hgQ gQgLoaBEuDWwllFoAkpvYdQXWo8+/+EGD+lqB1I6Vk/pB1lm7YtTL4UACJYgcoe6dHgFN2FWhERhB aS8yEC3ZgGVJgW76omt9FA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pyZCd-0006j4-Jb; Mon, 15 May 2023 10:29:31 -0400 In-Reply-To: <6843949b-5e22-de5e-2e6f-e9e951bbe1ff@riseup.net> (message from mousebot on Mon, 15 May 2023 16:14:47 +0200) 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:261743 Archived-At: [Please use Reply All to keep the bug tracker CC'ed.] > Date: Mon, 15 May 2023 16:14:47 +0200 > From: mousebot > > Thanks for your response Eli. > > Yes, I'm aware of that the function does that. What I meant is I don't understand how the kinsoku functions in the when clause work, so I don't feel qualified to hack around with them. > > > > > The question is whether we can reliably determine that we are inside > > inline latex, so that we augment the conditions for a break point. > > Turning that off unconditionally is not an option. Do you happen to > > know about some criteria to be applied to distinguish this special > > case? > > I wondered if we couldn't modify the functionality to flag that the html being rendered (may) contain inline latex? (An optional argument say, so that it only tries to render inline latex if specified.) The problem is that HTML that includes inline latex can also include other text that needs the kinsoku treatment. So this cannot be a global flag, it must be raised only while processing the inline latex part. > Re inline latex, I don't know much about it myself. From what I have seen on the mathjax website and the examples in the thread I shared, it is enclosed in \[...\] or \(...\). I also read that it can be enclosed in $...$, but I haven't seen that on mathstodon.xyz. > > I wrote a (probably *un*reliable!) fill-predicate function with regexes, one set to check if we were in between the \ and ( or [, and one to check if we were somewhere in between a \( or \[ and a \) or \]. But then I realized that shr seemingly doesn't working with fill-predicates, but makes its own filling decisions. >