From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/23059 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: niszet niszet Newsgroups: gmane.text.pandoc Subject: Re: filter img="file.svg" to Date: Thu, 27 Jun 2019 08:18:30 -0700 (PDT) Message-ID: <6903cda7-24a2-4c8a-819e-8ee558b94c15@googlegroups.com> References: <3a3cda8b-e33d-4bb9-ab7e-8f53ab58ff61@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_387_1991616077.1561648710694" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="216457"; mail-complaints-to="usenet@blaine.gmane.org" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCAI3UXLQYKRBR542PUAKGQE5NBMTPY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jun 27 17:18:37 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-oi1-f184.google.com ([209.85.167.184]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hgWAT-000u6E-Jh for gtp-pandoc-discuss@m.gmane.org; Thu, 27 Jun 2019 17:18:33 +0200 Original-Received: by mail-oi1-f184.google.com with SMTP id 186sf1102812oid.17 for ; Thu, 27 Jun 2019 08:18:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=92b4/irHNMbkZEthBmxw8iSQQ4+nfELbhGlcEcouRpw=; b=nor0KPALf5khrmk+l441OWwKoVsEig9LjY5KI/VrlD8uos/tCpc0urLJi+8by/rnZK a6TjYXd51Yu6TGofqeIwTnnWz4udWOqLEqqe3vN/VBnuoWJHtC6IczI3zvcwwLVPwLp8 4ZdwtW5U51S4ji248AI9RvsZQJnVk84VQi7kVi1U3XcirMsh4tFM5W95p8y3Uom1Coak exM7y1Oo9A1fn+XfIQtquTVUKnD4pybWlfJKTyBu63Q4Q2P5TgvoagT2zSX+VBMZ8Ksb NKuq+XExRFUOuzYq9GBMUj7sH0mb7EVSXMMBrO0LQD3KJHy9GYZkv/owt4QNpVh2PV60 7Hsw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=92b4/irHNMbkZEthBmxw8iSQQ4+nfELbhGlcEcouRpw=; b=txctC3PjZwsXNmm8OXy+gqmOS5B8PY0Jf57OkTsL+X+tXYRXPvc5MUDLWyfdxWjTlR LkdqwdlheV92juJPFjGIPmRVQgYJkv064IIbhTK/BaU2/prhlSd2l0eoIBoamvNUbWFf E4eV0Z2pYNK1DR9NjeQBnSmWGhaJy+gSz53CFu4I0FHTnRUUAQE7hMONUf8NLv93L8Vu trLOdJY6jpMhs/MHh8REylcKe08iHzKJI6YkF1W5FrOlAZwDpIfYXf5IcV6m99NywwD8 dS/X2mjxbo7D8nfEsDtd3cjLo8Zs7xP8o7fvEACRTPRGPgGVja8lKY43gwmt75x5wx98 3NcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=92b4/irHNMbkZEthBmxw8iSQQ4+nfELbhGlcEcouRpw=; b=sRVAnKnytpLFZ6nJgwu1/ONXY10hrDRzLq6oFWQ0dTJO78RQ+4LcMK+kLOh6ZuL3kg SEmGm6WRDJmVhgltxE/pq7+qlkkQHHZJV2rWD4e5HNkn2a13Ma2DauFT/eu7jicF0ygo vA2I5HOWPoLJApxr1aD+KZO/wgr+fXOOKuPAIbxsQd+DLdscQj9gOy339CCOHbKvcEH0 HlFLMrGQqc2eVwfHMNJ06HfpdGnNab6LZuW/Nnt/V+9lPZwpX/XbuCN6MDHkI6Ox3K2a sy6PkjlCQebixbuBXEM0SfihvOKuDEagFKmXwHVIAkMdelOBuxpe2T99Y0N7sbcHWThM TGyg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAXbGeAQB1H6kjA1OMC9O4TxMVcq23qZD802XmWB54EYxjyCvKeQ N5eOIXkCkYo0PwEtQgDv8Lg= X-Google-Smtp-Source: APXvYqzporUKDGshaFSgUqZMucR2AmXm+XHmqMK7vedWw1sLODwvzuSrC1GA88ulLqDMV1x0Tlfc5A== X-Received: by 2002:a05:6808:f:: with SMTP id u15mr1905856oic.21.1561648712335; Thu, 27 Jun 2019 08:18:32 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:5b84:: with SMTP id p126ls436792oib.3.gmail; Thu, 27 Jun 2019 08:18:31 -0700 (PDT) X-Received: by 2002:aca:d80a:: with SMTP id p10mr2544601oig.105.1561648711337; Thu, 27 Jun 2019 08:18:31 -0700 (PDT) In-Reply-To: <3a3cda8b-e33d-4bb9-ab7e-8f53ab58ff61-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: niszet0016-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.org gmane.text.pandoc:23059 Archived-At: ------=_Part_387_1991616077.1561648710694 Content-Type: multipart/alternative; boundary="----=_Part_388_1108675784.1561648710694" ------=_Part_388_1108675784.1561648710694 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Nigel-san, I wrote a simple example of lua filter as following (to use, save as=20 img2svg.lua). ``` function Para(e) for k,v in pairs(e.content) do if v.tag =3D=3D "Image" then if string.match(v.src, "svg$") then return(pandoc.Para(pandoc.RawInline("html", ''))) end end end end ``` If you input following markdown file of input.md, ``` ![](plantuml-images/9d8236ccdf925ce21eb481c9b4f6da4e7cb52ae1.svg) ``` and then convert by `pandoc -f markdown input.md -t html output.html=20 --lua-filter img2svg.lua`. Then you can get ```

