Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions codex-rs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions codex-rs/tui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ two-face = { version = "0.5", default-features = false, features = ["syntect-def
unicode-segmentation = { workspace = true }
unicode-width = { workspace = true }
url = { workspace = true }
urlencoding = { workspace = true }
webbrowser = { workspace = true }
uuid = { workspace = true }

Expand Down
4 changes: 3 additions & 1 deletion codex-rs/tui/src/markdown_render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,9 @@ fn parse_local_link_target(dest_url: &str) -> Option<(String, Option<String>)> {
location_suffix = Some(suffix);
}

Some((expand_local_link_path(path_text), location_suffix))
let decoded_path_text =
urlencoding::decode(path_text).unwrap_or(std::borrow::Cow::Borrowed(path_text));
Some((expand_local_link_path(&decoded_path_text), location_suffix))
}

/// Normalize a hash fragment like `L12` or `L12C3-L14C9` into the display suffix we render.
Expand Down
12 changes: 12 additions & 0 deletions codex-rs/tui/src/markdown_render_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,18 @@ fn file_link_hides_destination() {
assert_eq!(text, expected);
}

#[test]
fn file_link_decodes_percent_encoded_bare_path_destination() {
let text = render_markdown_text_for_cwd(
"[report](/Users/example/code/codex/Example%20Folder/R%C3%A9sum%C3%A9/report.md)",
Path::new("/Users/example/code/codex"),
);
let expected = Text::from(Line::from_iter([
"Example Folder/Résumé/report.md".cyan(),
]));
assert_eq!(text, expected);
}

#[test]
fn file_link_appends_line_number_when_label_lacks_it() {
let text = render_markdown_text_for_cwd(
Expand Down
Loading