chore: fix deprecation

This commit is contained in:
Gusted 2024-11-02 13:35:24 +01:00
parent 370dbbc579
commit e2fddcf681
No known key found for this signature in database
GPG key ID: FD821B732837125F
6 changed files with 36 additions and 7 deletions

View file

@ -7,6 +7,8 @@ package callout
import (
"strings"
"code.gitea.io/gitea/modules/markup/markdown/util"
"github.com/yuin/goldmark/ast"
"github.com/yuin/goldmark/parser"
"github.com/yuin/goldmark/text"
@ -40,7 +42,7 @@ func (g *GitHubLegacyCalloutTransformer) Transform(node *ast.Document, reader te
if !ok {
return ast.WalkContinue, nil
}
calloutText := string(calloutNode.Text(reader.Source()))
calloutText := string(util.Text(calloutNode, reader.Source()))
calloutType := strings.ToLower(calloutText)
// We only support "Note" and "Warning" callouts in legacy mode,
// match only those.