markdown: Move open_url to the MarkdownElement as on_url_click (#28269)

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
Marshall Bowers 2025-04-07 16:43:00 -04:00 committed by GitHub
parent d3abc61728
commit 0414908c4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 201 additions and 194 deletions

View file

@ -624,16 +624,15 @@ impl CompletionsMenu {
.map(|l| l.name().to_proto());
Markdown::new(SharedString::default(), languages, language, cx)
.copy_code_block_buttons(false)
.open_url(open_markdown_url)
})
});
markdown.update(cx, |markdown, cx| {
markdown.reset(parsed.clone(), cx);
});
div().child(MarkdownElement::new(
markdown.clone(),
hover_markdown_style(window, cx),
))
div().child(
MarkdownElement::new(markdown.clone(), hover_markdown_style(window, cx))
.on_url_click(open_markdown_url),
)
}
CompletionDocumentation::MultiLineMarkdown(_) => return None,
CompletionDocumentation::SingleLine(_) => return None,