From 206c04f716cbc608e0913f31e19b79458014e519 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 7 Jun 2018 14:41:17 +0200 Subject: [PATCH] Move the escaping choice to the layout --- app/views/action_text/content/_layout.html.erb | 2 +- lib/action_text/content.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/action_text/content/_layout.html.erb b/app/views/action_text/content/_layout.html.erb index be3ca295c8..c0b86a189e 100644 --- a/app/views/action_text/content/_layout.html.erb +++ b/app/views/action_text/content/_layout.html.erb @@ -1,3 +1,3 @@
- <%= document %> + <%=raw document %>
diff --git a/lib/action_text/content.rb b/lib/action_text/content.rb index 2eff8bb361..9dae07cf0c 100644 --- a/lib/action_text/content.rb +++ b/lib/action_text/content.rb @@ -54,7 +54,7 @@ module ActionText end def to_html_with_layout - ActionText.renderer.render(partial: "action_text/content/layout", locals: { document: to_html.html_safe }).html_safe + ActionText.renderer.render(partial: "action_text/content/layout", locals: { document: to_html }).html_safe end def to_s