From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id kFqTDhSBf2Q6JAAASxT56A (envelope-from ) for ; Tue, 06 Jun 2023 20:55:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id uKymDRSBf2TIQAEAG6o9tA (envelope-from ) for ; Tue, 06 Jun 2023 20:55:16 +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 A3BE11AE9D for ; Tue, 6 Jun 2023 20:55:15 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q6bp1-0006Dk-U4; Tue, 06 Jun 2023 14:54:23 -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 1q6boz-0006Br-LU for emacs-orgmode@gnu.org; Tue, 06 Jun 2023 14:54:21 -0400 Received: from mailer-211-159.hitrost.net ([91.185.211.159]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q6box-0006Om-2v for emacs-orgmode@gnu.org; Tue, 06 Jun 2023 14:54:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=christianmoe.com; s=x; h=Content-Type:MIME-Version:Message-ID:Date: In-reply-to:Subject:Cc:To:From:References:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1TgwYF1F7ZQyC/2DIlWB9Iv+UUujM9GkgdZ5LtPltFg=; b=XVdIzsIWPe53v6pKH12Ees2qb0 ecwXCzPFWhB3zgM8OGQMoFeS/QwkwCO+QO4y/cUPVwTp2BjAulgX4EpAMI2+/3cY6asN/ctnvNybY Oug9d5CJXUOd4fhMdhiO/Mg2lP93C9N+TS1GN5SSjdqfiaJ3H0n4bfDbH40HqugO4fyFqleiHKRcO Xfa+JCpZvh5p3NeGy0OmhUFJ8G1Rumh9qIi9DPh8upK7d/vbcm0WCrCGa9Me6CVnTtd23dNzuAqNm sSTU9RfAVlDhC5J7BwTJ7gnbuLkadQXi5uvtOcPaLlFiQEeJjeQUt+9tMeocfYs6jKeb694fDs4+j eB2Pk89g==; Received: from 92-63-16-127.dynamic.telemach.net ([92.63.16.127] helo=Tauriel) by b1.hitrost.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96-58-g4e9ed49f8) (envelope-from ) id 1q6bom-007YlG-2k; Tue, 06 Jun 2023 20:54:08 +0200 References: <871qip3u90.fsf@localhost> <87fs74j4la.fsf@christianmoe.com> <65d386e8c274e9703b80f2a2fefbcb7f@posteo.net> User-agent: mu4e 1.2.0; emacs 27.2 From: Christian Moe To: gerard.vermeulen@posteo.net Cc: emacs-orgmode@gnu.org, Timothy , "Ihor Radchenko" Subject: Re: [PATCH] ox-html.el: add option to embed SVG for CSS support in SVG In-reply-to: <65d386e8c274e9703b80f2a2fefbcb7f@posteo.net> Date: Tue, 06 Jun 2023 20:54:08 +0200 Message-ID: <87edmoifqn.fsf@christianmoe.com> MIME-Version: 1.0 Content-Type: text/plain X-GeoIP: Country [IP], SI [92.63.16.127] X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-Authenticated-Id: mail@christianmoe.com Received-SPF: pass client-ip=91.185.211.159; envelope-from=mail@christianmoe.com; helo=mailer-211-159.hitrost.net X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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=1686077716; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=1TgwYF1F7ZQyC/2DIlWB9Iv+UUujM9GkgdZ5LtPltFg=; b=tfDxiBzWco///SIO6bQMwMvQJ7bXMyx63kAoojVDh4WsoMn2t2H9fErBjChh7/Yp9SRcCq XsSLaVP1t1aJMevycZzjUmycRS++ClNkn9mKauEcUuGDbpWAYEJk92aDMX4EOiUf42kTM7 ti96FyR6dmVIGTuO0n+K7JJDMQLx7f1vKaeRYXufZJX/V7+anpa+3Q3teguxK26pqf16b0 6X+27dd2adrT8yXvVzaaveHJS6d3gFGa044cz5jecjZ4yyPHW8AQJ21MjrNa7QXc6dF08G ZhE0xhCa0I+f3yLaFRL5eysRxtEZvpWTFsvPHO+NFsO+p6jmgBvtBKtOeL2Elg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b=XVdIzsIW; dmarc=none; 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=1686077716; a=rsa-sha256; cv=none; b=P2IYScvLedFg58Qgi7p/SA5gvxF6Fey50V8Z5I6kiNsQBHpYQd3rwFx8pDF0Fg5gWM3pTf EOP7iWgE+l/SiCtrzskAeERs5SdV7bdHb+bRXVoXGeeERc65c6COG/TAK1Th7PxtyPwpAT kx0dnJrr4s+WGqoYfawavhhx+qB+T/Xr7HheBlRsf1PDMuGeyOIX6QP454b3G319XW5NMF Lbh+yxyHx0dK8NmlXEW13bok4JFPOLyspG3MD7reJ1rs3TpZlVr6TetxTE+guXRK05C2Gu zCKOfd422PrF+9RNRy4fGRT4ygqlwBb2Mv4ptyFw5mh62/Syytv4Ajem2flgqw== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -2.99 Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b=XVdIzsIW; dmarc=none; 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: A3BE11AE9D X-Spam-Score: -2.99 X-TUID: Wrtye/wMyU9W gerard.vermeulen@posteo.net writes: > On 06.06.2023 11:57, Christian Moe wrote: [...] >> 1) Embedded SVG is not the only way to have active CSS etc. in SVG >> images. Linking to an external SVG file with an OBJECT element instead >> of IMG should work fine (tested in Firefox). You can test this by >> exporting Gerard's mwe.org example and editing the mwe.html to replace >> : img src="./doc8.svg" >> with >> : object type="image/svg+xml" data="./doc8.svg" > > Indeed, the flower works after the replacement but the caption > disappears. > I do not understand why, because the caption is still present in the > HTML. Oops, sorry, my example was incomplete. Closing the tag with should help. [...] >> 2) You can actually embed an SVG island in Org HTML export simply by >> using #+INCLUDE. To try this, add the following line to Gerard's >> mwe.org: >> : #+INCLUDE: "./doc8.svg" export html >> The exported HTML should now show the black flower from Gerard's >> minimal >> non-working example plus a working flower. > > Indeed, the flower works, but the caption disappears because Org does > not > recognize the "#+INCLUDE ..." as a link, the caption does not show up > in the > HTML. Is there an easy solution for this issue. Fair point! No, I don't think there is an easy, non-messy solution that will make for generating proper figure captions using the Org #+CAPTION keyword with this approach. The same goes for embedding the SVG in the Org file itself in a =#+begin_export html= block. That's obviously a major drawback. So for embedding an external SVG file as an SVG island in HTML output with proper figure captioning, your approach is superior to my #+INCLUDE hack. That said, I still think the better solution to the issue you raised is for Orgmode to go back to exporting SVG links as not , not to extract SVG file contents and embed them as SVG islands. (Though I may be a breaking change for some users. In particular, because OBJECT does not have an ALT attribute, but uses several other ways to provide alternative text for accessibility, users would need to change their =#+attr_html :alt= to using :aria-label or :title attributes, unless the Org implementation for SVG links were to handle this smartly.) Yours, Christian