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()