Skip to content

Commit

Permalink
Strip long path prefix from file links in report
Browse files Browse the repository at this point in the history
  • Loading branch information
I-Al-Istannen committed Nov 14, 2024
1 parent 287173b commit 4af0201
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion PFERD/pferd.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ def print_report(self) -> None:

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
Expand Down

0 comments on commit 4af0201

Please sign in to comment.