Goldmark image replacer extension.
imageURL := func (src string) string {
return "test-" + src
}
source := []byte(`![alt](image.png "title")`)
gm := goldmark.New(
images.NewReplacer(imageURL),
goldmark.WithRendererOptions(html.WithXHTML()),
)
err = gm.Convert(source, os.Stdout)
<p><img src="test-image.png" alt="alt" title="title" /></p>