From e057cc74d21d534ebe2b0e6f93a8f60cfff98d12 Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Thu, 15 Feb 2024 17:00:50 +0100 Subject: [PATCH] done --- layouts/partials/CorrectPunctuation | 6 ------ layouts/partials/PrepareHTML | 16 +++++++--------- layouts/partials/PrepareText | 12 ++++++------ 3 files changed, 13 insertions(+), 21 deletions(-) delete mode 100644 layouts/partials/CorrectPunctuation diff --git a/layouts/partials/CorrectPunctuation b/layouts/partials/CorrectPunctuation deleted file mode 100644 index 4671b77f..00000000 --- a/layouts/partials/CorrectPunctuation +++ /dev/null @@ -1,6 +0,0 @@ -{{ $correct := . }} -{{ $signs := slice ";" ":" "!" "?" }} -{{ range $signs }} - {{ $correct = replace $correct (printf " %s" .) (printf " %s" .) }} -{{ end }} -{{ return $correct }} diff --git a/layouts/partials/PrepareHTML b/layouts/partials/PrepareHTML index 2d3f25dd..ea37d601 100644 --- a/layouts/partials/PrepareHTML +++ b/layouts/partials/PrepareHTML @@ -1,10 +1,8 @@ -{{ return -safeHTML ( - chomp ( - partial "CorrectPunctuation" ( - partial "FilterIframeLazy" ( - . - ) +{{ +return + safeHTML ( + partial "FilterIframeLazy" ( + . ) - ) -) }} + ) +}} diff --git a/layouts/partials/PrepareText b/layouts/partials/PrepareText index a4d0f064..8944cd99 100644 --- a/layouts/partials/PrepareText +++ b/layouts/partials/PrepareText @@ -1,6 +1,6 @@ -{{ $text := . }} -{{ $text = replace $text "\r\n" "\n" }} -{{ $text = replace $text "\r" "\n" }} -{{ $text = replace $text "\n" "<br/>" }} -{{ $text = $text | safeHTML }} -{{ return $text}} \ No newline at end of file +{{ +return + safeHTML ( + . + ) +}} \ No newline at end of file -- GitLab