From 3873031c8ce056bb4f5d0f9d9d4bd0e7e59f4017 Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Tue, 18 Jan 2022 11:10:50 +0100 Subject: [PATCH] strip --- app/helpers/admin/application_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/helpers/admin/application_helper.rb b/app/helpers/admin/application_helper.rb index ec02a765a..6bcd222ea 100644 --- a/app/helpers/admin/application_helper.rb +++ b/app/helpers/admin/application_helper.rb @@ -75,6 +75,7 @@ module Admin::ApplicationHelper indentation = ' ' # Beware, it works only at level one, with 2 spaces strip_tags(text) .dup + .strip .gsub("\r\n", "\n") # Remove useless \r .gsub("\n", "\n#{indentation}") # Indent properly to avoid broken frontmatter .chomp # Remove extra newlines -- GitLab