Skip to content

Commit 1f0e8cb

Browse files
Copilotmaebeale
andauthored
Show ActionText HTML content in deduper preview (#1024)
* Initial plan * Show ActionText HTML content instead of plain text in deduper Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
1 parent 83c48bb commit 1f0e8cb

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

app/views/dedupes/_preview.html.erb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,11 @@
128128
.select { |a| a.class_name == "ActionText::RichText" }
129129
.map { |a| a.name.to_s.sub(/^rich_text_/, "") } %>
130130
<% rt_attrs.each do |rt_attr| %>
131-
<% delete_body = record_to_delete.public_send(rt_attr)&.to_plain_text.presence %>
132-
<% keep_body = record_to_keep.public_send(rt_attr)&.to_plain_text.presence %>
133-
<% next if delete_body.blank? && keep_body.blank? %>
131+
<% delete_rt = record_to_delete.public_send(rt_attr) %>
132+
<% keep_rt = record_to_keep.public_send(rt_attr) %>
133+
<% next if delete_rt.blank? && keep_rt.blank? %>
134+
<% delete_body = delete_rt&.body&.to_s.presence %>
135+
<% keep_body = keep_rt&.body&.to_s.presence %>
134136
<% is_different = delete_body != keep_body %>
135137

136138
<!-- Left: read-only -->
@@ -142,8 +144,8 @@
142144
<span class="ml-1 text-xs font-semibold text-yellow-700 bg-yellow-100 px-1.5 py-0.5 rounded">DIFFERENT</span>
143145
<% end %>
144146
</div>
145-
<% if delete_body.present? %>
146-
<p class="mt-1 text-gray-900 whitespace-pre-wrap"><%= delete_body %></p>
147+
<% if delete_rt.present? %>
148+
<div class="mt-1 text-gray-900"><%= delete_rt %></div>
147149
<% end %>
148150
</div>
149151

0 commit comments

Comments
 (0)