From 13190d33675f263e7ec0755e9082e92f79c8d4a5 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Mon, 18 May 2026 10:30:53 +0200 Subject: [PATCH] =?UTF-8?q?sanetja=20les=20descripcions=20per=20evitar=20s?= =?UTF-8?q?alts=20de=20l=C3=ADnia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repoman.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/repoman.py b/repoman.py index f26c275..7f2e08f 100644 --- a/repoman.py +++ b/repoman.py @@ -118,6 +118,11 @@ def gitea_get(cfg: Config, path: str, params: dict[str, str] | None = None) -> t raise RuntimeError(f"no se pudo contactar con {cfg.url}: {e.reason}") from e +def _oneline(s: str) -> str: + """Col·lapsa qualsevol salt de línia o whitespace múltiple en un sol espai.""" + return " ".join((s or "").split()) + + def _parse_repo_list(body: bytes) -> list[RemoteRepo]: items = json.loads(body or b"[]") return [ @@ -126,7 +131,7 @@ def _parse_repo_list(body: bytes) -> list[RemoteRepo]: full_name=item.get("full_name", ""), clone_url=item.get("clone_url", ""), ssh_url=item.get("ssh_url", ""), - description=item.get("description") or "", + description=_oneline(item.get("description") or ""), private=bool(item.get("private", False)), default_branch=item.get("default_branch") or "main", )