Skip to content

Commit 6216f25

Browse files
committed
Switch from body_before_type_cast to body.to_html to properly handle encrypted rich text
1 parent ede5afa commit 6216f25

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/lexxy/rich_text_area_tag.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ def lexxy_rich_textarea_tag(name, value = nil, options = {}, &block)
2424
# Temporary: we need to *adaptarize* action text
2525
def render_custom_attachments_in(value)
2626
if value.respond_to?(:body)
27-
if html = value.body_before_type_cast.presence
27+
if html = value.body&.to_html.presence
2828
ActionText::Fragment.wrap(html).replace(ActionText::Attachment.tag_name) do |node|
2929
if node["url"].blank?
3030
attachment = ActionText::Attachment.from_node(node)
3131
node["content"] = render_action_text_attachment(attachment).to_json
3232
end
33+
3334
node
3435
end
3536
end

0 commit comments

Comments
 (0)