bytesparadise / libasciidoc

A Golang library for processing Asciidoc files.
Apache License 2.0
205 stars 25 forks source link

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

Open rxt1077 opened 10 months ago

rxt1077 commented 10 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=".">