From 6d44cef57d48ae9c2838dbf7f327be8dca6118f4 Mon Sep 17 00:00:00 2001 From: Juan Camilo Auriti Date: Mon, 30 Nov 2026 16:13:43 +0000 Subject: [PATCH] fix(google-ai): ignore HTML comments when looking for a visible date in G-DATES The text-date check added in #776 read every string node, including HTML comments, so a date inside a comment such as "Published 2026-03-12" counted as a visible date and added one point to the google_ai category score. Comments, CDATA, doctype and processing instructions are now skipped; script, style, noscript and template were already skipped. Adds a regression test that fails without the fix. Full suite: 2879 passed, 9 skipped (one skip is the local editable-install check); ruff check and ruff format clean. --- CHANGELOG.md | 3 +++ src/geo_optimizer/core/audit_google_ai.py | 13 +++++++++++-- tests/test_audit_google_ai.py | 5 +++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b36068f8..72a58f19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ Format: [Keep a Changelog](https://keepachangelog.com/) · [SemVer](https://semv ## [Unreleased] +### Fixed +- `G-DATES` no longer counts a date that appears only inside an HTML comment (for example ``) as a visible date. The 4.31.1 text-date check read comments by mistake; a page whose only date is in a comment goes back to the "Date only in structured data" warning. Pages that show the date as real text, a `