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.
This commit is contained in:
Kumi 2024-06-19 10:15:22 +02:00
parent ccd4a1cb77
commit 69a278de6e
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

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