Fix 500 error of searching commits (#28576) (#28579)

Backport #28576 by wxiaoguang

Regression of #28454 . Now the string is escaped HTML, so it doesn't
need `| Safe`.

Fix #28575

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit acc8100d47bab3b13311bcf4c330b19e2153d4ca)
This commit is contained in:
Giteabot 2023-12-22 10:29:28 +08:00 committed by Earl Warren
parent 7ddb1291ea
commit 90a650d2b0
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
2 changed files with 2 additions and 2 deletions

View file

@ -31,7 +31,7 @@
<a href="{{$repo.Link}}/src/commit/{{$result.CommitID | PathEscape}}/{{$result.Filename | PathEscapeSegments}}#L{{.}}"><span>{{.}}</span></a> <a href="{{$repo.Link}}/src/commit/{{$result.CommitID | PathEscape}}/{{$result.Filename | PathEscapeSegments}}#L{{.}}"><span>{{.}}</span></a>
{{end}} {{end}}
</td> </td>
<td class="lines-code chroma"><code class="code-inner">{{.FormattedLines | Safe}}</code></td> <td class="lines-code chroma"><code class="code-inner">{{.FormattedLines}}</code></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -53,7 +53,7 @@
<a href="{{$.SourcePath}}/src/commit/{{PathEscape $result.CommitID}}/{{PathEscapeSegments $result.Filename}}#L{{.}}"><span>{{.}}</span></a> <a href="{{$.SourcePath}}/src/commit/{{PathEscape $result.CommitID}}/{{PathEscapeSegments $result.Filename}}#L{{.}}"><span>{{.}}</span></a>
{{end}} {{end}}
</td> </td>
<td class="lines-code chroma"><code class="code-inner">{{.FormattedLines | Safe}}</code></td> <td class="lines-code chroma"><code class="code-inner">{{.FormattedLines}}</code></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>