Skip to content
Snippets Groups Projects
Unverified Commit dbe055fe authored by Arnaud Levy's avatar Arnaud Levy Committed by GitHub
Browse files

Réparation des sauts de lignes des textes non-HTML suite à la suppression d'Orthotypo (#2010)

parent 91b489c7
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@ class Static::Code < Static::Default
unless @prepared
@prepared = @text.to_s.dup
@prepared = lazy_load_iframes @prepared
@prepared = indent @prepared
@prepared = turn_linebreak_to_br @prepared
@prepared = raw @prepared
end
@prepared
......
......@@ -20,6 +20,7 @@ class Static::Default
@about.language&.iso_code
end
# Obsolete
def indent(text)
indentation = ' ' * @depth
# Remove useless \r
......@@ -32,4 +33,11 @@ class Static::Default
text
end
def turn_linebreak_to_br(text)
text.gsub! "\r\n", "<br>"
text.gsub! "\r", "<br>"
text.gsub! "\n", "<br>"
text
end
end
......@@ -7,7 +7,7 @@ class Static::Text < Static::Default
@prepared = @text.to_s.strip.dup
@prepared = strip_tags @prepared
@prepared = CGI.unescapeHTML @prepared
@prepared = indent @prepared
@prepared = turn_linebreak_to_br @prepared
@prepared = sanitize @prepared
end
@prepared
......
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