From 4af02012bc720df87813e42edcf28b864101392d Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Thu, 14 Nov 2024 20:06:13 +0100 Subject: [PATCH] Strip long path prefix from file links in report --- PFERD/pferd.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PFERD/pferd.py b/PFERD/pferd.py index 850e68e..d602cfd 100644 --- a/PFERD/pferd.py +++ b/PFERD/pferd.py @@ -171,7 +171,9 @@ class Pferd: def fmt_path_link(relative_path: PurePath) -> str: # We need to URL-encode the path because it might contain spaces or special characters - link = f"file://{quote(str(crawler.output_dir.resolve(relative_path).absolute()))}" + absolute_path = str(crawler.output_dir.resolve(relative_path).absolute()) + absolute_path = absolute_path.replace("\\\\?\\", "") + link = f"file://{quote(absolute_path)}" return f"[link={link}]{fmt_path(relative_path)}[/link]" something_changed = False