strings.Replace takes its input as the FIRST argument, so piping into it appended the cell value as the last argument instead: the call evaluated as strings.Replace "\n" "<br>" .date, which returned a bare newline. Rows rendered with the correct count but no content. Pass the value explicitly instead. All 25 rows now render, with line breaks and the inline link in the 2020 entry preserved. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,8 +4,10 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{{ range . }}
|
{{ range . }}
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">{{ .date | strings.Replace "\n" "<br>" | safeHTML }}</th>
|
{{/* Note: strings.Replace takes the input FIRST, so it must not be piped
|
||||||
<td>{{ .description | strings.Replace "\n" "<br>" | safeHTML }}</td>
|
into -- a pipeline would append the value as the last argument. */}}
|
||||||
|
<th scope="row">{{ strings.Replace .date "\n" "<br>" | safeHTML }}</th>
|
||||||
|
<td>{{ strings.Replace .description "\n" "<br>" | safeHTML }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user