From 36d8dae1fc470405205853d83dc6b4601e0e4053 Mon Sep 17 00:00:00 2001 From: "M. Pabiszczak" <2+mpabi@noreply.zsl-gitea.mpabi.pl> Date: Sun, 19 Jul 2026 17:59:17 +0200 Subject: [PATCH] feat: make card QR codes open their targets --- scripts/check_repository.py | 2 ++ tools/render_card.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/scripts/check_repository.py b/scripts/check_repository.py index 131b6be..10edb82 100644 --- a/scripts/check_repository.py +++ b/scripts/check_repository.py @@ -157,6 +157,8 @@ def check_render() -> None: for marker in ("resource-qr-repository", "resource-qr-page"): if marker not in html: raise AssertionError(f"HTML nie zawiera komórki {marker!r}") + if html.count('target="_blank" rel="noopener noreferrer"') < 2: + raise AssertionError("oba kody QR HTML muszą otwierać bezpieczną nową kartę") if "PROJECT" not in html: raise AssertionError("HTML nie zawiera nowej tabliczki projektu") if "resource-qr-label" in html: diff --git a/tools/render_card.py b/tools/render_card.py index 1a809a0..6b7330c 100644 --- a/tools/render_card.py +++ b/tools/render_card.py @@ -3928,6 +3928,7 @@ def render_page_header_html(data: dict, page: int, total: int) -> str: if qr: return ( f'' f'{qr}' ) @@ -4458,6 +4459,7 @@ def render_title_block_html(data: dict) -> str: qr = qr_svg(str(fields["url"])) if fields["show_qr"] else "" qr_cell = ( f'{qr}' if qr else '