chore: replace custom markdown rendering with gpui TextView

This commit is contained in:
2026-10-03 20:41:09 +07:00
parent 88d3840fd2
commit e14b815404
9 changed files with 77 additions and 513 deletions
+1 -1
View File
@@ -1094,7 +1094,7 @@ impl ChatPanel {
.rendered_texts_by_id
.entry(message.id)
.or_insert_with(|| {
text::rendered_text(&message.content, &message.mentions, &persons, true, cx)
text::rendered_text(&message.content, &message.mentions, &persons, cx)
})
.element(ix.into(), window, cx);
+2 -5
View File
@@ -4,14 +4,11 @@ use person::PersonRegistry;
use ui::markdown::InlineReplacement;
pub use ui::markdown::RenderedText;
/// Render message `content` to text, replacing mentions with their display names.
///
/// When `markdown` is set the content is parsed as markdown.
/// Render message `content`, replacing mentions with their display names.
pub fn rendered_text(
content: &str,
mentions: &[Mention],
persons: &Entity<PersonRegistry>,
markdown: bool,
cx: &App,
) -> RenderedText {
let replacements = mentions
@@ -24,5 +21,5 @@ pub fn rendered_text(
})
.collect::<Vec<_>>();
RenderedText::new(content, &replacements, markdown)
RenderedText::new(content, &replacements)
}