|
|
@ -609,7 +609,7 @@ func mentionProcessor(ctx *RenderContext, node *html.Node) { |
|
|
|
if ok && strings.Contains(mention, "/") { |
|
|
|
if ok && strings.Contains(mention, "/") { |
|
|
|
mentionOrgAndTeam := strings.Split(mention, "/") |
|
|
|
mentionOrgAndTeam := strings.Split(mention, "/") |
|
|
|
if mentionOrgAndTeam[0][1:] == ctx.Metas["org"] && strings.Contains(teams, ","+strings.ToLower(mentionOrgAndTeam[1])+",") { |
|
|
|
if mentionOrgAndTeam[0][1:] == ctx.Metas["org"] && strings.Contains(teams, ","+strings.ToLower(mentionOrgAndTeam[1])+",") { |
|
|
|
replaceContent(node, loc.Start, loc.End, createLink(util.URLJoin(setting.AppURL, "org", ctx.Metas["org"], "teams", mentionOrgAndTeam[1]), mention, "mention")) |
|
|
|
replaceContent(node, loc.Start, loc.End, createLink(util.URLJoin(ctx.Links.Prefix(), "org", ctx.Metas["org"], "teams", mentionOrgAndTeam[1]), mention, "mention")) |
|
|
|
node = node.NextSibling.NextSibling |
|
|
|
node = node.NextSibling.NextSibling |
|
|
|
start = 0 |
|
|
|
start = 0 |
|
|
|
continue |
|
|
|
continue |
|
|
@ -620,7 +620,7 @@ func mentionProcessor(ctx *RenderContext, node *html.Node) { |
|
|
|
mentionedUsername := mention[1:] |
|
|
|
mentionedUsername := mention[1:] |
|
|
|
|
|
|
|
|
|
|
|
if DefaultProcessorHelper.IsUsernameMentionable != nil && DefaultProcessorHelper.IsUsernameMentionable(ctx.Ctx, mentionedUsername) { |
|
|
|
if DefaultProcessorHelper.IsUsernameMentionable != nil && DefaultProcessorHelper.IsUsernameMentionable(ctx.Ctx, mentionedUsername) { |
|
|
|
replaceContent(node, loc.Start, loc.End, createLink(util.URLJoin(setting.AppURL, mentionedUsername), mention, "mention")) |
|
|
|
replaceContent(node, loc.Start, loc.End, createLink(util.URLJoin(ctx.Links.Prefix(), mentionedUsername), mention, "mention")) |
|
|
|
node = node.NextSibling.NextSibling |
|
|
|
node = node.NextSibling.NextSibling |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
node = node.NextSibling |
|
|
|
node = node.NextSibling |
|
|
@ -898,9 +898,9 @@ func issueIndexPatternProcessor(ctx *RenderContext, node *html.Node) { |
|
|
|
path = "pulls" |
|
|
|
path = "pulls" |
|
|
|
} |
|
|
|
} |
|
|
|
if ref.Owner == "" { |
|
|
|
if ref.Owner == "" { |
|
|
|
link = createLink(util.URLJoin(setting.AppURL, ctx.Metas["user"], ctx.Metas["repo"], path, ref.Issue), reftext, "ref-issue") |
|
|
|
link = createLink(util.URLJoin(ctx.Links.Prefix(), ctx.Metas["user"], ctx.Metas["repo"], path, ref.Issue), reftext, "ref-issue") |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
link = createLink(util.URLJoin(setting.AppURL, ref.Owner, ref.Name, path, ref.Issue), reftext, "ref-issue") |
|
|
|
link = createLink(util.URLJoin(ctx.Links.Prefix(), ref.Owner, ref.Name, path, ref.Issue), reftext, "ref-issue") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -939,7 +939,7 @@ func commitCrossReferencePatternProcessor(ctx *RenderContext, node *html.Node) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
reftext := ref.Owner + "/" + ref.Name + "@" + base.ShortSha(ref.CommitSha) |
|
|
|
reftext := ref.Owner + "/" + ref.Name + "@" + base.ShortSha(ref.CommitSha) |
|
|
|
link := createLink(util.URLJoin(setting.AppSubURL, ref.Owner, ref.Name, "commit", ref.CommitSha), reftext, "commit") |
|
|
|
link := createLink(util.URLJoin(ctx.Links.Prefix(), ref.Owner, ref.Name, "commit", ref.CommitSha), reftext, "commit") |
|
|
|
|
|
|
|
|
|
|
|
replaceContent(node, ref.RefLocation.Start, ref.RefLocation.End, link) |
|
|
|
replaceContent(node, ref.RefLocation.Start, ref.RefLocation.End, link) |
|
|
|
node = node.NextSibling.NextSibling |
|
|
|
node = node.NextSibling.NextSibling |
|
|
@ -1166,7 +1166,7 @@ func hashCurrentPatternProcessor(ctx *RenderContext, node *html.Node) { |
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
link := util.URLJoin(setting.AppURL, ctx.Metas["user"], ctx.Metas["repo"], "commit", hash) |
|
|
|
link := util.URLJoin(ctx.Links.Prefix(), ctx.Metas["user"], ctx.Metas["repo"], "commit", hash) |
|
|
|
replaceContent(node, m[2], m[3], createCodeLink(link, base.ShortSha(hash), "commit")) |
|
|
|
replaceContent(node, m[2], m[3], createCodeLink(link, base.ShortSha(hash), "commit")) |
|
|
|
start = 0 |
|
|
|
start = 0 |
|
|
|
node = node.NextSibling.NextSibling |
|
|
|
node = node.NextSibling.NextSibling |
|
|
|