[CHORE] Remove github.com/yuin/goldmark-meta

- Remove a unused dependency. This dependency was added to handle YAML
'frontmatter' meta, parsing them and converting them to a table or
details in the resulting HTML. As can be read in the issue that reported
the behavior of YAML frontmatter being rendered literally,
https://github.com/go-gitea/gitea/issues/5377.
- It's an unused dependency as the codebase since then moved on to do this YAML
parsing and rendering on their own, this was implemented in
812cfd0ad9.
- Adds unit tests that was related to this functionality, to proof the
codebase already handles this and to prevent regressions.
This commit is contained in:
Gusted 2024-07-07 03:04:45 +02:00
parent 3ff661fe9e
commit cf8f26d616
No known key found for this signature in database
GPG key ID: FD821B732837125F
6 changed files with 125 additions and 17 deletions

View file

@ -22,7 +22,6 @@ import (
chromahtml "github.com/alecthomas/chroma/v2/formatters/html"
"github.com/yuin/goldmark"
highlighting "github.com/yuin/goldmark-highlighting/v2"
meta "github.com/yuin/goldmark-meta"
"github.com/yuin/goldmark/extension"
"github.com/yuin/goldmark/parser"
"github.com/yuin/goldmark/renderer"
@ -121,7 +120,6 @@ func SpecializedMarkdown() goldmark.Markdown {
math.NewExtension(
math.Enabled(setting.Markdown.EnableMath),
),
meta.Meta,
),
goldmark.WithParserOptions(
parser.WithAttribute(),
@ -182,7 +180,7 @@ func actualRender(ctx *markup.RenderContext, input io.Reader, output io.Writer)
bufWithMetadataLength := len(buf)
rc := &RenderConfig{
Meta: renderMetaModeFromString(string(ctx.RenderMetaAs)),
Meta: markup.RenderMetaAsDetails,
Icon: "table",
Lang: "",
}