mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-15 00:01:25 -04:00
Compare commits
No commits in common. "263d06f6161d9268f1ed0520e7a75a5bb81ad4da" and "fd2c250b525b623f5bc1b925fa42076972ec25d1" have entirely different histories.
263d06f616
...
fd2c250b52
@ -358,19 +358,12 @@ func postProcess(ctx *RenderContext, procs []processor, input io.Reader, output
|
||||
}
|
||||
|
||||
func visitNode(ctx *RenderContext, procs, textProcs []processor, node *html.Node) {
|
||||
// Add user-content- to IDs and "#" links if they don't already have them
|
||||
// Add user-content- to IDs if they don't already have them
|
||||
for idx, attr := range node.Attr {
|
||||
val := strings.TrimPrefix(attr.Val, "#")
|
||||
notHasPrefix := !(strings.HasPrefix(val, "user-content-") || blackfridayExtRegex.MatchString(val))
|
||||
|
||||
if attr.Key == "id" && notHasPrefix {
|
||||
if attr.Key == "id" && !(strings.HasPrefix(attr.Val, "user-content-") || blackfridayExtRegex.MatchString(attr.Val)) {
|
||||
node.Attr[idx].Val = "user-content-" + attr.Val
|
||||
}
|
||||
|
||||
if attr.Key == "href" && strings.HasPrefix(attr.Val, "#") && notHasPrefix {
|
||||
node.Attr[idx].Val = "#user-content-" + val
|
||||
}
|
||||
|
||||
if attr.Key == "class" && attr.Val == "emoji" {
|
||||
textProcs = nil
|
||||
}
|
||||
|
@ -1381,7 +1381,7 @@ func CleanUpPullRequest(ctx *context.Context) {
|
||||
}
|
||||
|
||||
func deleteBranch(ctx *context.Context, pr *issues_model.PullRequest, gitRepo *git.Repository) {
|
||||
fullBranchName := pr.HeadRepo.FullName() + ":" + pr.HeadBranch
|
||||
fullBranchName := pr.HeadRepo.Owner.Name + "/" + pr.HeadBranch
|
||||
if err := repo_service.DeleteBranch(ctx.Doer, pr.HeadRepo, gitRepo, pr.HeadBranch); err != nil {
|
||||
switch {
|
||||
case git.IsErrBranchNotExist(err):
|
||||
|
@ -187,7 +187,7 @@ func TestPullCleanUpAfterMerge(t *testing.T) {
|
||||
htmlDoc := NewHTMLParser(t, resp.Body)
|
||||
resultMsg := htmlDoc.doc.Find(".ui.message>p").Text()
|
||||
|
||||
assert.EqualValues(t, "Branch 'user1/repo1:feature/test' has been deleted.", resultMsg)
|
||||
assert.EqualValues(t, "Branch 'user1/feature/test' has been deleted.", resultMsg)
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user