You can learn which elements have an “attributes” field from the doc: https://pandoc.org/lua-filters.html Le Tuesday 13 June 2023 à 08:34:05PM, H a écrit :On 06/13/2023 06:53 PM, H wrote:On 06/13/2023 06:05 PM, H wrote:On 06/13/2023 05:27 PM, Bastien DUMONT wrote:attr.style = 'color: #112233;'Wonderful, many thanks! Btw, I was reading my email in the reverse order or I would have found this before my other post...How can I similarly add a style to an <image ...> tag? This <image ...> tag is wrapped inside a <figure> tag.Besides adding a style to <img ...> (Image) elements, I also want to add a style to <hr /> (HorizontalRule). It seems that the following does not work: local style_hr = 'border-top-style: solid; border-top-width: thin; border-color: #cc002b;' if (el.type == 'HorizontalRule') then local attr = el.attributes attr.style = style_hr end The desired output is: <hr style="border-top-style: solid; border-top-width: thin; border-color: #cc002b;" /> Pandoc fails assigning the style, however, adding the code to the html file shows it is valid html code. Have I missed something or might 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org. To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/61724767-ada0-133f-6751-5884c7460a25%40meddatainc.com.
Corre,t in that list HorizontalRule does not have an attributes field but ought it not to have one?
My example above is, after all, valid HTML code. I have for now worked around it by creating the desired <hr ... /> tag in my code but it would be much more elegant to to be able to add style information to HorizontalRule.