From a55aaaae129601df8ee2f2dfac7a29e3ba328b93 Mon Sep 17 00:00:00 2001 From: "j. mccann" Date: Fri, 3 May 2019 13:11:13 -0400 Subject: [PATCH 1/2] Don't post process commit summary in templates Don't run summary through render/post process to avoid it generating links and breaking certain views where the summary is already expected to be a link to the commit. For consistancy, disable processing of summary in all locations. Fixes #6809 --- templates/repo/commits_table.tmpl | 2 +- templates/repo/diff/page.tmpl | 2 +- templates/repo/view_list.tmpl | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl index 8c8cdf20944c7..66bfd0d831eb4 100644 --- a/templates/repo/commits_table.tmpl +++ b/templates/repo/commits_table.tmpl @@ -68,7 +68,7 @@ - {{RenderCommitMessage .Summary $.RepoLink $.Repository.ComposeMetas}} + {{.Summary}} {{if IsMultilineCommitMessage .Message}} diff --git a/templates/repo/diff/page.tmpl b/templates/repo/diff/page.tmpl index c8f5a3d9f0efc..bd0e1b644c22f 100644 --- a/templates/repo/diff/page.tmpl +++ b/templates/repo/diff/page.tmpl @@ -9,7 +9,7 @@ {{.i18n.Tr "repo.diff.browse_source"}} -

{{RenderCommitMessage .Commit.Message $.RepoLink $.Repository.ComposeMetas}}{{template "repo/commit_status" .CommitStatus}}

+

{{.Commit.Message}}{{template "repo/commit_status" .CommitStatus}}

{{if IsMultilineCommitMessage .Commit.Message}}
{{RenderCommitBody .Commit.Message $.RepoLink $.Repository.ComposeMetas}}
{{end}} diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 089221480cf90..f4ef4e2e409c9 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -27,7 +27,7 @@ {{end}} - {{RenderCommitMessage .LatestCommit.Summary .RepoLink $.Repository.ComposeMetas}} + {{.LatestCommit.Summary}} {{if IsMultilineCommitMessage .LatestCommit.Message}} @@ -79,7 +79,7 @@ {{end}} - {{RenderCommitMessageLink $commit.Summary $.RepoLink (print $.RepoLink "/commit/" $commit.ID) $.Repository.ComposeMetas}} + {{$commit.Summary}} {{TimeSince $commit.Committer.When $.Lang}} From f65c9bb10834d956ed065445c5cf51530ee9cabc Mon Sep 17 00:00:00 2001 From: "j. mccann" Date: Sat, 4 May 2019 12:53:42 -0400 Subject: [PATCH 2/2] Do process title on diff page On second thought, the title is often the only place a pull request number will exists so do process it on the individual diff page. This fixes the list view and still gives easy access to the PR link --- templates/repo/diff/page.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/diff/page.tmpl b/templates/repo/diff/page.tmpl index bd0e1b644c22f..c8f5a3d9f0efc 100644 --- a/templates/repo/diff/page.tmpl +++ b/templates/repo/diff/page.tmpl @@ -9,7 +9,7 @@ {{.i18n.Tr "repo.diff.browse_source"}} -

{{.Commit.Message}}{{template "repo/commit_status" .CommitStatus}}

+

{{RenderCommitMessage .Commit.Message $.RepoLink $.Repository.ComposeMetas}}{{template "repo/commit_status" .CommitStatus}}

{{if IsMultilineCommitMessage .Commit.Message}}
{{RenderCommitBody .Commit.Message $.RepoLink $.Repository.ComposeMetas}}
{{end}}