Adapt the Lexxy composer to main's link preview hardening

Main strips a javascript: href from a preview node before it's parsed, so
tell legacy Trix attachments apart by their filename instead. escapeHTML
moved to the string helpers, and the unfurling system test now drives
the Lexxy editor.
This commit is contained in:
Stanko K.R.
2026-09-26 09:26:53 +02:00
parent 1bb7ef7c17
commit eab554aa4b
3 changed files with 5 additions and 17 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ class ActionText::Attachment::OpengraphEmbed
# and content-type, so newer attachments carry the details in their
# content markup instead.
def attributes_from_node(node)
if node["href"].present?
if node["filename"].present?
{
href: web_url(node["href"]),
url: web_url(node["url"]),