/goldmark-images

Goldmark image replacer extension

Primary LanguageGoMIT LicenseMIT

goldmark-images

GoDoc

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>