Struct html2md::StructuredPrinter
source · pub struct StructuredPrinter {
pub parent_chain: Vec<String>,
pub siblings: HashMap<usize, Vec<String>>,
pub data: String,
}
Expand description
Intermediate result of HTML -> Markdown conversion.
Holds context in the form of parent tags and siblings chain and resulting string of markup content with current position.
Fields§
§parent_chain: Vec<String>
Chain of parents leading to upmost tag
siblings: HashMap<usize, Vec<String>>
Siblings of currently processed tag in order where they’re appearing in html
data: String
resulting markdown document
Implementations§
source§impl StructuredPrinter
impl StructuredPrinter
sourcepub fn insert_newline(&mut self)
pub fn insert_newline(&mut self)
Inserts newline
sourcepub fn append_str(&mut self, it: &str)
pub fn append_str(&mut self, it: &str)
Append string to the end of the printer
sourcepub fn insert_str(&mut self, pos: usize, it: &str)
pub fn insert_str(&mut self, pos: usize, it: &str)
Insert string at specified position of printer, adjust position to the end of inserted string
Trait Implementations§
source§impl Debug for StructuredPrinter
impl Debug for StructuredPrinter
source§impl Default for StructuredPrinter
impl Default for StructuredPrinter
source§fn default() -> StructuredPrinter
fn default() -> StructuredPrinter
Returns the “default value” for a type. Read more