Given the following (a simplified excerpt from much longer, not-yet-published code):
{{- $tw := slice (slice "50" "abc" "200") -}}
{{- $tw = $tw | append (slice "100" "def" "300") -}}
{{- $tw = $tw | append (slice "200" "ghi" "400") -}}
{{- $tw = $tw | append (slice "300" "jkl" "500") -}}
{{- $tw = $tw | append (slice "400" "mno" "600") -}}
{{- $tw = $tw | append (slice "500" "pqr" "700") -}}
{{- range $tw -}}
{{- $twNum1 := index . 0 -}}
{{- $twLtr := index . 1 -}}
{{- $twNum2 := index . 2 -}}
<p>{{ $twLtr }}</p>
{{- end -}}
…I would expect the output to be:
<p>abc</p>
<p>def</p>
<p>ghi</p>
<p>jkl</p>
<p>mno</p>
<p>pqr</p>
…but what should be the second line (from the first-appended slice) is turned into three lines, each of which has the ASCII value of the last character in the corresponding item of the slice "100" "def" "300"
:
<p>abc</p>
<p>48</p>
<p>101</p>
<p>48</p>
<p>ghi</p>
<p>jkl</p>
<p>mno</p>
<p>pqr</p>
I have also tried outputting $twNum1
and $twNum2
but, in each case, the second line becomes three separate lines with similar character-to-ASCII-value stuff, rather than the expected one-line output of the desired variable.
Have had no luck finding parallels either here in the Discourse or in general web searches. Will very much appreciate whatever help anyone can provide.