From 4db1defaefca495a39eff7de8dbe8b8d913fa5c1 Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Sat, 11 Apr 2026 18:45:18 +0200 Subject: [PATCH] fix: add class to unfurl fallback link to prevent YouTube double-embed When unfurl cache is failed/missing for a YouTube URL, renderFallbackLink returned a classless which matched the youtube-link-to-embed transform regex (the class exclusion from 819aab1 didn't protect it). This created one embed from the custom transform and a second from eleventy-plugin-youtube-embed. Adding class="unfurl-fallback" triggers the (?![^>]*\bclass=) exclusion, preventing both embeds on like/repost pages with uncached YouTube URLs. Co-Authored-By: Claude Sonnet 4.6 --- lib/unfurl-shortcode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/unfurl-shortcode.js b/lib/unfurl-shortcode.js index ff8ba93..e9f6dea 100644 --- a/lib/unfurl-shortcode.js +++ b/lib/unfurl-shortcode.js @@ -76,7 +76,7 @@ export function escapeHtml(str) { export function renderFallbackLink(url) { const domain = escapeHtml(extractDomain(url)); - return `${domain}`; + return `${domain}`; } export function renderCard(url, metadata) {