From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id TSwfNaKsjGSOhwAASxT56A (envelope-from ) for ; Fri, 16 Jun 2023 20:40:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id uVoTNKKsjGSLQwAAauVa8A (envelope-from ) for ; Fri, 16 Jun 2023 20:40:34 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 722B91044F for ; Fri, 16 Jun 2023 20:40:34 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qAEMK-0000SP-NX; Fri, 16 Jun 2023 14:39:44 -0400 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 1qAEMJ-0000S6-JR for emacs-orgmode@gnu.org; Fri, 16 Jun 2023 14:39:43 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAEMH-00012W-KL for emacs-orgmode@gnu.org; Fri, 16 Jun 2023 14:39:43 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 834F2240104 for ; Fri, 16 Jun 2023 20:39:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1686940778; bh=s93xrshOHHQR7QgNHEUM8c/6ZZ7fJREM6nCdLj73SUE=; h=MIME-Version:Content-Transfer-Encoding:Date:From:To:Cc:Subject: Message-ID:From; b=FFsXO5E2UMbOeXaLhehB4t1tUGbm2GER3uXXtjzikk6guokU3uY8c3esinTU0zM/v DiU0Ad7uDNDK4sT3f9+4OiZjTY0Zud8SJCO8/Fa1kxjbPr3sfHM/XFAHcjDmCpJ0vs x7LDK3Wp1jBjPKh0/iyG/9omCN6y2sNGsaY1tK7GNjFE8iCq6+jvBZgbJ13T5Mu+SK ZWjZJsMeZaw6F0nsoZFOeX5PukR66Vffa/EhWzC57M29yLIEZplqkUjBu17JhzLd4B q9VdM9ZDG2Fm0spP3Mb/cnOp6+h1MrpPaFAcJh0+s3w8j7XakOClbrrAvJECfxXB1F 5ZszAfY0d7Ljg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QjScn5fbxz6tvq; Fri, 16 Jun 2023 20:39:37 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 16 Jun 2023 18:39:37 +0000 From: gerard.vermeulen@posteo.net To: Ihor Radchenko Cc: Christian Moe , emacs-orgmode@gnu.org, Timothy , Maxim Nikulin Subject: Re: [PATCH] ox-html.el: add option to embed SVG for CSS support in SVG In-Reply-To: <87ilbojvo3.fsf@localhost> References: <871qip3u90.fsf@localhost> <87fs74j4la.fsf@christianmoe.com> <87cz27eka4.fsf@localhost> <87h6rjqr9y.fsf@christianmoe.com> <87v8fznojo.fsf@localhost> <87ilbojvo3.fsf@localhost> Message-ID: <9b465212b65965ed4fe03df346367c8d@posteo.net> Received-SPF: pass client-ip=185.67.36.66; envelope-from=gerard.vermeulen@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1686940834; a=rsa-sha256; cv=none; b=IiNXD3U0uB5mIq6ZJi/0jqbUmAu8rh082eTgXyMQAEtqpvCE6PfXrdW5LrTf2zDX2niI5D +Ty4Ym/zidxoMAvJenSRJESym/kka/Q72VrRMeAwyukL6Gg6TDoRHaHn0FVC9oHy/HRe8k h1bDJU2bATTOY+VShO6yHh15gYRjahpa8glAjEEBt5pF3LH6DpU43vp3Ek1V8NjRn6jRCF mTCHUm8VIYLU0XY6eLmZcZjJjqvoiXy74JYRa910gfGnS9ewHLILU5TqGudRW1pvDbyZH3 wljcWWVqi6NNT3a1RQsb/ywOms31yMjvN334cikGjZowmtg4NtCwHQwsafvx4g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=FFsXO5E2; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1686940834; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=gnwkIYnfa5CoBHMc3cafghEZHwov2ULebHRjZb5Ndf8=; b=nUrb1F8NAO2vTmCSUb7gUqu6l9aTnfJK5UhY7sgp2jMaUe1AOmf50KJ4/vVvvmykVw8wnz s70dsO08v7VbtYAdapxAEJD637iiaCbnhPYRxg7loa3iAnMPZLrU7wrQGhkJhthfeeg6Z8 4IZ5pHB+2owrfzrgImReyafKZ6IUeCUyvBCyuqRIzUGz4KBu4NhbRYACfLfoNUCQodUEXq 7jr30nYksY0K10PRYUeE9fo3W4CXanD1bsRokKopvSC3qUPrt3n2UKR7lOI/Os58Xg6c3o dpxRy7rVefD8XmnxyU60BGHVC2390/0g564Ii6lBARuonhZ3BPb/AhOgbKE6iw== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=FFsXO5E2; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -8.80 X-Spam-Score: -8.80 X-Migadu-Queue-Id: 722B91044F X-TUID: cO7fthn9m+sf On 15.06.2023 22:51, Ihor Radchenko wrote: > gerard.vermeulen@posteo.net writes: > >> On 07.06.2023 19:57, Ihor Radchenko wrote: > I am not expert in html. Maybe someone else (Timothy?) can chime in. > > That said, I do not see why we cannot offer strategy as an > option regardless whether is can solve the problem with CSS. > >> ;; For each SVG image during HTML export: >> ;; 1. It checks `svg-as-object' and "image in-lining" whether to >> ;; embed the SVG image in an tag. >> ;; 2. If not, it checks `svg-inclusion' and "image in-lining" >> ;; whether to copy the SVG contents to the HTML output. >> ;; 3. If not, it falls back to checking "image in-lining" whether to >> ;; embed the SVG image in an tag (as any other image type). >> ;; 4. It is possible to set `svg-as-object' and/or `svg-inclusion': >> ;; - For each SVG link by means of "#+ATTR_HTML: :svg-as-object t" >> ;; or "#+ATTR_HTML: :svg-inclusion t". >> ;; - Within file scope by means of "#+OPTIONS: svg-as-object:t" or >> ;; "#+OPTIONS: svg-inclusion:t". >> ;; - Within toplevel scope by means of the options >> ;; `org-html-svg-as-object' or `org-html-svg-inclusion'. > > I think you missed `org-html-inline-image-rules' where users can > include/exclude svg images from inlining. The term "image in-lining" is a very terse description of what my code does. In case of rules 1, 2, and 3 above: the code takes into account the two relevant options `org-html-inline-image' and `org-html-inline-image-rules' to decide whether the image would be in-lined in an tag. For rule 1 above: in case `svg-as-object' is also true, the code in-lines the image in an tag instead of an tag and returns the tag. In case `svg-as-object' is nil, apply rule 2. For rule 2 above: in case `svg-inclusion' is also true, return the SVG contents as a result. In case `svg-inclusion' is nil, apply rule 3. Rule 3 is applied by the normal "Image file" handling code from org-html-link in ox-html which handles `org-html-image-inline-rules', but my code for rules 1 and 2 do too. My clone of org-html-link is a copy with the exception that I added 4 lines of code (and 2 lines of comments) to implement the rules 1 and 2 (but we should not implement rule 2). Before going ahead with a patch to in-line images in tags, there remains the question of how to make those tags behave as much as possible as tags. My knowledge of HTML is very thin and Javascript even worse. Best regards -- Gerard