diff --git a/app/helpers/admin/application_helper.rb b/app/helpers/admin/application_helper.rb index b73956e656435e2ed339848b0bd4ed8372057ad5..a91284ef77c3fbaf97f5a567fb06f44fbce4fd1c 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)