Skip to main content

agent_markdown_entity

Function agent_markdown_entity 

Source
pub fn agent_markdown_entity(
    text: impl Into<SharedString>,
    cx: &mut App,
) -> Entity<Markdown>
Expand description

Creates a freshly parsed Markdown entity from text.

Markdown parses in a background task and only shows content once that task completes and updates the entity — an entity with no remaining strong reference is dropped before that update can land, so its content never reaches the screen. Callers that render the same logical message across multiple frames (e.g. a streaming assistant turn) must create this once and keep the returned Entity alive for as long as it’s displayed, updating its text via Markdown::reset/Markdown::append as new content arrives, rather than calling this again on every render.