diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2025-12-12 19:21:22 +0100 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2025-12-12 19:21:22 +0100 |
| commit | a815c291074b454d4bb1a31067cd363c84df1360 (patch) | |
| tree | b04e3e048fdd15caff2c9127d7598b04b47178a7 /markdown/eval.go | |
| parent | d56090d43c925dbbd22a3e0c3f6d541674a09697 (diff) | |
refactor(frontend): remove JS files
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) } |
