aboutsummaryrefslogtreecommitdiffstats
path: root/lib/action_text/content.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/action_text/content.rb')
-rw-r--r--lib/action_text/content.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/action_text/content.rb b/lib/action_text/content.rb
index ce40505329..2eff8bb361 100644
--- a/lib/action_text/content.rb
+++ b/lib/action_text/content.rb
@@ -53,8 +53,12 @@ module ActionText
end.to_html
end
+ def to_html_with_layout
+ ActionText.renderer.render(partial: "action_text/content/layout", locals: { document: to_html.html_safe }).html_safe
+ end
+
def to_s
- "<div class='trix-content'>#{to_html}</div>".html_safe
+ to_html_with_layout
end
def as_json(*)