diff --git a/CHANGELOG.md b/CHANGELOG.md index e18f88a..bbd2dd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,9 @@ ambiguous situations. ## Unreleased +## Fixed +- File links in report on Windows + ## 3.7.0 - 2024-11-13 ### Added diff --git a/PFERD/pferd.py b/PFERD/pferd.py index 850e68e..ca2e5b7 100644 --- a/PFERD/pferd.py +++ b/PFERD/pferd.py @@ -1,6 +1,5 @@ from pathlib import Path, PurePath from typing import Dict, List, Optional -from urllib.parse import quote from rich.markup import escape @@ -171,7 +170,7 @@ 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()))}" + link = crawler.output_dir.resolve(relative_path).absolute().as_uri() return f"[link={link}]{fmt_path(relative_path)}[/link]" something_changed = False