mirror of
https://github.com/openai/codex.git
synced 2026-09-08 15:50:34 +00:00
avoid parenthesized rendered link urls
This commit is contained in:
@@ -596,9 +596,8 @@ where
|
||||
fn pop_link(&mut self) {
|
||||
if let Some(link) = self.link.take() {
|
||||
if link.show_destination {
|
||||
self.push_span(" (".into());
|
||||
self.push_span(" - ".into());
|
||||
self.push_span(Span::styled(link.destination, self.styles.link));
|
||||
self.push_span(")".into());
|
||||
} else if let Some(local_target_display) = link.local_target_display {
|
||||
if self.pending_marker_line {
|
||||
self.push_line(Line::default());
|
||||
|
||||
@@ -652,9 +652,8 @@ fn link() {
|
||||
let text = render_markdown_text("[Link](https://example.com)");
|
||||
let expected = Text::from(Line::from_iter([
|
||||
"Link".into(),
|
||||
" (".into(),
|
||||
" - ".into(),
|
||||
"https://example.com".cyan().underlined(),
|
||||
")".into(),
|
||||
]));
|
||||
assert_eq!(text, expected);
|
||||
}
|
||||
@@ -807,9 +806,8 @@ fn url_link_shows_destination() {
|
||||
let text = render_markdown_text("[docs](https://example.com/docs)");
|
||||
let expected = Text::from(Line::from_iter([
|
||||
"docs".into(),
|
||||
" (".into(),
|
||||
" - ".into(),
|
||||
"https://example.com/docs".cyan().underlined(),
|
||||
")".into(),
|
||||
]));
|
||||
assert_eq!(text, expected);
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ expression: rendered
|
||||
|
||||
Intro paragraph with bold text, italic text, and inline code x=1.
|
||||
Combined bold-italic both and escaped asterisks *literal*.
|
||||
Auto-link: https://example.com (https://example.com) and reference link [ref][r1].
|
||||
Link with title: hover me (https://example.com) and mailto mailto:test@example.com (mailto:test@example.com).
|
||||
Auto-link: https://example.com - https://example.com and reference link [ref][r1].
|
||||
Link with title: hover me - https://example.com and mailto mailto:test@example.com - mailto:test@example.com.
|
||||
Image: alt text
|
||||
|
||||
> Blockquote level 1
|
||||
@@ -23,7 +23,7 @@ Image: alt text
|
||||
1. Alt-numbered subitem
|
||||
|
||||
- [ ] Task: unchecked
|
||||
- [x] Task: checked with link home (https://example.org)
|
||||
- [x] Task: checked with link home - https://example.org
|
||||
|
||||
———
|
||||
|
||||
|
||||
Reference in New Issue
Block a user