summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormrsdizzie <info@mrsdizzie.com>2019-05-05 15:39:10 -0400
committertechknowlogick <hello@techknowlogick.com>2019-05-05 15:39:10 -0400
commit00b883880d320a9340b35cd3fa9ff6e60010ac76 (patch)
tree6f642d5a0a49dc4239af6efac9aa001a2c5ba4dc
parent9148e45ed71abafa910d1498522e3408d479bfe3 (diff)
downloadgitea-00b883880d320a9340b35cd3fa9ff6e60010ac76.tar.gz
gitea-00b883880d320a9340b35cd3fa9ff6e60010ac76.zip
Don't post process commit summary in templates (#6842)
* 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 * 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
-rw-r--r--templates/repo/commits_table.tmpl2
-rw-r--r--templates/repo/view_list.tmpl4
2 files changed, 3 insertions, 3 deletions
diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl
index 8c8cdf2094..66bfd0d831 100644
--- a/templates/repo/commits_table.tmpl
+++ b/templates/repo/commits_table.tmpl
@@ -68,7 +68,7 @@
</a>
</td>
<td class="message collapsing">
- <span class="has-emoji{{if gt .ParentCount 1}} grey text{{end}}">{{RenderCommitMessage .Summary $.RepoLink $.Repository.ComposeMetas}}</span>
+ <span class="has-emoji{{if gt .ParentCount 1}} grey text{{end}}">{{.Summary}}</span>
{{if IsMultilineCommitMessage .Message}}
<button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
<pre class="commit-body" style="display: none;">{{RenderCommitBody .Message $.RepoLink $.Repository.ComposeMetas}}</pre>
diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl
index 089221480c..f4ef4e2e40 100644
--- a/templates/repo/view_list.tmpl
+++ b/templates/repo/view_list.tmpl
@@ -27,7 +27,7 @@
</div>
{{end}}
</a>
- <span class="grey has-emoji">{{RenderCommitMessage .LatestCommit.Summary .RepoLink $.Repository.ComposeMetas}}
+ <span class="grey has-emoji">{{.LatestCommit.Summary}}
{{if IsMultilineCommitMessage .LatestCommit.Message}}
<button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
<pre class="commit-body" style="display: none;">{{RenderCommitBody .LatestCommit.Message $.RepoLink $.Repository.ComposeMetas}}</pre>
@@ -79,7 +79,7 @@
</td>
{{end}}
<td class="message collapsing has-emoji">
- {{RenderCommitMessageLink $commit.Summary $.RepoLink (print $.RepoLink "/commit/" $commit.ID) $.Repository.ComposeMetas}}
+ <a href="{{$.RepoLink}}/commit/{{$commit.ID}}">{{$commit.Summary}}</a>
</td>
<td class="text grey right age">{{TimeSince $commit.Committer.When $.Lang}}</td>
</tr>