mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-26 01:14:10 -05:00
Merge pull request #1402 from wqweto/develop
Allow file and directory names to contain percent character
This commit is contained in:
commit
678700b74d
3 changed files with 4 additions and 4 deletions
|
@ -178,7 +178,7 @@ var TemplateFuncs template.FuncMap = map[string]interface{}{
|
||||||
"Oauth2Name": Oauth2Name,
|
"Oauth2Name": Oauth2Name,
|
||||||
"ToUtf8": ToUtf8,
|
"ToUtf8": ToUtf8,
|
||||||
"EscapePound": func(str string) string {
|
"EscapePound": func(str string) string {
|
||||||
return strings.Replace(str, "#", "%23", -1)
|
return strings.Replace(strings.Replace(str, "%", "%25", -1), "#", "%23", -1)
|
||||||
},
|
},
|
||||||
"RenderCommitMessage": RenderCommitMessage,
|
"RenderCommitMessage": RenderCommitMessage,
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
{{ $l := Subtract $n 1}}
|
{{ $l := Subtract $n 1}}
|
||||||
{{range $i, $v := .Treenames}}
|
{{range $i, $v := .Treenames}}
|
||||||
{{if eq $i $l}}
|
{{if eq $i $l}}
|
||||||
<span class="bread">{{EscapePound $v}}</span>
|
<span class="bread">{{$v}}</span>
|
||||||
{{else}}
|
{{else}}
|
||||||
<span class="bread"><a href="{{EscapePound $.BranchLink}}/{{index $.Paths $i}}">{{$v}}</a></span>
|
<span class="bread"><a href="{{EscapePound $.BranchLink}}/{{index $.Paths $i}}">{{$v}}</a></span>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
<span class="octicon octicon-file-{{if or $entry.IsDir}}directory{{else}}text{{end}}"></span>
|
<span class="octicon octicon-file-{{if or $entry.IsDir}}directory{{else}}text{{end}}"></span>
|
||||||
</td>
|
</td>
|
||||||
<td class="name">
|
<td class="name">
|
||||||
<a href="{{EscapePound $.BranchLink}}/{{$.TreePath}}{{$entry.Name}}" class="text-truncate">{{$entry.Name}}</a>
|
<a href="{{EscapePound $.BranchLink}}/{{EscapePound $.TreePath}}{{EscapePound $entry.Name}}" class="text-truncate">{{$entry.Name}}</a>
|
||||||
</td>
|
</td>
|
||||||
{{end}}
|
{{end}}
|
||||||
<td class="sha">
|
<td class="sha">
|
||||||
|
@ -66,4 +66,4 @@
|
||||||
</table>
|
</table>
|
||||||
{{if .ReadmeExist}}
|
{{if .ReadmeExist}}
|
||||||
{{template "repo/view_file" .}}
|
{{template "repo/view_file" .}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
Loading…
Reference in a new issue