Skip to content
Snippets Groups Projects
Commit ce816933 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

linebreaks with 2 lines

parent 3bfe75e3
No related branches found
No related tags found
No related merge requests found
......@@ -78,10 +78,14 @@ module Admin::ApplicationHelper
text = text.to_s.dup
text = strip_tags text
text = text.strip
text = text.gsub "\r\n", "\n" # Remove useless \r
text = text.gsub "\r", "\n" # Replace lonely \r
text = text.gsub "\n", "\n#{indentation}" # Indent properly to avoid broken frontmatter
text = text.chomp # Remove extra newlines
# Remove useless \r
text = text.gsub "\r\n", "\n"
# Replace lonely \r
text = text.gsub "\r", "\n"
# Indent properly to avoid broken frontmatter, with 2 lines so the linebreak work
text = text.gsub "\n", "\n#{indentation}\n#{indentation}"
# Remove extra newlines
text = text.chomp
CGI.unescapeHTML text
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment