pub struct InfoString {
pub raw: String,
pub block_type: CodeBlockType,
pub attributes: Vec<(String, Option<String>)>,
}Expand description
Parsed attributes from a code block info string.
Fields§
§raw: String§block_type: CodeBlockType§attributes: Vec<(String, Option<String>)>Implementations§
Source§impl InfoString
impl InfoString
Sourcepub fn parse(raw: &str) -> Self
pub fn parse(raw: &str) -> Self
Parse an info string into structured attributes.
Brace-delimited info strings ({...}) carry Pandoc attribute semantics
(executable chunks, raw blocks, attribute lists). In the CommonMark
dialect they have no special meaning — the info string is opaque and the
first word is just the language class — so callers in that dialect should
use InfoString::parse_with_dialect. Plain parse
retains the Pandoc interpretation for backward compatibility.
Sourcepub fn parse_with_dialect(raw: &str, dialect: Dialect) -> Self
pub fn parse_with_dialect(raw: &str, dialect: Dialect) -> Self
Parse an info string, honoring dialect-specific brace semantics.
Trait Implementations§
Source§impl Clone for InfoString
impl Clone for InfoString
Source§fn clone(&self) -> InfoString
fn clone(&self) -> InfoString
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InfoString
impl Debug for InfoString
Source§impl PartialEq for InfoString
impl PartialEq for InfoString
impl StructuralPartialEq for InfoString
Auto Trait Implementations§
impl Freeze for InfoString
impl RefUnwindSafe for InfoString
impl Send for InfoString
impl Sync for InfoString
impl Unpin for InfoString
impl UnsafeUnpin for InfoString
impl UnwindSafe for InfoString
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more