pub struct HtmlToMarkdownBuilder { /* private fields */ }Expand description
The HtmlToMarkdown builder for advanced configurations.
Implementations§
Source§impl HtmlToMarkdownBuilder
impl HtmlToMarkdownBuilder
Skip a group of tags when converting.
Sourcepub fn add_handler<Handler>(self, tags: Vec<&str>, handler: Handler) -> Selfwhere
Handler: ElementHandler + 'static,
pub fn add_handler<Handler>(self, tags: Vec<&str>, handler: Handler) -> Selfwhere
Handler: ElementHandler + 'static,
Apply a custom element handler for a group of tags.
§Example
use htmd::{Element, HtmlToMarkdownBuilder};
let mut handlers = HtmlToMarkdownBuilder::new()
.add_handler(vec!["img"], |_: Element| {
// Skip the img tag when converting.
None
})
.add_handler(vec!["video"], |element: Element| {
// Handle the video tag.
todo!("Return some text to represent this video element.")
});Sourcepub fn build(self) -> HtmlToMarkdown
pub fn build(self) -> HtmlToMarkdown
Create a new HtmlToMarkdown.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HtmlToMarkdownBuilder
impl !RefUnwindSafe for HtmlToMarkdownBuilder
impl Send for HtmlToMarkdownBuilder
impl Sync for HtmlToMarkdownBuilder
impl Unpin for HtmlToMarkdownBuilder
impl !UnwindSafe for HtmlToMarkdownBuilder
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