Struct sauron_markdown::Plugins
source · [−]pub struct Plugins<'a, MSG> {
pub code_fence_processor: Option<Box<dyn Fn(Option<&str>, &str) -> Option<Node<MSG>> + 'a>>,
pub inline_html_processor: Option<Box<dyn Fn(&Node<MSG>) -> Option<Node<MSG>> + 'a>>,
pub tag_processor: Option<Box<dyn Fn(&Tag<'_>) -> Option<Node<MSG>> + 'a>>,
}
Expand description
collections of plugins to be run during the processing of markdown
Fields
code_fence_processor: Option<Box<dyn Fn(Option<&str>, &str) -> Option<Node<MSG>> + 'a>>
this a function where it is run when a code fence block is detected. Return an optional new node as a result. Should return none if the plugin can not process it.
inline_html_processor: Option<Box<dyn Fn(&Node<MSG>) -> Option<Node<MSG>> + 'a>>
this is executed for each node in the inline html Returns a derivative new node if applicable. Must return None if it the node isn’t suitable to be processed.
tag_processor: Option<Box<dyn Fn(&Tag<'_>) -> Option<Node<MSG>> + 'a>>
this is executed for each tag encountered from pulldown-cmark
Trait Implementations
Auto Trait Implementations
impl<'a, MSG> !RefUnwindSafe for Plugins<'a, MSG>
impl<'a, MSG> !Send for Plugins<'a, MSG>
impl<'a, MSG> !Sync for Plugins<'a, MSG>
impl<'a, MSG> Unpin for Plugins<'a, MSG>
impl<'a, MSG> !UnwindSafe for Plugins<'a, MSG>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more