Compare commits

...

1 Commits

Author SHA1 Message Date
canvrno-oai
17e2ecd641 avoid parenthesized rendered link urls 2026-04-17 11:57:00 -07:00
3 changed files with 6 additions and 9 deletions

View File

@@ -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());

View File

@@ -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);
}

View File

@@ -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
———