refactor: replace markdown renderer (#40)

The new renderer is actually published as a module and can be extended
through the usual goldmark extensions.
This commit is contained in:
Julian Tölle 2024-08-31 16:49:07 +02:00 committed by GitHub
parent a0a064d387
commit 4cb22eae10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 49 additions and 900 deletions

View file

@ -1,17 +1,15 @@
package markdown
import (
markdown "github.com/teekennedy/goldmark-markdown"
"github.com/yuin/goldmark"
"github.com/yuin/goldmark/renderer"
"github.com/yuin/goldmark/util"
"github.com/apricote/releaser-pleaser/internal/markdown/extensions"
"github.com/apricote/releaser-pleaser/internal/markdown/renderer/markdown"
)
func New() goldmark.Markdown {
return goldmark.New(
goldmark.WithExtensions(extensions.Section),
goldmark.WithRenderer(renderer.NewRenderer(renderer.WithNodeRenderers(util.Prioritized(markdown.NewRenderer(), 1)))),
goldmark.WithRenderer(markdown.NewRenderer()),
)
}