Skip to content

Commit

Permalink
fix: convert empty space to %20 when render hyperlinks
Browse files Browse the repository at this point in the history
fix #843
  • Loading branch information
XhstormR committed Mar 6, 2024
1 parent 1918eb8 commit a0691cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/output/file_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ impl<'a, 'dir, C: Colours> FileName<'a, 'dir, C> {
/// So in that situation, those characters will be escaped and highlighted in
/// a different colour.
fn escaped_file_name<'unused>(&self) -> Vec<ANSIString<'unused>> {
use percent_encoding::{utf8_percent_encode, CONTROLS};
use percent_encoding::{utf8_percent_encode, NON_ALPHANUMERIC};

const HYPERLINK_START: &str = "\x1B]8;;";
const HYPERLINK_END: &str = "\x1B\x5C";
Expand All @@ -390,7 +390,7 @@ impl<'a, 'dir, C: Colours> FileName<'a, 'dir, C> {
.absolute_path()
.and_then(|p| p.as_os_str().to_str())
{
let abs_path = utf8_percent_encode(abs_path, CONTROLS).to_string();
let abs_path = utf8_percent_encode(abs_path, NON_ALPHANUMERIC).to_string();

// On Windows, `std::fs::canonicalize` adds the Win32 File prefix, which we need to remove
#[cfg(target_os = "windows")]
Expand Down

0 comments on commit a0691cd

Please sign in to comment.