From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32823 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "'William Lupton' via pandoc-discuss" Newsgroups: gmane.text.pandoc Subject: Re: Inserting attributes into elements Date: Thu, 15 Jun 2023 11:13:19 +0100 Message-ID: References: <76a72c07-6699-d243-ae20-64808682ec9e@meddatainc.com> <90C7A30F-C0FA-49D8-B0CD-6521B58113F1@meddatainc.com> <0a6aa41a-fe72-a1e8-2630-ec6070c0bbb3@meddatainc.com> <74253f39-02db-dc2e-2ae1-9d27aaab82ea@meddatainc.com> <61724767-ada0-133f-6751-5884c7460a25@meddatainc.com> <37d8c191-388e-164e-6955-9014b4f0a4a0@meddatainc.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f22bb305fe285189" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17298"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCS4HJ6WSAHBBTGIVOSAMGQEJUNJEFI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jun 15 12:13:38 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lf1-f62.google.com ([209.85.167.62]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1q9jz0-0004MB-5Y for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 15 Jun 2023 12:13:38 +0200 Original-Received: by mail-lf1-f62.google.com with SMTP id 2adb3069b0e04-4f61f59c230sf6514443e87.2 for ; Thu, 15 Jun 2023 03:13:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686824017; cv=pass; d=google.com; s=arc-20160816; b=IEZxGmscEGkzpbJIR/6YH4CJtFY/SknBKZmOktHX8XW8OVBuCrzjgfG0AOgeJ1EE3f Xikb2p2NVCRuxXsfyOev1avr4J+kFxPXD1wC/k3e0T7qsx8YoYdANBs1I53HiFG4I4ai tL20bcK7UDLncUQdhHxGxY2wRNBXWAdvnHl/jLu+GOq1wMREdrL21nkYl5JUa+/IuIJ4 si8dC49RauK9V2CH8cuKjBah4NId9VEl/xLnvSm7DyJWoX0C1Nj3yxv3J4wj1ZQmEBjH hxfa3sHcvGBfFdUxmo0yHETTtB3gRduHK6WXlNwxRAoi4TIXx1O7B9UF2IfWUtpmeErz 5wdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date :from:in-reply-to:references:mime-version:dkim-signature; bh=/XoQZiACaReAjYH0iV0lpV284fIdHLcxU0BYQZ1Agqc=; b=pY+8g6X251HVouEI6C19Oz0Ra4g5yA0zNAaatcfTbMMfb7ayDT8jJa/CCoo4TpgX+b jifm/yUNPQVhXRUcznxgbuVAeSMY+Z9sVQwnqcvVJoccRf/FObhiPZIaj+Fjj86pZYhg Ha2SpEmdJsun0rFukM6jZ+o46Iyasu8o809Af2kHLBaNGLKYp6O2egOElYUG4N+RUyES Axi4S48q35B2/u35itadLCUEJ5v/CaMz7JwSzpPavuu1p5uKiA2BpSLNeXBHN9aXuQiE 8VLu2YnkifEfihK0Cy+si8Anp3zOQX6uOL6NqGkdBBt6eRbjgq3LykgCialjhBWiZLxF UXZw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=r+Ae4iYq; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::635 as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadband-forum.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1686824017; x=1689416017; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version:from:to:cc :subject:date:message-id:reply-to; bh=/XoQZiACaReAjYH0iV0lpV284fIdHLcxU0BYQZ1Agqc=; b=XyZMpWeUV6Rvic9tv/6AMRUs0bJ//CBIUvOHbjOrQwn/hrBWOtyVPAH93O57aOwGFJ LvthwPy+4YJ+QkQvxBXnMb/qMPGxl6iPF6PauLnKxop9IAGXyRpXbP2/iNIZ0RABHWwU D5meQzl1+d1ztwlkoaA2t8oneh2vjYgLMcmaEIQkC3QppEfNIOr3HkkCQRZk6HAY/+sO Vw6q9ys7vFkx5NzpUDFryyL5j4ExKkylpYcRtgfZ4XznsXaywv9PtlwrtdmHxZZ7Ym2W Wzf3MHk2aaM3sZS50+NYbealuT3v7DMPp3jmYTeyM5oouSUfcxV4pHier3FisBzkVUB/ 6m X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686824017; x=1689416017; 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-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/XoQZiACaReAjYH0iV0lpV284fIdHLcxU0BYQZ1Agqc=; b=DiM3ISRANjxZKcAUefJ+jiTCZ+fzlMLPLhf2UjnXakZhsKulTJEro9Y2OW8xpXN4eh KMxSjpJIZ60nDFSpJ4FXkTWYCVkaL0cji6S5QcG/NLzYORd3FYQvFJFnNEZGyCHifqx0 BfhBQDOcpSNt10B5KWmVu6EjIyywO+KsTmwlyo0n/UmyWFwoeCLQzr+wgdNz7A7syNkJ m9Emh9dJvSQCI8aRsHygx8rrIsqqYR/iMglrLvIrlvQEfh0D/aCTmx58VduL8WgdHTXb qdnxOl8a8N3NJ X-Gm-Message-State: AC+VfDxinRneIIiXcI+CWgHqMFFsQ0/ruLslWF5KG0xBX5Ab5SNMQ1XY mTZ6Dadf70dfhQH9Q18YuPw= X-Google-Smtp-Source: ACHHUZ5Rw0SvFdbDD2pCjr8t844gMYoPSn+brVvsW2nMgN4ZlOHGls5WuHQsEuvZjvdYJpGjfbcEMw== X-Received: by 2002:a2e:3c0a:0:b0:2b1:dc7a:ebf2 with SMTP id j10-20020a2e3c0a000000b002b1dc7aebf2mr8292955lja.17.1686824017140; Thu, 15 Jun 2023 03:13:37 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aa7:cf93:0:b0:516:64b2:cc91 with SMTP id z19-20020aa7cf93000000b0051664b2cc91ls434948edx.0.-pod-prod-04-eu; Thu, 15 Jun 2023 03:13:31 -0700 (PDT) X-Received: by 2002:a17:907:7244:b0:974:55a2:cb0b with SMTP id ds4-20020a170907724400b0097455a2cb0bmr17363349ejc.55.1686824011319; Thu, 15 Jun 2023 03:13:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686824011; cv=none; d=google.com; s=arc-20160816; b=tFaor+BGIzpxmvVWD2foPgtyZN+pi1E5lbFA/I7Uj7fwGH8/XUog0CiFCXt4KtxwIe fBrZ+5pGE4IRxWvOpGonsSrmgj4RbxVaSnL6m8B+/orlsvwuU2B0rhoA0SQ+z88NRlnW maJpyauXSncst4ify7Y48uZ3svlSDX5tAVptATZt/TT0DVYeQD00mCDViibCTHmyeQ4A s5h4nxhinPoOUWndVOnfQk0DjV75vSOetnJkpCeo/hFXbZDGfmQYq4jmp+uJt1P2fBOV 4+C6j6Us6xjTEeSuBdsAViYdcI4CaHzDV1okUaWARGxFE7pC2ReAXIgXnk0ofhDJhbq/ 44Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=dR4pRt4L6YfD8+Itbg1Pd720awFIopkFSkok3lRR7+c=; b=K+Fx4xDsXyRKKAMKIcSi29HdRYdhGB8UVS8p2BX2oKZ6y+07SdXlmqRb7QcU2Rujd8 ltXn7zZrjm4V/xFmRGBcQux/8++XZ75dtjXqZnRad+KvanJB4F113fu55eLR774V/cRd TEqNLrBLYmBLN/6BUiR2wotjF58zTtR2AkCCyr9YIku2fCYcNLca5HkoZCzoSJswFwUa l9fhcLHrjhUFEB7e4O+4XIJyte4OqoMxspzjR5WMihreFsgpEZoMgArCEi2/Hvu7RP1e cxEq4eeYv24/Bgzir9GfPdwpIS/X+hnp59MI3BrbVBZzFoJ4IW29vL2yOKLKWN+stACO 1g7Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=r+Ae4iYq; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::635 as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadband-forum.org Original-Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com. [2a00:1450:4864:20::635]) by gmr-mx.google.com with ESMTPS id gn21-20020a1709070d1500b009784e84a79dsi1179095ejc.0.2023.06.15.03.13.31 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Jun 2023 03:13:31 -0700 (PDT) Received-SPF: pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::635 as permitted sender) client-ip=2a00:1450:4864:20::635; Original-Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-9829b12b80fso106114866b.2 for ; Thu, 15 Jun 2023 03:13:31 -0700 (PDT) X-Received: by 2002:a17:907:72ca:b0:96f:1f79:c0a6 with SMTP id du10-20020a17090772ca00b0096f1f79c0a6mr18427595ejc.70.1686824010519; Thu, 15 Jun 2023 03:13:30 -0700 (PDT) In-Reply-To: <37d8c191-388e-164e-6955-9014b4f0a4a0-FcZObrvlYduBUy7/sJONFg@public.gmane.org> X-Original-Sender: wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=r+Ae4iYq; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::635 as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadband-forum.org X-Original-From: William Lupton 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:32823 Archived-At: --000000000000f22bb305fe285189 Content-Type: text/plain; charset="UTF-8" Can you give an outline of how you're processing Image and Figure elements? If you're changing the image style in Image() and then return the modified image then I would indeed expect this modified image to show up in Figure() (which, with the default traversal order, will be called later). I tried a simple example and it seemed to work as expected. Also note that https://pandoc.org/lua-filters.html#pandoc.utils.stringify expects an element (Pandoc, Meta, Block, or Inline). I guess you can't pass it an https://pandoc.org/lua-filters.html#type-attributes object; when I tried your code I got this error: Error running filter figure.lua: table expected, got AttributeList stack traceback: figure.lua:5: in function 'Figure' On Thu, 15 Jun 2023 at 02:19, H wrote: > On 06/14/2023 01:30 PM, BPJ wrote: > > > > Pandoc's document module used to not support attributes at all. IIRC > attributes were first introduced for fenced code blocks, then extended to > inline code. Spans and divs (in the Pandoc sense) were introduced > specifically to provide containers for arbitrary content to which > attributes can be attached. At the same time (IIRC) attributes were > extended to headings ("Header"), links and images. It was decided not to > extend attributes to other elements as that would entail huge changes to > the code base. Later when Pandoc's table model was changed the new table > model included attributes. > > > > Code needs attributes to allow to attach highlighting information to it, > and headings and images need them too for various reasons, and links > probably came along for the ride together with images. Normally divs and > spans are enough for all other cases, because in regular CSS in an external > file or embedded in the `` of an HTML document you can use a child > selector, e.g. in Markdown you type > > > > ``````markdown > > :::class > > **** > > ::: > > `````` > > > > and then you style the rule with > > > > ``````css > > div.class hr { ... } > > `````` > > > > Your imposed limitation of not being able to use external CSS creates > problems which most users simply don't have. For the horizontal rule case > you can use a raw block to insert the HTML directly, if you are not going > to generate other formats from the source: > > > > ``````markdown > > Para before. > > > > ```{=html} > >
> > ``` > > > > Para after > > `````` > > > > You can also use a filter to do things like this: > > > > ``````lua > > local hr_filter = { > > HorizontalRule = function() > > return pandoc.RawBlock('html', '
') > > end > > } > > function Div(div) > > if div.classes:includes('class') then > > return div:walk(hr_filter).content > > end > > end > > `````` > > > > > > I sometimes post-process HTML generated by pandoc with with Mojo::Dom < > https://metacpan.org/pod/Mojo::DOM> to transfer attributes from wrapping > divs/spans to contained elements and remove the wrapper, or just to set > attributes to elements contained in wrappers. The API makes such changes > very easy. You basically find elements in an HTML document with CSS > selectors, then loop through the found elements and change them in-place > with Perl code. Adding/removing/changing attributes is very easy: you just > treat the element object as if it is a hash (associative array) reference > containing the attributes! Then when you are done you print the document > object to a file or stdout. > > > Thank you for the explanation. I did resort to creating the
in > the filter. > > Now another problem - I have multiple images in my markdown document and a >
tag pair gets added around the which is fine. > > However, while processing the
block I want to make changes to the > default style attribute for some of the images. Using the logging > module I find e.g.: > > (#) figure Figure { > attr: Attr { > attributes: AttributeList { > style: "margin: 0px;" > } > classes: List {} > identifier: "" > } > caption: { > long: Blocks {} > } > content: Blocks[1] { > [1] Plain { > content: Inlines[1] { > [1] Image { > attr: Attr { > attributes: AttributeList {} > classes: List {} > identifier: "" > } > caption: Inlines[1] { > [1] Str "whatever" > } > src: "https://www.somedomain.tld/images/someimage.jpg" > title: "" > } > } > } > } > } > > > and if look at the logging output for the Image I find: > > #) image Image { > attr: Attr { > attributes: AttributeList { > style: "height: auto; width: 100%; object-fit: contain;" > } > classes: List {} > identifier: "" > } > caption: Inlines[1] { > [1] Str "whatever" > } > src: "https://www.somedomain.tld/images/someimage.jpg" > title: "" > } > > While processing the Figure element in the filter, I want to change the > style attributes for the Image listed above. They show up correctly in the > logging module output for Image above but the logging output for Figure > shows an empty list. > > I thought > print(pandoc.utils.stringify(el.content[1].content[1].attr.attributes)) > would give me the attributes but it does not. > > Could this be a bug? > > -- > 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/37d8c191-388e-164e-6955-9014b4f0a4a0%40meddatainc.com > . > -- 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/CAEe_xxiL-3qDCB8EpKca2YpAaAtamAYdX%3DantnbJRHJpzUkWow%40mail.gmail.com. --000000000000f22bb305fe285189 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Can you give an outline of how you're processing Image= and Figure elements? If you're changing the image style in Image() and= then return the modified image then I would indeed expect this modified im= age to show up in Figure() (which, with the default traversal order, will b= e called later). I tried a simple example and it seemed to work as expected= .

Also note that=C2=A0https://pandoc.org/lua-filters.html#pa= ndoc.utils.stringify expects an element (Pandoc, Meta, Block, or Inline= ). I guess you can't pass it an=C2=A0https://pandoc.org/lua-filters.html#type-attr= ibutes object; when I tried your code I got this error:

<= /div>
Error running filter figure.lua:
tabl= e expected, got AttributeList
stack traceback:
figure.lua:5: in func= tion 'Figure'


=
On Thu, 15 Jun 2023 at 02:19, H <<= a href=3D"mailto:agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org">agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org> wrote= :
On 06/14/2023 = 01:30 PM, BPJ wrote:
>
> Pandoc's document module used to not support attributes at all. II= RC attributes were first introduced for fenced code blocks, then extended t= o inline code. Spans and divs (in the Pandoc sense) were introduced specifi= cally to provide containers for arbitrary content to which attributes can b= e attached. At the same time (IIRC) attributes were extended to headings (&= quot;Header"), links and images. It was decided not to extend attribut= es to other elements as that would entail huge changes to the code base. La= ter when Pandoc's table model was changed the new table model included = attributes.
>
> Code needs attributes to allow to attach highlighting information to i= t, and headings and images need them too for various reasons, and links pro= bably came along for the ride together with images. Normally divs and spans= are enough for all other cases, because in regular CSS in an external file= or embedded in the `<head>` of an HTML document you can use a child = selector, e.g. in Markdown you type
>
> ``````markdown
> :::class
> ****
> :::
> ``````
>
> and then you style the rule with
>
> ``````css
> div.class hr { ... }
> ``````
>
> Your imposed limitation of not being able to use external CSS creates = problems which most users simply don't have. For the horizontal rule ca= se you can use a raw block to insert the HTML directly, if you are not goin= g to generate other formats from the source:
>
> ``````markdown
> Para before.
>
> ```{=3Dhtml}
> <hr style=3D"...">
> ```
>
> Para after
> ``````
>
> You can also use a filter to do things like this:
>
> ``````lua
> local hr_filter =3D {
> =C2=A0 HorizontalRule =3D function()
> =C2=A0 =C2=A0 return pandoc.RawBlock('html', '<hr style= =3D"...">')
> =C2=A0 end
> }
> function Div(div)
> =C2=A0 if div.classes:includes('class') then
> =C2=A0 =C2=A0 return div:walk(hr_filter).content
> =C2=A0 end
> end
> ``````
> =C2=A0=C2=A0
>
> I sometimes post-process HTML generated by pandoc with with Mojo::Dom = <https://metacpan.org/pod/Mojo::DOM> to transfer attribu= tes from wrapping divs/spans to contained elements and remove the wrapper, = or just to set attributes to elements contained in wrappers. The API makes = such changes very easy. You basically find elements in an HTML document wit= h CSS selectors, then loop through the found elements and change them in-pl= ace with Perl code. Adding/removing/changing attributes is very easy: you j= ust treat the element object as if it is a hash (associative array) referen= ce containing the attributes! Then when you are done you print the document= object to a file or stdout.
>
Thank you for the explanation. I did resort to creating the <hr ... />= ; in the filter.

Now another problem - I have multiple images in my markdown document and a = <figure></figure> tag pair gets added around the <image> = which is fine.

However, while processing the <figure> block I want to make changes t= o the default style attribute <image> for some of the images. Using t= he logging module I find e.g.:

(#) figure Figure {
=C2=A0 attr: Attr {
=C2=A0=C2=A0=C2=A0 attributes: AttributeList {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 style: "margin: 0px;"
=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0 classes: List {}
=C2=A0=C2=A0=C2=A0 identifier: ""
=C2=A0 }
=C2=A0 caption: {
=C2=A0=C2=A0=C2=A0 long: Blocks {}
=C2=A0 }
=C2=A0 content: Blocks[1] {
=C2=A0=C2=A0=C2=A0 [1] Plain {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 content: Inlines[1] {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [1] Image {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 attr: Attr {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 attribut= es: AttributeList {}
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 classes:= List {}
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 identifi= er: ""
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 caption: Inlines[1] = {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [1] Str = "whatever"
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 src: "https://www.somedomain.tld/images/someimage.jpg" =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 title: ""<= br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0 }
=C2=A0 }
}


and if look at the logging output for the Image I find:

#) image Image {
=C2=A0 attr: Attr {
=C2=A0=C2=A0=C2=A0 attributes: AttributeList {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 style: "height: auto; width: 100%; obje= ct-fit: contain;"
=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0 classes: List {}
=C2=A0=C2=A0=C2=A0 identifier: ""
=C2=A0 }
=C2=A0 caption: Inlines[1] {
=C2=A0=C2=A0=C2=A0 [1] Str "whatever"
=C2=A0 }
=C2=A0 src: "https://www.somedomain.tld/images/s= omeimage.jpg"
=C2=A0 title: ""
}

While processing the Figure element in the filter, I want to change the sty= le attributes for the Image listed above. They show up correctly in the log= ging module output for Image above but the logging output for Figure shows = an empty list.

I thought
print(pandoc.utils.stringify(el.content[1].content[1].attr.attributes))
would give me the attributes but it does not.

Could this be a bug?

--
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 pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgi= d/pandoc-discuss/37d8c191-388e-164e-6955-9014b4f0a4a0%40meddatainc.com.=

--
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://group= s.google.com/d/msgid/pandoc-discuss/CAEe_xxiL-3qDCB8EpKca2YpAaAtamAYdX%3Dan= tnbJRHJpzUkWow%40mail.gmail.com.
--000000000000f22bb305fe285189--