README
¶
goldmark-images
Goldmark image replacer extension.
imageURL := func (src string) string {
return "test-" + src
}
source := []byte(``)
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>
Documentation
¶
Overview ¶
Package images is a extension for the goldmark (http://github.com/yuin/goldmark).
This extension adds replacer render to change image urls.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(r ReplaceFunc, options ...html.Option) goldmark.Extender
New return initialized image render with source url replacing support.
func NewReplacer ¶
func NewReplacer(r ReplaceFunc) goldmark.Option
NewReplacer adding src url replacing function to image html render.
Types ¶
type ReplaceFunc ¶
ReplaceFunc is a function for replacing image source link.
Click to show internal directories.
Click to hide internal directories.