refactor: replace markdown renderer

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:43:04 +02:00
parent a0a064d387
commit 43d9bbdfe6
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()),
)
}