From 429e8b4e19365d921c01c5da45c6d4ce54f52a08ad168e3a3c54e17ba62bfa3a Mon Sep 17 00:00:00 2001 From: Nicholas Johnson Date: Fri, 25 Aug 2023 00:00:00 +0000 Subject: chomp() user content User content may contain newlines at the end of files, which create problems for spacing in Gemini. --- layouts/_default/single.gmi | 2 +- layouts/_default/single.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'layouts/_default') diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi index ab94304..cc98bc6 100644 --- a/layouts/_default/single.gmi +++ b/layouts/_default/single.gmi @@ -7,7 +7,7 @@ {{ end -}} # {{ .Name | safeHTML }} -{{ $content := .RawContent -}} +{{ $content := chomp (.RawContent) -}} {{ $scratch := newScratch -}} {{/* split text into chunks, with each chunk containing 3 parts: above, within, and below preformatted text */ -}} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 52e7ad4..2819d29 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -6,6 +6,6 @@

{{ partial "pageinfo.html" . }}

{{ end }}

{{ .Name }}

- {{ .Content -}} + {{ chomp (.Content) -}}
{{- end }} \ No newline at end of file -- cgit v1.2.3