Skip to content

Commit 34ec8e0

Browse files
committed
refactor(tpls): prevent invoking unnecessary html func
1 parent f7a9b8f commit 34ec8e0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/tpl/page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<ol class="path-list">
1818
{{range .Paths}}
19-
<li><a href="{{.Path}}">{{html .Name}}</a></li>
19+
<li><a href="{{.Path}}">{{.Name}}</a></li>
2020
{{end}}
2121
</ol>
2222

@@ -49,7 +49,7 @@
4949
{{$isDir := .IsDir}}
5050
<li>
5151
<a href="{{$subItemPrefix}}{{.Name}}{{if $isDir}}/{{end}}" class="item {{if $isDir}}item-dir{{else}}item-file{{end}}">
52-
<span class="name">{{html .Name}}{{if $isDir}}/{{end}}</span>
52+
<span class="name">{{.Name}}{{if $isDir}}/{{end}}</span>
5353
<span class="size">{{if not $isDir}}{{fmtSize .Size}}{{end}}</span>
5454
<span class="time">{{fmtTime .ModTime}}</span>
5555
</a>

src/tpl/page.html.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const pageTplStr = `
2424
<body>
2525
<ol class="path-list">
2626
{{range .Paths}}
27-
<li><a href="{{.Path}}">{{html .Name}}</a></li>
27+
<li><a href="{{.Path}}">{{.Name}}</a></li>
2828
{{end}}
2929
</ol>
3030
{{if .CanUpload}}
@@ -54,7 +54,7 @@ const pageTplStr = `
5454
{{$isDir := .IsDir}}
5555
<li>
5656
<a href="{{$subItemPrefix}}{{.Name}}{{if $isDir}}/{{end}}" class="item {{if $isDir}}item-dir{{else}}item-file{{end}}">
57-
<span class="name">{{html .Name}}{{if $isDir}}/{{end}}</span>
57+
<span class="name">{{.Name}}{{if $isDir}}/{{end}}</span>
5858
<span class="size">{{if not $isDir}}{{fmtSize .Size}}{{end}}</span>
5959
<span class="time">{{fmtTime .ModTime}}</span>
6060
</a>

0 commit comments

Comments
 (0)