mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-14 08:52:53 +00:00
refactor: external render (#38885)
make the "command variable replacement" more accurate and OS-independent, add a test for it.
This commit is contained in:
@@ -64,6 +64,7 @@ func RenderMarkup(ctx *context.Base, ctxRepo *context.Repository, mode, text, ur
|
||||
treePath = path.Dir(filePath) // it is "doc" if filePath is "doc/CHANGE.md"
|
||||
refPath = strings.Join(fields[3:], "/") // it is "branch/features/feat-12/doc"
|
||||
refPath = strings.TrimSuffix(refPath, "/"+treePath) // now we get the correct branch path: "branch/features/feat-12"
|
||||
refPath = util.PathEscapeSegments(refPath)
|
||||
} else if fields = strings.SplitN(repoLinkPath, "/", 3); len(fields) == 2 {
|
||||
repoOwnerName, repoName = fields[0], fields[1]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user