From dcdd20b43d7b14a51183a8249d08fa321ca1cef9 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Thu, 18 Dec 2025 15:26:27 -0500 Subject: [PATCH] Extract SVG & object data attrs for og:image meta tags --- pelicanconf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelicanconf.py b/pelicanconf.py index 08bd0e9..2d2267e 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -113,7 +113,7 @@ import re def extract_first_image(content): """Extract first image URL from HTML content.""" - match = re.search(r'(?:src|href)=["\']([^"\']+\.(?:jpg|jpeg|png|gif|webp))["\']', content, re.IGNORECASE) + match = re.search(r'(?:src|href|data)=["\']([^"\']+\.(?:jpg|jpeg|png|gif|webp|svg))["\']', content, re.IGNORECASE) return match.group(1) if match else None JINJA_FILTERS = {'extract_first_image': extract_first_image}