Fix errors arising from short-circuit assumption
The and/or operators in text/template don't short-circuit, so this seemingly benign change caused a breakage when not fully tested.
This commit is contained in:
parent
64b16f4a50
commit
bd91b3eacf
1 changed files with 4 additions and 1 deletions
|
@ -178,7 +178,9 @@
|
||||||
{{ $html := .Message.HTMLPart }}
|
{{ $html := .Message.HTMLPart }}
|
||||||
{{ $text := .Message.TextPart }}
|
{{ $text := .Message.TextPart }}
|
||||||
<div class="tabs">
|
<div class="tabs">
|
||||||
{{ if and $html (ne $html.PathString $text.PathString) }}
|
{{ if and $html $text }}
|
||||||
|
{{ if ne $html.PathString $text.PathString }}
|
||||||
|
{{/* https://github.com/golang/go/issues/31103 */}}
|
||||||
<a
|
<a
|
||||||
href="?part={{.Message.TextPart.PathString}}"
|
href="?part={{.Message.TextPart.PathString}}"
|
||||||
{{ if eq $text.PathString .Part.PathString }}
|
{{ if eq $text.PathString .Part.PathString }}
|
||||||
|
@ -192,6 +194,7 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
>HTML</a>
|
>HTML</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
{{if .View}}
|
{{if .View}}
|
||||||
{{.View}}
|
{{.View}}
|
||||||
|
|
Loading…
Reference in a new issue