From 69a278de6e5657b9e5afa1214f9d940ef44f5831 Mon Sep 17 00:00:00 2001 From: Kumi Date: Wed, 19 Jun 2024 10:15:22 +0200 Subject: [PATCH] fix: string handling for file path in markdown previews for legacy Python versions Ensured string handling for file paths in markdown previews uses consistent single quotes to prevent syntax errors. --- src/gitcloak/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gitcloak/app.py b/src/gitcloak/app.py index 26a0656..ae9e4b4 100644 --- a/src/gitcloak/app.py +++ b/src/gitcloak/app.py @@ -169,7 +169,7 @@ def preview_file(owner: str, repo: str, file_path: str): is_safe = False if content_type == "text/markdown": - base_url = f"/{owner}/{repo}/raw/main/{"/".join(file_path.split("/")[:-1])}".rstrip( + base_url = f"/{owner}/{repo}/raw/main/{'/'.join(file_path.split('/')[:-1])}".rstrip( "/" ) file_content = RelativeURLRewriter(base_url).convert(