`.
divs_since_quoted_content_div: u32,
/// All-Inkl just puts the quote into `
`. This count is
/// increased at each `
` and decreased at each `
`.
blockquotes_since_blockquote: u32,
}
impl Dehtml {
/// Returns true if HTML parser is currently inside the quote.
fn is_quote(&self) -> bool {
self.divs_since_quoted_content_div > 0 || self.blockquotes_since_blockquote > 0
}
/// Returns the buffer where the text should be written.
///
/// If the parser is inside the quote, returns the quote buffer.
fn get_buf(&mut self) -> &mut String {
if self.is_quote() {
&mut self.quote
} else {
&mut self.strbuilder
}
}
fn get_add_text(&self) -> AddText {
if self.divs_since_quote_div > 0 && self.divs_since_quoted_content_div == 0 {
AddText::No // Everything between `
` and `
` is metadata which we don't want
} else {
self.add_text
}
}
}
#[derive(Debug, PartialEq, Clone, Copy)]
enum AddText {
/// Inside `