From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/33041 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: nopria Newsgroups: gmane.text.pandoc Subject: Inline SVG in markdown, converted to ODT Date: Thu, 10 Aug 2023 06:39:40 -0700 (PDT) Message-ID: <3ed4f0e5-ad35-4aaa-81c8-4e5766b88896n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_4953_342396979.1691674780207" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40594"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDKOFYFD3MCRBHWR2OTAMGQET7YIGLQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Aug 10 15:39:49 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pj1-f60.google.com ([209.85.216.60]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qU5tD-000ALw-IR for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 10 Aug 2023 15:39:47 +0200 Original-Received: by mail-pj1-f60.google.com with SMTP id 98e67ed59e1d1-267f1559391sf1061478a91.0 for ; Thu, 10 Aug 2023 06:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1691674786; x=1692279586; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:message-id:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to; bh=spZ+Kk17WVvt707npNgkECKZaGtoEZMXGFI/0DEwTZQ=; b=F+qEiPWoCDjn2fpuUbRed8Gb8sJCJzjaJZr67BIi/BVAh4c/um9zUT0vZv5+zQUnmz XyoKAqBe3BeBFWWe/05Ytqdx4ktMHUR6Dl0nh1rVeqvkHNt122bn4KWis+edfI1+Mb8L C43Szxv6OaiV4nMVVAqwUVwKTG8dPdQVCa7X78VGxz2uSEb+/8N4ql5d1xTMkyHxoTG4 x1Lu8uD+qrM2QjHmOcHbiX7nLBqe+qO781w5uEIWmRn7qiVJ4WkYDUxrKT7PhtuTZM95 UOUpNy0CwPSQUrudPlxFElzIZmHVQXIk9YotkwoBEYi09bVSLhlIHMGcwIOQDBRBC04U qGqQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691674786; x=1692279586; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:message-id:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=spZ+Kk17WVvt707npNgkECKZaGtoEZMXGFI/0DEwTZQ=; b=rQLA7GNFOi4dBbs6aY8G+sJ+bVYNtl9DHBrVeyR/mI1D35OLM7ZS8IlXIZRc7W7Rwy Eu5GJ2zzp3TcgX2jJDf+TCNkY7zJd/MaUOeSxMZ66U3az06IDOrPi+7S78aRXIXpzdG3 3CDotzK2xmgTYnL6YhtRmV/3HP2lc/2ESql+CqlugpUaf8tIvPSioCsrzKJFpqcLSe77 N4ZU+LaUxKZafPUZEneVxcVpsLScimbnqrOv3DmWyLipjKWOAF9NJOCSCb3jaeKmU4uD VBr8w9oQURdKKqOCskcazYH4vgzyYmgPwDWUdlGvVsgP3GnsU65lrjSEZYHx4JaD3EmS J6Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691674786; x=1692279586; 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:message-id:to:from:date :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=spZ+Kk17WVvt707npNgkECKZaGtoEZMXGFI/0DEwTZQ=; b=heHt8vllxpH4V4lyKpS4se2WADili0u/ee1Z8HjouuP2jtHC5w5kilKMmK1J5uUMhj 3GXwpYlc7zBTYQfhb45eOk2lpbW8BXyHViI+zisn6JJXbLq2wUW5Ayw7ft2GMOkC4Liz 1O9KR8xx03bIW9niPjuFSyB+LOIuv2VZPBBPp6LRG9fsxrN9+sqN7qZ4TI/QxMn4Pg1I ZqFvHx0mCc+6Jw6khNzeU3gvRCL8wu7QH+XyOfpVnF5YsxVbikYede3q5VzAiukuxMay 3WLvaPaj0WdHT63v7PyrWXqw/8F0on1jy1zBoFyqTsLaSMqpYn2ATaZFPVNEdUmOWFAd Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOJu0YxaSmo4XACqebc4zf7MagY8GystlNhQxXsoL/o5MRBdGuu93Gcw qUDhN3zvS0lzW2rH+Adtd2w= X-Google-Smtp-Source: AGHT+IFc7n8GKR8OAOWIO3lV6BVxya77MMUuYZ6KZgq2vdnXQO3OA5rQ3Z9TNABcl6z/6orDKZ5zhQ== X-Received: by 2002:a17:90a:dc16:b0:263:ebab:a152 with SMTP id i22-20020a17090adc1600b00263ebaba152mr1844340pjv.19.1691674785853; Thu, 10 Aug 2023 06:39:45 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:90b:2357:b0:269:5435:ebd with SMTP id ms23-20020a17090b235700b0026954350ebdls508016pjb.2.-pod-prod-01-us; Thu, 10 Aug 2023 06:39:41 -0700 (PDT) X-Received: by 2002:a17:90a:dd91:b0:262:da02:8a27 with SMTP id l17-20020a17090add9100b00262da028a27mr573210pjv.6.1691674781024; Thu, 10 Aug 2023 06:39:41 -0700 (PDT) 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:33041 Archived-At: ------=_Part_4953_342396979.1691674780207 Content-Type: multipart/alternative; boundary="----=_Part_4954_1056237054.1691674780207" ------=_Part_4954_1056237054.1691674780207 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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,) Inline SVG image defined by BASE64 converted text: ![SVG=20 Image](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+PHN2ZyB4bWxucz= 0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiB2a= WV3Qm94PSItMTUwIC0xNTAgMzAwIDMwMCI+PHJlY3QgeD0iLTEwMCIgeT0iLTEwMCIgcng9Ijgi= IHJ5PSI4IiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgc3R5bGU9ImZpbGw6I0NDQ0NGRjtzdHJ= va2U6IzAwMDA5OSIvPjwvc3ZnPg=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 is= =20 correctly converted, while the textual inline SVG is not displayed in the= =20 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 to= =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 natively= =20 without needing PNG conversion (I hope it works with more complex SVG too),= =20 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/3ed4f0e5-ad35-4aaa-81c8-4e5766b88896n%40googlegroups.com. ------=_Part_4954_1056237054.1691674780207 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Following other tentatives of markdown to DOCX conversion contai= ning external SVG, I tried to convert to ODT a markdown containing **inline= ** SVG, such as the one below:

# Example document

This is an example of Mar= kdown document with inline embedded SVG images.

Inline SVG image= defined by plain text:

![SVG Image](data:image/svg+xml;charset= =3Dutf-8,<?xml version=3D"1.0"?><svg xmlns=3D"http://www.w3.org/20= 00/svg" width=3D"100" height=3D"100" viewBox=3D"-150 -150 300 300"><r= ect x=3D"-100" y=3D"-100" rx=3D"8" ry=3D"8" width=3D"200" height=3D"200" st= yle=3D"fill:#CCCCFF;stroke:#000099"/></svg>)

Inline SVG= image defined by BASE64 converted text:

![SVG Image](data:image= /svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+PHN2ZyB4bWxucz0iaHR0cDovL3d3dy5= 3My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiB2aWV3Qm94PSItMTUwIC= 0xNTAgMzAwIDMwMCI+PHJlY3QgeD0iLTEwMCIgeT0iLTEwMCIgcng9IjgiIHJ5PSI4IiB3aWR0a= D0iMjAwIiBoZWlnaHQ9IjIwMCIgc3R5bGU9ImZpbGw6I0NDQ0NGRjtzdHJva2U6IzAwMDA5OSIv= Pjwvc3ZnPg=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 = is correctly converted, while the textual inline SVG is not displayed in th= e 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 to avoid the BASE64 conversion and go with the plain text inline SVG.

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

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

Tha= nk 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/3ed4f0e5-ad35-4aaa-81c8-4e5766b88896n%40googlegroups.= com.
------=_Part_4954_1056237054.1691674780207-- ------=_Part_4953_342396979.1691674780207--