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

Fix &

parent b5bc284b
No related branches found
No related tags found
No related merge requests found
......@@ -75,13 +75,13 @@ module Admin::ApplicationHelper
def prepare_text_for_static(text)
indentation = ' ' # Beware, it works only at level one, with 2 spaces
strip_tags(text)
.to_s
.dup
.strip
.gsub("\r\n", "\n") # Remove useless \r
.gsub("\n", "\n#{indentation}") # Indent properly to avoid broken frontmatter
.chomp # Remove extra newlines
text = text.to_s.dup
text = strip_tags text
text = text.strip
text = text.gsub("\r\n", "\n") # Remove useless \r
text = text.gsub("\n", "\n#{indentation}") # Indent properly to avoid broken frontmatter
text = text.chomp # Remove extra newlines
CGI.unescapeHTML text
end
def collection_tree(list, except = nil)
......
......@@ -11,6 +11,7 @@
<%= render 'admin/application/property/text', object: @post, property: :description %>
<%= render 'admin/application/property/text', object: @post, property: :text %>
<%= render 'admin/application/property/summernote_embeds', object: @post, property: :medias %>
<p><%= prepare_text_for_static @post.description %></p>
</div>
</div>
</div>
......
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