feat: Convert templ components to gomponents
1 file changed, 17 insertions(+), 0 deletions(-)
changed files
M internal/nix/option.go → internal/nix/option.go
@@ -1,5 +1,13 @@ package nix +import ( + "io" + + "github.com/yuin/goldmark" + "github.com/yuin/goldmark/extension" + "gitlab.com/tozd/go/errors" +) + type Markdown string type Value struct {@@ -35,3 +43,12 @@ func (p Option) GetSource() string { return p.Source } + +var md = goldmark.New( + goldmark.WithExtensions(extension.NewLinkify()), +) + +// implements gomponent.Node +func (text Markdown) Render(w io.Writer) error { + return errors.WithStack(md.Convert([]byte(text), w)) +}