1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-07 11:07:20 +00:00

Fix missing images in editor preview due to wrong links (#31299) (#31393)

Backport #31299

Parse base path and tree path so that media links can be correctly
created with /media/.

Resolves #31294

---------

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
This commit is contained in:
wxiaoguang
2024-06-17 15:07:21 +08:00
committed by GitHub
parent 3f44844244
commit fa307167f9
5 changed files with 102 additions and 77 deletions

View File

@ -84,10 +84,10 @@ type RenderContext struct {
}
type Links struct {
AbsolutePrefix bool
Base string
BranchPath string
TreePath string
AbsolutePrefix bool // add absolute URL prefix to auto-resolved links like "#issue", but not for pre-provided links and medias
Base string // base prefix for pre-provided links and medias (images, videos)
BranchPath string // actually it is the ref path, eg: "branch/features/feat-12", "tag/v1.0"
TreePath string // the dir of the file, eg: "doc" if the file "doc/CHANGE.md" is being rendered
}
func (l *Links) Prefix() string {