Skip to content

Commit b488887

Browse files
wxiaoguangtechknowlogick
authored andcommitted
Fix 500 error of searching commits (go-gitea#28576)
Regression of go-gitea#28454 . Now the string is escaped HTML, so it doesn't need `| Safe`. Fix go-gitea#28575
1 parent 041436d commit b488887

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

templates/code/searchresults.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<a href="{{$repo.Link}}/src/commit/{{$result.CommitID | PathEscape}}/{{$result.Filename | PathEscapeSegments}}#L{{.}}"><span>{{.}}</span></a>
3232
{{end}}
3333
</td>
34-
<td class="lines-code chroma"><code class="code-inner">{{.FormattedLines | Safe}}</code></td>
34+
<td class="lines-code chroma"><code class="code-inner">{{.FormattedLines}}</code></td>
3535
</tr>
3636
</tbody>
3737
</table>

templates/repo/search.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<a href="{{$.SourcePath}}/src/commit/{{PathEscape $result.CommitID}}/{{PathEscapeSegments $result.Filename}}#L{{.}}"><span>{{.}}</span></a>
5454
{{end}}
5555
</td>
56-
<td class="lines-code chroma"><code class="code-inner">{{.FormattedLines | Safe}}</code></td>
56+
<td class="lines-code chroma"><code class="code-inner">{{.FormattedLines}}</code></td>
5757
</tr>
5858
</tbody>
5959
</table>

0 commit comments

Comments
 (0)