bytesparadise / libasciidoc

A Golang library for processing Asciidoc files.
Apache License 2.0
196 stars 23 forks source link

Generate alt text from filename for data-uri images #1114

Open rxt1077 opened 5 months ago

rxt1077 commented 5 months ago

When the data-uri attribute is set and the alt text is not specified for images, renderImageAlt (pkg/renderer/sgml/image.go) gives an alt text of "." from the src URL. For example:

= data-uri without alt
:data-uri:

image::test/images/favicon-glasses-16x16.png[]

Yields a document with the img tag: <img src="data:image/jpg;base64,/9j..." alt=".">