From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/33047 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: nopria Newsgroups: gmane.text.pandoc Subject: Re: Inline SVG in markdown, converted to ODT Date: Sat, 12 Aug 2023 10:42:38 -0700 (PDT) Message-ID: References: <3ed4f0e5-ad35-4aaa-81c8-4e5766b88896n@googlegroups.com> <181d94a6-f783-45a6-8d93-284a6674b977n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_6716_1449793062.1691862158157" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10874"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDKOFYFD3MCRBD4J36TAMGQERGNZ62Q-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Aug 12 19:42:45 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pl1-f191.google.com ([209.85.214.191]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qUsdR-0002eP-1l for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 12 Aug 2023 19:42:45 +0200 Original-Received: by mail-pl1-f191.google.com with SMTP id d9443c01a7336-1bbd260ca2dsf57821025ad.3 for ; Sat, 12 Aug 2023 10:42:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1691862163; x=1692466963; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=xMDsHUMe5M5geu4ZrkBSkWnhPFAtXtJOJKOIpA7H5O4=; b=Xw2TISBmi2HMkcTmc3SJzKPyK+ZGY/NQpaMH+fzsFsv2NPd9HDjlDyVeLn5oZdvFmI npbUiIX3Bq3KsnTyqSTPibb8Wf12UAV/6kbUFs2eN12EN2ViYT2/8Nnw12N+0n/w0dVg ISLa/iDJ8c7UGfkoOX1A9AsLqWtCvJlK7cmR9sH9Pxr2p0x8ioPWuc0p1Y3+YXeOpjNo jJo5NmD893g687aFjlBAtjNePBnodsWJqE5H75HQM3P1E41BIikz+KXbxiykFK4L/XJ/ elj1dbbI26Gx0I1msp9cKSkx32u6UtxNUQAYeBI/p9mBJgQgHZ3naATCXNd5L68Q2KoL dKkg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691862163; x=1692466963; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=xMDsHUMe5M5geu4ZrkBSkWnhPFAtXtJOJKOIpA7H5O4=; b=P9PThRZ7Q4Y3iU4+ivneGGtVvwQCJ2QvxY8wN+mx7CMl4+yXftW0j+3LvtmXBoQkKR Cq56uCCNrR9pRy/wXBNBhce/cdR+ASYLz159lB3fOwGx2VxbqJxTFDi9MdC6X5pOSOj1 RA4O5A+QttivWpGCymguMAsQNbipAlU2YdZc85/hy9txycn8wSDhmQfCof8B2IucxdL2 vt6OTv+lGcPLf996AQbqe/ACZCruPqnMaeVu/AXG3c/nppO0iiCF0Rztr0KqByiE/9z6 +POubjlixCQ1eymPHAcx6Je25NCkhGUbwdtQT2Y2E42p24a+sme/hgsLpEuAZOQlSLDw EYGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691862163; x=1692466963; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=xMDsHUMe5M5geu4ZrkBSkWnhPFAtXtJOJKOIpA7H5O4=; b=PbvRNxMYc8hGqvlj7N+jFYZRvpx/Xqp3QuqhIuXNL64F97TRRto9MGCi/XP1STHeIM Dqa2baYR2U7j3woCEJ3Q/RWaREhG9ItGH6+yl5mfXvpiSSu+YAwD4fcJdRU2UjfUKr4H j/cVDFelWxHeKS6tTQA+bvhnjr9vD/JO9y3DDJc4unMAQCGQo1OAzcMvXbBUuN4SyveV XHfX0Qw23AmprMszB2fPMsKCJGfVzViy1zL9KXp4b27EfH3HZ51m4g+03NmjmeFUuh6U lJkbUJ2NzWmqSQ/tK9FmSBeDstzEfEpmUAQcELKszu5CkH1ttK Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOJu0YygK918w2BQXGvGJaBu14+szI6oBGJEDOZIFwAF4yVv2h7LTTco gCL1pQ3NOpeDZYV7L/5rXew= X-Google-Smtp-Source: AGHT+IHmajxzjSvLz/d9Kt0+k//ttgrMEL3dKnRcX6nOg12/PNkHRKN76TbaOzde/3h3eGBgGA+uZg== X-Received: by 2002:a17:902:c3cd:b0:1b8:6987:de84 with SMTP id j13-20020a170902c3cd00b001b86987de84mr5662636plj.48.1691862163389; Sat, 12 Aug 2023 10:42:43 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:902:6507:b0:1bb:a4f7:34dd with SMTP id b7-20020a170902650700b001bba4f734ddls1955574plk.2.-pod-prod-05-us; Sat, 12 Aug 2023 10:42:39 -0700 (PDT) X-Received: by 2002:a17:902:fb8b:b0:1bb:c630:65e0 with SMTP id lg11-20020a170902fb8b00b001bbc63065e0mr1691753plb.9.1691862159062; Sat, 12 Aug 2023 10:42:39 -0700 (PDT) In-Reply-To: <181d94a6-f783-45a6-8d93-284a6674b977n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: lisprule-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:33047 Archived-At: ------=_Part_6716_1449793062.1691862158157 Content-Type: multipart/alternative; boundary="----=_Part_6717_925504496.1691862158157" ------=_Part_6717_925504496.1691862158157 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Yes it's an option, but I would like to understand why using plain text=20 does not work. Il giorno venerd=C3=AC 11 agosto 2023 alle 12:23:32 UTC+2 Christophe Demko = ha=20 scritto: > You could write a filter that convert a Inline SVG image defined by plain= =20 > text into a Inline SVG image defined by BASE64 > > Le jeudi 10 ao=C3=BBt 2023 =C3=A0 15:39:40 UTC+2, nopria a =C3=A9crit : > >> Following other tentatives=20 >> of=20 >> markdown to DOCX conversion containing external SVG, I tried to convert = to=20 >> ODT a markdown containing **inline** SVG, such as the one below: >> >> # Example document >> >> This is an example of Markdown document with inline embedded SVG images. >> >> Inline SVG image defined by plain text: >> >> ![SVG Image](data:image/svg+xml;charset=3Dutf-8,<= svg=20 >> xmlns=3D"http://www.w3.org/2000/svg" width=3D"100" height=3D"100"=20 >> viewBox=3D"-150 -150 300 300">> width=3D"200" height=3D"200" style=3D"fill:#CCCCFF;stroke:#000099"/>) >> >> Inline SVG image defined by BASE64 converted text: >> >> ![SVG=20 >> Image](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+PHN2ZyB4bWx= ucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIi= B2aWV3Qm94PSItMTUwIC0xNTAgMzAwIDMwMCI+PHJlY3QgeD0iLTEwMCIgeT0iLTEwMCIgcng9I= jgiIHJ5PSI4IiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgc3R5bGU9ImZpbGw6I0NDQ0NGRjtz= dHJva2U6IzAwMDA5OSIvPjwvc3ZnPg=3D=3D) >> >> Some math to check if it works; >> >> $$A_c =3D 23 r^2 - v$$ >> >> using command >> >> pandoc example.md -o example.odt >> >> with Pandoc 3.1.6.1. As you may confirm yourself, the BASE64 inline SVG= =20 >> is correctly converted, while the textual inline SVG is not displayed in= =20 >> the resulting ODT and the following warning appears at conversion: >> >> [WARNING] Could not fetch resource data:image/svg+xml;charset=3Dutf-8 ..= . >> >> Given that a BASE64 inline SVG is enough to do the job, I would prefer t= o=20 >> avoid the BASE64 conversion and go with the plain text inline SVG. >> >> I already tried html encoding of SVG text and uppercase "utf8" without= =20 >> success. >> >> I choose ODT because it's open and because it seems to display SVG=20 >> natively without needing PNG conversion (I hope it works with more compl= ex=20 >> SVG too), which is a great feature. >> >> Thank in advance for your time. >> > --=20 You received this message because you are subscribed to the Google Groups "= pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/b23470f2-112a-43e2-bf91-b484984c580cn%40googlegroups.com. ------=_Part_6717_925504496.1691862158157 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Yes it's an option, but I would like to understand why using plain text doe= s not work.

Il giorno venerd=C3=AC 11 agosto 2023 alle 12:23:32 UTC+2 C= hristophe Demko ha scritto:
You could write a filter that convert a Inline SVG image defined by plain text into a Inline SVG image defined by BASE64

Le jeudi 10 ao=C3=BBt 2023 =C3=A0 15:39:40 UTC+2, nopria a =C3=A9crit=C2= =A0:
Following other tentatives of markdown to DOCX conv= ersion containing external SVG, I tried to convert to ODT a markdown contai= ning **inline** SVG, such as the one below:

# Example document

This is an example o= f Markdown document with inline embedded SVG images.

Inline SVG imag= e defined by plain text:

![SVG Image](data:image/svg+xml;charset=3Du= tf-8,<?xml version=3D"1.0"?><svg xmlns=3D"http://www.w3.org/2000/svg" width=3D"10= 0" height=3D"100" viewBox=3D"-150 -150 300 300">= ;<rect x=3D"-100" y=3D"-100" rx=3D"8" ry= =3D"8" width=3D"200" height=3D"200" style=3D&= quot;fill:#CCCCFF;stroke:#000099"/></svg>)

Inline SVG = image defined by BASE64 converted text:

![SVG Image](data:image/svg+= xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5v= cmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiB2aWV3Qm94PSItMTUwIC0xNTA= gMzAwIDMwMCI+PHJlY3QgeD0iLTEwMCIgeT0iLTEwMCIgcng9IjgiIHJ5PSI4IiB3aWR0aD0iMj= AwIiBoZWlnaHQ9IjIwMCIgc3R5bGU9ImZpbGw6I0NDQ0NGRjtzdHJva2U6IzAwMDA5OSIvPjwvc= 3ZnPg=3D=3D)

Some math to check if it works;

$$A_c =3D 23 r^2= - v$$

using command<= /div>

pandoc exa= mple.md -o example.odt

with Pandoc 3.1.6.1.= As you may confirm yourself, the BASE64 inline SVG is correctly converted,= while the textual inline SVG is not displayed in the resulting ODT and the= following warning appears at conversion:

[WARNING] Could not fetch resource data:ima= ge/svg+xml;charset=3Dutf-8 ...

Given that a= BASE64 inline SVG is enough to do the job, I would prefer to avoid the BAS= E64 conversion and go with the plain text inline SVG.

I already tried html en= coding of SVG text and uppercase "utf8" without success.

I choose ODT because it's open and because it seems to= display SVG natively without needing PNG conversion (I hope it works with = more complex SVG too), which is a great feature.

Thank in advance for your time.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/b23470f2-112a-43e2-bf91-b484984c580cn%40googlegroups.= com.
------=_Part_6717_925504496.1691862158157-- ------=_Part_6716_1449793062.1691862158157--