From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/23221 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Ken Dow Newsgroups: gmane.text.pandoc Subject: Re: Manipulate Image in DOCX -> HTML using Lua Filter Date: Sat, 10 Aug 2019 05:41:20 -0700 (PDT) Message-ID: <9c5993b8-c9ec-4b14-9702-f0279ace3e6f@googlegroups.com> References: <2ad2cd23-4cc0-4e2a-bf07-bd2f09e2ae03@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_998_723717702.1565440880776" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="151427"; mail-complaints-to="usenet@blaine.gmane.org" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBD7LJ7PVSXEJB62ECDY7NOXKAUNAJAZKETMA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Aug 10 14:41:23 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-ot1-f55.google.com ([209.85.210.55]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hwQgV-000dGD-JI for gtp-pandoc-discuss@m.gmane.org; Sat, 10 Aug 2019 14:41:23 +0200 Original-Received: by mail-ot1-f55.google.com with SMTP id j4sf74644155otc.5 for ; Sat, 10 Aug 2019 05:41:23 -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=sW6E6jukchuFaQLHbIy/SKlDtVnvHaZ6qzSC9KMjuXU=; b=PUotIgEpBRhIHGu69zpPkiqreApH/2ixthLa9AQJCQZCqhq6oh3JYX9HFfF+eVDlRq O/qCkqRzu2+XxKOAf6gFUa99mpIT5CpOE8dvlgjpZaHdjQn/X+FC2jcy6xboaHs25wKu d/nJRap7dhN2AtSHp0aR1FeBQbtBY9CY7GfU3DGkfUiYIYV2dtCYLEiYLDylmleXzm8H miASO+maUHdxEoEbh14I2cFLCxnaKUa+KOzpvkXFZxUbj5GkLRxpQAZnXKvP5n6lnAZE sQKuKyZenWQOUr8oP6lAarOZYFDaYbsEM0ukXMFnmAMgfEdhBrgjOzBbIazDh0Z/f94x piyg== 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=sW6E6jukchuFaQLHbIy/SKlDtVnvHaZ6qzSC9KMjuXU=; b=cVbi/ay8/dM8CNI3zObgNaJ9fOVHd8DFrbJnIC2rDf4lW/Y8P2dpUL1uwo1fwjKgwr OXs6MFR1yRNZEndsZMcqsh3F5sZkMhpFAn0vu3dHvNtK/4Z9myXZa01fju1LIz+cXnbI VdA5sN85aTq4xdTmTeGQRvJP6oq4Y62Mi4BzDFnn+2LJygzHBUemKL0bksQVxoR3/gLg MDycdzLFB4ILVVNQb5lUyPzP5TJhg1vQZbpd+gdzCsLPHB+0Zir6UjOr+IwMgzrr+txQ jFZ9fN3/u6YnzV8CJ8BEYOP9aYGS6WjJGDoe8bZIPACinr+4wtYrLSlxeYRV2pt1ukwv bD1g== 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=sW6E6jukchuFaQLHbIy/SKlDtVnvHaZ6qzSC9KMjuXU=; b=p/UZsqG9E4NQ8HtwlKbeXEolttMZb1z/cgJXUyTiKOWH0iN3JbP5YEI+XYMFTAIg3D KGbW77hhnmzsETPL11eRoswasBigPijPcFj21wH7c75TDByWOIUzGqy6Wnrtfvgvn/+t wqHtdALoxGMe7pFCxSW5tjuu41tI27CJDR0tuwwBcCTVrrDI084pvY2edpCtCn0wB6T3 IU0VbMa7c5oJWu5BUeNfnIeQws4zpOgU6pXu9Vh+nN3d165JOPZt8CVpHeRagwso6Hnu UUAyG0//YVHIThtCsnY48Cdhx42ABzRO8SO/samSvX8ZKYkcviK1n1nXWUnD/V53NQrz c7Ew== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAXnSjTH9Jyws0Y2LMT2tBGLRXClvMDYrvJ4tTl6Ccg+vK2SWXYE Zl5YxXxACPb8RpdubmOwPJQ= X-Google-Smtp-Source: APXvYqzAazdYIrV/wb4k31fOCqnQeBBrBMQC2yhDhZrut/G9Y3Z26YIb9YmhAO9vUcy3GphOVpOyTA== X-Received: by 2002:a05:6830:93:: with SMTP id a19mr23298172oto.127.1565440882336; Sat, 10 Aug 2019 05:41:22 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a9d:71d0:: with SMTP id z16ls379027otj.2.gmail; Sat, 10 Aug 2019 05:41:21 -0700 (PDT) X-Received: by 2002:a05:6830:d:: with SMTP id c13mr7432156otp.271.1565440881344; Sat, 10 Aug 2019 05:41:21 -0700 (PDT) In-Reply-To: <2ad2cd23-4cc0-4e2a-bf07-bd2f09e2ae03-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: thekenshow-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:23221 Archived-At: ------=_Part_998_723717702.1565440880776 Content-Type: multipart/alternative; boundary="----=_Part_999_306826337.1565440880777" ------=_Part_999_306826337.1565440880777 Content-Type: text/plain; charset="UTF-8" The following removes the `style="width100;height:100"` altogether, which is what I wanted: function Image(el) el.attributes = {} return el end But this doesn't set anything - it also completely removes the style attribute. So I still don't understand see how `el.attributes` is supposed to work for images: function Image(el) el.attributes = {["width"] = 101, ["height"] = 102} return el end On Friday, 9 August 2019 15:53:07 UTC-4, Ken Dow wrote: > > I'd like to modify the attributes of all images from a DOCX conversion to > HTML in a Lua filter. So far: > > function Image(el) > el.classes = {"image"} > -- el.attributes = {"style", "mu"} > return el > end > > > This el.classes line sets the `img` class = "image". The el.attributes > line removes the `img` tag from the output. What am I missing? > -- 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 email 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/9c5993b8-c9ec-4b14-9702-f0279ace3e6f%40googlegroups.com. ------=_Part_999_306826337.1565440880777 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The following removes the `style=3D"width100;hei= ght:100"` altogether, which is what I wanted:

=
function Im= age(el)
=C2=A0 el
.attributes =3D {}
=C2=A0
return el
end


But this doesn't set anything - it also completely removes the=20 style attribute. So I still don't understand see how `el.attributes` is= =20 supposed to work for images:

function Image(el)<= /span>
=C2=A0 = el
.= attributes =3D {["width"] =3D 101, = ["height"<= span style=3D"color: #660;" class=3D"styled-by-prettify">] =3D 102}
=C2=A0
return el
end
<= /span>


On Friday, 9 August 2019 15:53:07 UTC-4= , Ken Dow wrote:
I'd like to modify the attributes of all images from a DOCX convers= ion to HTML in a Lua filter. So far:

function Image(el)
=C2=A0 =C2=A0el
.classes =3D<= /span> {"image"}
--
=C2=A0 el.= attributes =3D {"style", "mu"}
=C2=A0=C2=A0 return el
end


This el.classes line sets=C2=A0 the `img` class =3D "image= ". The el.attributes line removes the `img` tag from the output. What = am I missing?

--
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/9c5993b8-c9ec-4b14-9702-f0279ace3e6f%40googlegroups.co= m.
------=_Part_999_306826337.1565440880777-- ------=_Part_998_723717702.1565440880776--