Struct NodeCodeBlock
#[non_exhaustive]
pub struct NodeCodeBlock { pub fenced: bool, pub fence_char: u8, pub fence_length: usize, pub fence_offset: usize, pub info: String, pub literal: String, pub closed: bool }
The metadata and data of a code block (fenced or indented).
Fields
fenced: boolWhether the code block is fenced.
fence_char: u8For fenced code blocks, the fence character itself (
`or~).fence_length: usizeFor fenced code blocks, the length of the fence.
fence_offset: usizeFor fenced code blocks, the indentation level of the code within the block.
info: StringFor fenced code blocks, the info string after the opening fence, if any.
literal: StringThe literal contents of the code block. As the contents are not interpreted as Markdown at all, they are contained within this structure, rather than inserted into a child inline of any kind.
closed: boolWhether the code block was explicitly closed by a closing fence. This is only meaningful for fenced code blocks; indented code blocks are treated as closed (true).
Implementations
impl NodeCodeBlock
fn fenced(info: impl Into<String>, literal: impl Into<String>) -> SelfCreate a new fenced
NodeCodeBlockwith the given info string and literal content.fn indented(literal: impl Into<String>) -> SelfCreate a new indented
NodeCodeBlockwith the given literal content.
Trait Implementations
impl Clone for NodeCodeBlock
fn clone(&self) -> Self
impl Debug for NodeCodeBlock
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for NodeCodeBlock
fn default() -> Self
impl Eq for NodeCodeBlock
impl PartialEq for NodeCodeBlock
fn eq(&self, other: &Self) -> bool