Refactor to avoid excess spaces and newlines in output.
This commit is contained in:
@@ -1,19 +1,20 @@
|
|||||||
{{ $src := .Get "src" | default (.Get 0)
|
{{ $src := .Get "src" | default (.Get 0)
|
||||||
}} {{ $type := .Get "type"
|
|
||||||
}} {{ if and (isset .Params "type") (not (eq $type ""))
|
|
||||||
}} {{ .Scratch.Set "type" $type
|
|
||||||
}} {{ else
|
|
||||||
}} {{ $type := strings.TrimSuffix $src (path.Ext $src)
|
|
||||||
}} {{ $type := strings.TrimPrefix "." $type
|
|
||||||
}} {{ .Scratch.Set "type" $type
|
|
||||||
}} {{ end
|
|
||||||
}}
|
}}
|
||||||
{{ $text := .Get "text"
|
{{ $type := .Get "type"
|
||||||
}} {{ if and (isset .Params "text") (not (eq $text ""))
|
}}{{ if and (isset .Params "type") (not (eq $type ""))
|
||||||
}} {{ .Scratch.Set "text" $text
|
}}{{ .Scratch.Set "type" $type
|
||||||
}} {{ else
|
}}{{ else
|
||||||
}} {{ .Scratch.Set "text" "Audio playback is not available on your browser."
|
}}{{ $type := strings.TrimSuffix $src (path.Ext $src)
|
||||||
}} {{ end
|
}}{{ $type := strings.TrimPrefix "." $type
|
||||||
|
}}{{ .Scratch.Set "type" $type
|
||||||
|
}}{{ end
|
||||||
|
}}
|
||||||
|
{{ $text := .Get "text"
|
||||||
|
}}{{ if and (isset .Params "text") (not (eq $text ""))
|
||||||
|
}}{{ .Scratch.Set "text" $text
|
||||||
|
}}{{ else
|
||||||
|
}}{{ .Scratch.Set "text" "Audio playback is not available on your browser."
|
||||||
|
}}{{ end
|
||||||
}}
|
}}
|
||||||
<audio controls>
|
<audio controls>
|
||||||
<source
|
<source
|
||||||
|
|||||||
Reference in New Issue
Block a user