Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Commit

Permalink
Fix trailing whitespace when no content
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel F. Dickinson <[email protected]>
  • Loading branch information
danielfdickinson committed Jan 15, 2022
1 parent ecc340d commit 0bcdfc1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions layouts/partials/helpers/basic-content.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{- /* If there is are H1 elements in content rendered from content file, replace H1 with H2 */ -}}
{{- if . -}}
{{- if gt (len (findRE "<h1.*?>(.|\n)*?</h1>" .)) 0 }}
{{ replaceRE "<h1(.*?)id=\"(.*?)\"(.*?)>((.*|\n)*?)</h1>" "<h2 $1 id=\"$2-831\"$3>$5</h2>" . | safeHTML -}}
{{- else }}
{{ . | safeHTML -}}
{{- if gt (len (findRE "<h1.*?>(.|\n)*?</h1>" .)) 0 -}}
{{- replaceRE "<h1(.*?)id=\"(.*?)\"(.*?)>((.*|\n)*?)</h1>" "<h2 $1 id=\"$2-831\"$3>$5</h2>" . | safeHTML -}}
{{- else -}}
{{- . | safeHTML -}}
{{- end -}}
{{- end -}}

0 comments on commit 0bcdfc1

Please sign in to comment.