From 04bb52dc9c23e55df0d29e354b2014cb184c54d8 Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Mon, 17 Jan 2022 19:13:51 +0100 Subject: [PATCH] fix --- app/helpers/admin/application_helper.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/helpers/admin/application_helper.rb b/app/helpers/admin/application_helper.rb index b73956e65..a91284ef7 100644 --- a/app/helpers/admin/application_helper.rb +++ b/app/helpers/admin/application_helper.rb @@ -72,12 +72,12 @@ module Admin::ApplicationHelper end def prepare_text_for_static(text) - # Beware, it works only at level one, with 2 spaces - indentation = ' ' - text = strip_tags text.to_s - text.gsub! "\r\n", "\n" # Remove useless \r - text.gsub! "\n", "\n#{indentation}" # Indent properly to avoid broken frontmatter - text.chomp + indentation = ' ' # Beware, it works only at level one, with 2 spaces + strip_tags text.to_s + .dup + .gsub("\r\n", "\n") # Remove useless \r + .gsub("\n", "\n#{indentation}") # Indent properly to avoid broken frontmatter + .chomp end def collection_tree(list, except = nil) -- GitLab