Great, that did it! T. On Friday, April 28, 2023 at 10:58:23 PM UTC+2 BPJ wrote: > You want `image.caption = 'image'` > > Den fre 28 apr. 2023 17:25ThomasH skrev: > >> I want to change the alt= attribute of an image during translation. This >> is my Lua filter: >> >> >> >> >> >> *function Image(elem) nelem = elem:clone() nelem.attributes.alt = >> 'image' return nelemend* >> >> It doesn't work, though. With HTML like >> >> >> > http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> >> >> >> >> >> See image: foobar >> >> >> >> I get an AST like this >> >> [ Plain >> [ Str "See" >> , Space >> , Str "image:" >> , Space >> , Image >> ( "" , [] , [ ( "alt" , "image" ) ] ) >> [ Str "foobar" ] >> ( "foo.jpg" , "" ) >> ] >> ] >> >> I'm not sure how to interprete the Image part, though. The Markdown >> output is: >> >> See image: ![foobar](foo.jpg){alt="image"} >> >> which shows that the original alt text is retained, and the intended >> replacement text is just added as if an arbitrary attribute. >> >> What is wrong with my filter? >> >> Thanks, T. >> >> -- >> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/pandoc-discuss/0c93ede7-c24c-4a7f-ab8f-1b6b0d6aa7c1n%40googlegroups.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/6b329ca9-dc71-488d-bbcf-8d8dea3c67fan%40googlegroups.com.