Skip to main content

parse_message_segments

Function parse_message_segments 

Source
pub fn parse_message_segments(text: &str) -> Vec<MessageSegment>
Expand description

Parse text into an ordered sequence of MessageSegments, handling arbitrarily nested fenced code blocks.

When a fenced block is opened inside another fenced block the opening/closing fence lines are included verbatim in the outer block’s content, and the inner block is also emitted as its own segment with a higher depth.