diff options
Diffstat (limited to 'markdown/eval.go')
| -rw-r--r-- | markdown/eval.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/markdown/eval.go b/markdown/eval.go index 56bb989..376e577 100644 --- a/markdown/eval.go +++ b/markdown/eval.go @@ -3,7 +3,8 @@ package markdown import "html/template" type Option struct { - ImageSource func(string) string + ImageSource func(source string) string + RenderLink func(content, href string) template.HTML } func Parse(s string, opt *Option) (template.HTML, *ParseError) { @@ -18,6 +19,9 @@ func Parse(s string, opt *Option) (template.HTML, *ParseError) { if opt.ImageSource == nil { opt.ImageSource = func(s string) string { return s } } + if opt.RenderLink == nil { + opt.RenderLink = RenderLink + } return tree.Eval(opt) } |
