Merge pull request #276 from basecamp/card-7348960853-room-render-injection

Render link previews only from web URLs
This commit is contained in:
Rosa Gutierrez
2026-09-11 21:29:14 +02:00
committed by GitHub
5 changed files with 200 additions and 5 deletions
@@ -3,9 +3,9 @@
<div class="og-embed gap">
<div class="og-embed__content">
<div class="og-embed__title">
<%= link_to truncate(opengraph_embed.filename, length: 280, omission: "…"), opengraph_embed.href, rel: "noreferrer", target: "_blank" %>
<%= link_to_if opengraph_embed.href.present?, truncate(opengraph_embed.filename, length: 280, omission: "…"), opengraph_embed.href, rel: "noreferrer", target: "_blank" %>
</div>
<div class="og-embed__description"><%= truncate(opengraph_embed.caption, length: 560, omission: "…").html_safe %></div>
<div class="og-embed__description"><%= truncate(opengraph_embed.caption, length: 560, omission: "…") %></div>
</div>
<% if opengraph_embed.url %>
<div class="og-embed__image">
+1 -1
View File
@@ -1,7 +1,7 @@
<%# Be sure to check/update messages/_template.html.erb when changing this file %>
<%# Bump this version when the message presentation filters change what they emit. Editing this line changes the template digest, which busts BOTH this fragment cache and the collection cache that keys on this partial's digest (helper Ruby changes alone don't). %>
<% cache [ message, "presentation-v2" ] do %>
<% cache [ message, "presentation-v3" ] do %>
<%= message_tag message do %>
<h2 class="message__day-separator"><%= local_datetime_tag message.created_at, style: :date %></h2>