vtcode_commons/ui_protocol/
markdown.rs1use anstyle::Style;
8
9#[derive(Clone, Debug)]
11pub struct MarkdownSegment {
12 pub style: Style,
13 pub text: String,
14 pub link_target: Option<String>,
15}
16
17#[derive(Clone, Debug, Default)]
19pub struct MarkdownLine {
20 pub segments: Vec<MarkdownSegment>,
21}
22
23impl MarkdownLine {
24 pub fn is_empty(&self) -> bool {
25 self.segments.iter().all(|segment| segment.text.trim().is_empty())
26 }
27}
28
29#[derive(Debug, Clone, Copy, Default)]
31pub struct RenderMarkdownOptions {
32 pub preserve_code_indentation: bool,
33 pub disable_code_block_table_reparse: bool,
34 pub table_max_width: Option<usize>,
38}
39
40#[derive(Clone, Debug)]
42pub struct HighlightedSegment {
43 pub style: Style,
44 pub text: String,
45}