Fix Windows hyperlinks for paths with spaces

Fixes #1843

Changed the host() function for Windows to return '/' instead of ''
to generate RFC 3986 compliant file URLs with three slashes.

Before: file://C:/test/hi%20there.txt (broken)
After:  file:///C:/test/hi%20there.txt (works)

This fixes hyperlinks failing on Windows when file paths contain
spaces or other characters that require percent-encoding.
This commit is contained in:
Joseph Adams
2026-01-14 23:53:43 +01:00
parent 5f95a78121
commit cd8fedc183
+1 -1
View File
@@ -58,7 +58,7 @@ fn host() -> &'static str {
#[cfg(not(unix))]
const fn host() -> &'static str {
""
"/"
}
#[cfg(test)]