Fix 500 error of searching commits (#28576)

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

Fix #28575
pull/28484/head^2
wxiaoguang 11 months ago committed by GitHub
parent b35d3fddfa
commit 04b235d094
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      templates/code/searchresults.tmpl
  2. 2
      templates/repo/search.tmpl

@ -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>

@ -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>

Loading…
Cancel
Save