From c457eb6f040bf21de464c1187a54b20b31055694 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Sun, 22 Feb 2026 20:37:07 +0100 Subject: [PATCH] fix: extractFirstImage matching x-bind:src from Alpine.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The regex matched x-bind:src="comment.author.photo" from the comments component, causing the literal string to appear in og:image meta tags. Every Mastodon instance fetching OG data hit /comment.author.photo → 404. Require whitespace before src= so only actual HTML src attributes match. --- eleventy.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eleventy.config.js b/eleventy.config.js index f839bc3..385dfa4 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -335,7 +335,7 @@ export default function (eleventyConfig) { eleventyConfig.addFilter("extractFirstImage", (content) => { if (!content) return null; // Match all tags, skip hidden ones and data URIs - const imgRegex = /]+src=["']([^"']+)["'][^>]*>/gi; + const imgRegex = /]*?\ssrc=["']([^"']+)["'][^>]*>/gi; let match; while ((match = imgRegex.exec(content)) !== null) { const fullTag = match[0];