``` as an output of output.html.(in your example, file name is different but I= =20 think it is typo.) niszet 2019=E5=B9=B46=E6=9C=8827=E6=97=A5=E6=9C=A8=E6=9B=9C=E6=97=A5 6=E6=99=8231= =E5=88=8617=E7=A7=92 UTC+9 Nigel Magnay: > > Hi - > > This has been created as an issue before, but sadly the gist is no longer= =20 > available. > > I use the plantuml filter to render diagrams to svg. This works, but the= =20 > hyperlinks in the svg are inoperable because the SVG is included as >

/>

> > When it needs to be something like > >

data=3D"plantuml-images/d3750ee9e6613d2f461ba5905d7909460bd02f25.svg">

> > What's my easiest route to fixing this (and/or is there an example that's= =20 > close I could modify) ? > > TIA, > Nigel > > --=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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/6903cda7-24a2-4c8a-819e-8ee558b94c15%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_388_1108675784.1561648710694 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Nigel-san,

I wrote a simp= le example of lua filter as following (to use, save as img2svg.lua).
<= div>
```
function Para(e)
=C2=A0 for k,v = in pairs(e.content) do
=C2=A0 =C2=A0 if v.tag =3D=3D "Image&= quot; then
=C2=A0 =C2=A0 =C2=A0 if string.match(v.src, "svg$= ") then
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return(pandoc.Para(pando= c.RawInline("html", '<object data=3D"' .. v.src .= . '"></object>')))
=C2=A0 =C2=A0 =C2=A0 end=
=C2=A0 =C2=A0 end
=C2=A0 end
end
`= ``

If you input following markdown file of input.m= d,

```
![](plantuml-images/9d8236ccdf925= ce21eb481c9b4f6da4e7cb52ae1.svg)

```
and then convert by `pandoc -f markdown input.md -t html output= .html --lua-filter img2svg.lua`. Then you can get

= ```
<p><object data=3D"plantuml-images/9d8236ccdf92= 5ce21eb481c9b4f6da4e7cb52ae1.svg"></object></p>
```

as an output of output.html.(in your exampl= e, file name is different but I think it is typo.)

niszet


2019=E5=B9=B46=E6=9C=8827=E6=97=A5=E6=9C=A8= =E6=9B=9C=E6=97=A5 6=E6=99=8231=E5=88=8617=E7=A7=92 UTC+9 Nigel Magnay:
Hi -

This has been created as an issue before, but sadly the gist is no l= onger available.

I use the plantuml filter to rend= er diagrams to svg. This works, but the hyperlinks in the svg are inoperabl= e because the SVG is included as
<p><img src=3D"pla= ntuml-images/9d8236ccdf925ce21eb481c9b4f6da4e7cb52ae1.svg" /= ></p>

When it needs to be something l= ike

<p><object data=3D"plantuml-imag= es/d3750ee9e6613d2f461ba5905d7909460bd02f25.svg"></obj= ect></p>

What's my easiest route = to fixing this (and/or is there an example that's close I could modify)= ?

TIA,
Nigel

=

--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/= msgid/pandoc-discuss/6903cda7-24a2-4c8a-819e-8ee558b94c15%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_388_1108675784.1561648710694-- ------=_Part_387_1991616077.1561648710694--