From 2c50f4265e403dfabc50bc30f4bb9e20fe2670b8 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Fri, 6 Feb 2026 09:40:56 +0100 Subject: [PATCH] fix: don't obfuscate email in href/value attributes HTML entities in href and value attributes don't decode properly - browsers treat them as literal strings. Only obfuscate display text. Co-Authored-By: Claude Opus 4.5 --- _includes/components/blog-sidebar.njk | 2 +- _includes/components/h-card.njk | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/_includes/components/blog-sidebar.njk b/_includes/components/blog-sidebar.njk index cb1c902..8844a20 100644 --- a/_includes/components/blog-sidebar.njk +++ b/_includes/components/blog-sidebar.njk @@ -26,7 +26,7 @@ {# Hidden but present for microformat completeness #} - {% if site.author.email %}{% endif %} + {% if site.author.email %}{% endif %} {% if site.author.org %}{% endif %} diff --git a/_includes/components/h-card.njk b/_includes/components/h-card.njk index 1d4df40..32a5ca6 100644 --- a/_includes/components/h-card.njk +++ b/_includes/components/h-card.njk @@ -56,8 +56,8 @@ {# Email and PGP Key #}
{% if site.author.email %} - {# Email obfuscated as HTML entities to deter spam harvesters while keeping valid for microformat parsers #} - + {# Display text obfuscated to deter spam harvesters; href kept plain for browser compatibility #} + ✉️ {{ site.author.email | obfuscateEmail }} {% endif %}