ratatui_toolkit/widgets/markdown_widget/foundation/source/methods/
content.rs

1//! Method to get the content of a `MarkdownSource`.
2
3use super::super::MarkdownSource;
4
5impl MarkdownSource {
6    /// Get the current content of the markdown source.
7    ///
8    /// For string sources, this returns the original string.
9    /// For file sources, this returns the cached content.
10    pub fn content(&self) -> &str {
11        match self {
12            Self::String(s) => s,
13            Self::File { content, .. } => content,
14        }
15    }
16}