1
0
Fork 0
forked from forgejo/forgejo

Clickable links in pull request (and issue) titles (#13695)

* clickable links in pull request (and issue) titles #13658

reuses the existing logic to render clickable links in commit messages

* dedicated RenderIssueTitle function

applied patch from @mrsdizzie
This commit is contained in:
Jimmy Praet 2020-12-03 11:50:47 +01:00 committed by GitHub
parent 18712eab79
commit 056b8f5b52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 1 deletions

View file

@ -268,6 +268,25 @@ func RenderCommitMessageSubject(
return ctx.postProcess(rawHTML)
}
// RenderIssueTitle to process title on individual issue/pull page
func RenderIssueTitle(
rawHTML []byte,
urlPrefix string,
metas map[string]string,
) ([]byte, error) {
ctx := &postProcessCtx{
metas: metas,
urlPrefix: urlPrefix,
procs: []processor{
issueIndexPatternProcessor,
sha1CurrentPatternProcessor,
emojiShortCodeProcessor,
emojiProcessor,
},
}
return ctx.postProcess(rawHTML)
}
// RenderDescriptionHTML will use similar logic as PostProcess, but will
// use a single special linkProcessor.
func RenderDescriptionHTML(