From 77ae9a7f74e611f383d9e7a587cb2b4e256dc383 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Tue, 20 Oct 2026 05:52:59 +0200 Subject: [PATCH] fix: every accepted md5 is its own search word Recalbox lists accepted md5s joined by commas, and platform pages printed the list as one code span. The site search took it for a single word, so 198 accepted values could not be found. Each value now has its own span. --- scripts/generate_site.py | 7 +++++-- tests/test_site_exports.py | 13 +++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/generate_site.py b/scripts/generate_site.py index 18124b0b..3883f874 100644 --- a/scripts/generate_site.py +++ b/scripts/generate_site.py @@ -1768,10 +1768,13 @@ def _render_platform_systems( sha256 = str(cfg_entry.get("sha256") or "") if sha1 or md5 or crc32 or sha256: hash_parts = [] + # One code span per value: Recalbox lists accepted md5s joined + # by commas, and the search indexed the joined run as a single + # word, so the second and later values were never found. if sha1: - hash_parts.append(f"SHA1: `{sha1}`") + hash_parts.append(f"SHA1: {_hash_spans(sha1)}") if md5: - hash_parts.append(f"MD5: `{md5}`") + hash_parts.append(f"MD5: {_hash_spans(md5)}") if crc32: hash_parts.append(f"CRC32: `{crc32}`") if sha256: diff --git a/tests/test_site_exports.py b/tests/test_site_exports.py index 0213d3e8..f143138e 100644 --- a/tests/test_site_exports.py +++ b/tests/test_site_exports.py @@ -756,5 +756,18 @@ class ACitationSaysWhoseCodeItIs(unittest.TestCase): "`emu/memory.c:46` (upstream emulator)") +class EveryAcceptedHashIsItsOwnWord(unittest.TestCase): + """Recalbox md5 lists rendered as one comma-joined code span: the site + search made one token of it and found none but the first.""" + + def test_a_list_is_split(self): + from generate_site import _hash_spans + + md5s = ["96cf" + "0" * 28, "d5af" + "0" * 28] + text = _hash_spans(",".join(md5s)) + for md5 in md5s: + self.assertIn(f"`{md5}`", text) + + if __name__ == "__main__": unittest.main()