MarkdownParserConfig

Struct MarkdownParserConfig 

Source
pub struct MarkdownParserConfig { /* private fields */ }
Expand description

A configuration for the Markdown parser.

Implementations§

Source§

impl MarkdownParserConfig

Source

pub fn with_allow_no_space_in_headings(self) -> Self

Enable the parser to allow headings without a space after the hash marks.

Source

pub fn with_html_entities_map( self, html_entities_map: HashMap<String, &'static Entity>, ) -> Self

Set a custom map of HTML entities.

Source

pub fn with_block_blockquote_behavior( self, behavior: ElementBehavior<Block>, ) -> Self

Set the behavior of the parser when encountering blockquotes.

Source

pub fn with_block_github_alert_behavior( self, behavior: ElementBehavior<Block>, ) -> Self

Set the behavior of the parser when encountering GitHub alerts.

Source

pub fn with_block_heading_v1_behavior( self, behavior: ElementBehavior<Block>, ) -> Self

Set the behavior of the parser when encountering headings in style 1 (e.g., # Heading).

Source

pub fn with_block_heading_v2_behavior( self, behavior: ElementBehavior<Block>, ) -> Self

Set the behavior of the parser when encountering headings in style 2 (e.g., Heading\n===).

Source

pub fn with_block_thematic_break_behavior( self, behavior: ElementBehavior<Block>, ) -> Self

Set the behavior of the parser when encountering thematic breaks (e.g., ---).

Source

pub fn with_block_list_behavior(self, behavior: ElementBehavior<Block>) -> Self

Set the behavior of the parser when encountering lists.

Source

pub fn with_block_code_block_behavior( self, behavior: ElementBehavior<Block>, ) -> Self

Set the behavior of the parser when encountering code blocks.

Source

pub fn with_block_html_block_behavior( self, behavior: ElementBehavior<Block>, ) -> Self

Set the behavior of the parser when encountering HTML blocks.

Source

pub fn with_block_footnote_definition_behavior( self, behavior: ElementBehavior<Block>, ) -> Self

Set the behavior of the parser when encountering footnote definitions.

Set the behavior of the parser when encountering link definitions.

Source

pub fn with_block_table_behavior(self, behavior: ElementBehavior<Block>) -> Self

Set the behavior of the parser when encountering tables.

Source

pub fn with_block_paragraph_behavior( self, behavior: ElementBehavior<Block>, ) -> Self

Set the behavior of the parser when encountering block paragraphs.

Set the behavior of the parser when encountering inline autolinks.

Set the behavior of the parser when encountering inline links.

Source

pub fn with_inline_footnote_reference_behavior( self, behavior: ElementBehavior<Inline>, ) -> Self

Set the behavior of the parser when encountering inline footnote references.

Set the behavior of the parser when encountering inline reference links.

Source

pub fn with_inline_hard_newline_behavior( self, behavior: ElementBehavior<Inline>, ) -> Self

Set the behavior of the parser when encountering inline hard newlines.

Source

pub fn with_inline_image_behavior( self, behavior: ElementBehavior<Inline>, ) -> Self

Set the behavior of the parser when encountering inline images.

Source

pub fn with_inline_code_span_behavior( self, behavior: ElementBehavior<Inline>, ) -> Self

Set the behavior of the parser when encountering inline code spans.

Source

pub fn with_inline_emphasis_behavior( self, behavior: ElementBehavior<Inline>, ) -> Self

Set the behavior of the parser when encountering inline emphasis.

Source

pub fn with_inline_strikethrough_behavior( self, behavior: ElementBehavior<Inline>, ) -> Self

Set the behavior of the parser when encountering inline strikethrough.

Source

pub fn with_inline_text_behavior( self, behavior: ElementBehavior<Inline>, ) -> Self

Set the behavior of the parser when encountering inline text.

Source

pub fn with_custom_block_parser( self, parser: Rc<RefCell<Box<dyn for<'a> FnMut(&'a str) -> IResult<&'a str, Vec<Block>>>>>, ) -> Self

Set a custom parser for blocks.

Source

pub fn with_custom_inline_parser( self, parser: Rc<RefCell<Box<dyn for<'a> FnMut(&'a str) -> IResult<&'a str, Vec<Inline>>>>>, ) -> Self

Set a custom parser for inlines.

Trait Implementations§

Source§

impl Clone for MarkdownParserConfig

Source§

fn clone(&self) -> MarkdownParserConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for MarkdownParserConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.