summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorÖzgür Kesim <oec@codeblau.de>2024-04-12 19:25:15 +0200
committerÖzgür Kesim <oec@codeblau.de>2024-04-12 19:25:15 +0200
commitd986a9e168ee90c8b51abb7d871df9785e8723cc (patch)
tree79964db2221be2118ab6522a0081d263660122ed /main.go
parentca94735b7ae2f8ee47c80c7bc1e6074e8368bac4 (diff)
fix off-by-one of reference indeces
Diffstat (limited to 'main.go')
-rw-r--r--main.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.go b/main.go
index 9290c6c..59f3648 100644
--- a/main.go
+++ b/main.go
@@ -58,6 +58,7 @@ var fm = template.FuncMap{
}
return buf.String()
},
+ "plusone": func(i int) int { return i + 1 },
}
var tmpl = template.Must(template.New("output").
Funcs(fm).
@@ -65,7 +66,7 @@ var tmpl = template.Must(template.New("output").
{{.Output}}
{{ with .References }}{{- range $i, $ref := . }}
-[{{$i}}]: [{{$ref.Title}}]({{$ref.URL}})
+[{{ plusone $i }}]: [{{$ref.Title}}]({{$ref.URL}})
{{ quote $ref.Snippet }}
{{- end }}
{{- end }}