From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id AK0+Hr4Ni2QvvQAASxT56A (envelope-from ) for ; Thu, 15 Jun 2023 15:10:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id yMIuHr4Ni2R/YwEA9RJhRA (envelope-from ) for ; Thu, 15 Jun 2023 15:10:22 +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 563AC2A8A for ; Thu, 15 Jun 2023 15:10:17 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q9mj3-00025S-Jq; Thu, 15 Jun 2023 09:09:21 -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 1q9mj0-00024w-Nr for emacs-orgmode@gnu.org; Thu, 15 Jun 2023 09:09:18 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q9miy-0002QI-8C for emacs-orgmode@gnu.org; Thu, 15 Jun 2023 09:09:18 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A0A1024002B for ; Thu, 15 Jun 2023 15:09:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1686834552; bh=cPEspBF+02QyIgHAbC6kMqwGiFGsmyMaFyCGs+9yDag=; h=MIME-Version:Content-Transfer-Encoding:Date:From:To:Cc:Subject: Message-ID:From; b=VFpOFFiAxhoTzuOCKjxNsm0IZAYMcZ2ltK7X8C0RhmzdauT+aRbAgcMVZMq8pJALB zFiV0SYz3JLYXthW8YP6E+lgoW+fBKIMBJR8vFQ7GeG0bMlC5kHmGNHK/XQj+9Ntv+ TchEo6qAHfAhDrFLjSZ4AL2Ps24gobQH3v9hjImTdjZEySHZyE1S682NqTDucv1YzL BRpWGM6k33PpdYur64iEV1BaSRDgN11vCnjCcHeyE86Uw1HwH08hmTQMuNkQeLDt9b Dn56ohDCp7/mn2JYtLPff414QtWNB5pmvbFHrnbOMhffLCHIHGqGkRyrwkgUSEEsQ3 3vWfgSMpzrg6w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QhjKz5v04z9rxK; Thu, 15 Jun 2023 15:09:11 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 15 Jun 2023 13:09:11 +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: <87v8fznojo.fsf@localhost> References: <871qip3u90.fsf@localhost> <87fs74j4la.fsf@christianmoe.com> <87cz27eka4.fsf@localhost> <87h6rjqr9y.fsf@christianmoe.com> <87v8fznojo.fsf@localhost> Message-ID: Received-SPF: pass client-ip=185.67.36.65; envelope-from=gerard.vermeulen@posteo.net; helo=mout01.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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1686834617; 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=8VxqqGX8j8a+35smeHlGdRZ84I98oX3yjp1ee8XTOSs=; b=nild5/u6uNz+lYbMlvpyuLN/UZ+HsSF0025WfQ8Bv1881isqweF7Z/eWiZwJgTB+YI2HRH /NdT8RyFIjcWQsde1rMZYBr1T00Jx6rxExe4E1pzGxqWp+jbUgG3gvuR7as7Vtw23RSIoI tD8fWj1+S7m+/hvyXyntCI5BGsyZkCghBiNRPUuzYn+sbHG9ZluP/oT2hnzrolTpW80Rq4 iT8EjiFDhFqJr4H7TP7LqU9IEUjzIaQ+nkfJdLd1Mtdzw1zCG+WimlWy4KeJK7UBscqgpF QQPfqn6cZzYJ+ap6lkUvm7sX1h0heMvIMKpx2xRTm9kpBAup8h/4HqxlR5IToQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=VFpOFFiA; 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-Seal: i=1; s=key1; d=yhetil.org; t=1686834617; a=rsa-sha256; cv=none; b=fcKOk1xvqtdawzZ38930dx8xJtuWV23vGII+bkkfgQu6mmjtCWxeD9YeFtfXQuJo/uCspc S5QIF5x11/kHS//8OAOYClunIrXmqUsR1Pu2t+xfjqaCzQMOxP1ghA4mnZE6KLRcNTCBtu 6BVe/EZRCygShewy02eFN1DjldP/EqfXBnebAsLYurs7RgNVDUhyUlNKOWCFpRwMKVzp60 +LXUHG73p+Ngy1eKWFOsdYiw3gVhSGuhQKEsV+QygQ8cjmkrMbcDGA0bIqWSolOAj6RZeg pf4N7ofvyY+DW4QtyZ/YKpaWcSSc0lMYGv92qkvv5Bz0tefuRkV1fOdyEzfIFA== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -5.19 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=VFpOFFiA; 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-Queue-Id: 563AC2A8A X-Spam-Score: -5.19 X-TUID: 2YrKgOooRckE On 07.06.2023 19:57, Ihor Radchenko wrote: [...] I understand why you prefer the tag over the tag. > Finally, I can see that there are ways to use CSS on img+svg: > https://blog.union.io/code/2017/08/10/img-svg-fill/ I failed to make the flower example work with the information on this site. It could be my fault, but maybe also because the post targets the React framework since its subtitle reads "A Side Quest in Optimizing Performance for React". FWIW, here a brief description of how I solved my problem of making the MDN flower work taking into account the comments for improvement as far as I could. Thanks! https://forge.chapril.org/gav451/emacs.d/src/branch/main/site-lisp/ox-svg4css/ox-svg4css.el is a new derived backend for personal use. The commentary section of the backend and MWE follow below: #+begin_src emacs-lisp ;; This library implements an HTML derived backend for Org export. ;; It tries to address limitations of SVG images and CSS in HTML pages. ;; 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'. ;; ;; Caveats: the HTML output does not comply with W3C recommendations ;; after `svg-as-object' and/or `svg-inclusion' exports and it does not ;; comply with the Org Manual section "13.9.9 Images in HTML export" ;; after `svg-inclusion' exports. ;; ;; See: https://list.orgmode.org/c1eef10be815748d2103cb81bce08708@posteo.net/ ;; where Cristian Moe has proposed to embed SVG images in tags. ;; Ihor Radchenko and Max Nikulin have insisted on the use of special ;; "#+ATTR_HTML:" attributes to control the export options. ;; ;; I prefer enabling `:svg-as-object' over enabling `:svg-inclusion'. ;; ;; Relevant W3C documentation: ;; ;; Loading an SVG image by an HTML ,