Render inline file permalinks

This commit is contained in:
Mai-Lapyst 2024-03-15 13:44:42 +01:00
parent d1e808f803
commit 1d3240887c
No known key found for this signature in database
GPG key ID: F88D929C09E239F8
10 changed files with 468 additions and 4 deletions

View file

@ -8,6 +8,7 @@ import (
"context"
"errors"
"fmt"
"html/template"
"io"
"net/url"
"path/filepath"
@ -16,6 +17,7 @@ import (
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/translation"
"code.gitea.io/gitea/modules/util"
"github.com/yuin/goldmark/ast"
@ -31,6 +33,8 @@ const (
type ProcessorHelper struct {
IsUsernameMentionable func(ctx context.Context, username string) bool
GetRepoFileContent func(ctx context.Context, ownerName, repoName, commitSha, filePath string) ([]template.HTML, error)
GetLocale func(ctx context.Context) (translation.Locale, error)
ElementDir string // the direction of the elements, eg: "ltr", "rtl", "auto", default to no direction attribute
}