html2md/
ignore.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use super::Handle;
use super::StructuredPrinter;
use super::TagHandler;
use super::TagHandlerFactory;

#[derive(Clone)]
/// Ignore the tag complete from the markup.
pub struct IgnoreTagFactory;

impl TagHandlerFactory for IgnoreTagFactory {
    fn instantiate(&self) -> Box<dyn TagHandler> {
        Box::new(self.clone())
    }
}

impl TagHandler for IgnoreTagFactory {
    fn handle(&mut self, _tag: &Handle, _printer: &mut StructuredPrinter) {}
    fn after_handle(&mut self, _printer: &mut StructuredPrinter) {}
    fn skip_descendants(&self) -> bool {
        true
    }
}