Improve presentation of template lookup order (#1382)

Closes #1374
This commit is contained in:
Joe Mooring 2021-04-14 21:33:50 -07:00 committed by GitHub
parent b73da986de
commit 363251a517
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,8 +20,19 @@
{{ range $k, $v := . }}
{{ $.Scratch.Set $k $v }}
{{ end }}
{{ range $fields }}
<td>{{ $.Scratch.Get . }}</td>
{{ range $k, $v := $fields }}
<td>
{{ $tdContent := $.Scratch.Get . }}
{{ if eq $k 3 }}
{{ printf "%v" $tdContent |
strings.ReplaceRE `\[` "<ol><li>" |
strings.ReplaceRE `\s` "</li><li>" |
strings.ReplaceRE `\]` "</li></ol>" |
safeHTML }}
{{ else }}
{{ $tdContent }}
{{ end}}
</td>
{{ end }}
</tr>
{{ end }}