diff --git a/pkg/renderer/sgml/html5/image_test.go b/pkg/renderer/sgml/html5/image_test.go index dae88715..291dcd9e 100644 --- a/pkg/renderer/sgml/html5/image_test.go +++ b/pkg/renderer/sgml/html5/image_test.go @@ -427,5 +427,21 @@ image::favicon-glasses-16x16.png[Glasses]` Expect(RenderHTML(source)).To(MatchHTML(expected)) // TODO: check that the log/output contains a WARNING message (`image to embed not found or not readable`) }) + + It("missing alt text", func() { + source := ` +:imagesdir: ../../../../test/images +:data-uri: + +image::favicon-glasses-16x16.png[]` + + expected := `
+
+favicon glasses 16x16 +
+
+` + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) }) }) diff --git a/pkg/renderer/sgml/image.go b/pkg/renderer/sgml/image.go index ad4d398c..3d1ae511 100644 --- a/pkg/renderer/sgml/image.go +++ b/pkg/renderer/sgml/image.go @@ -46,7 +46,7 @@ func (r *sgmlRenderer) renderImageBlock(ctx *context, img *types.ImageBlock) (st return "", errors.Wrap(err, "unable to render image") } src := r.getImageSrc(ctx, img.Location) - alt, err := r.renderImageAlt(img.Attributes, src) + alt, err := r.renderImageAlt(img.Attributes, img.Location.ToString()) if err != nil { return "", errors.Wrap(err, "unable to render image") }