diff --git a/app/helpers/admin/application_helper.rb b/app/helpers/admin/application_helper.rb index ec02a765ad60c9502a943f34e5e3e955def58c7d..6bcd222ea4610a2b52dcde2cfbd9a74203f9014e 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