[][src]Struct comrak::ComrakParseOptions

pub struct ComrakParseOptions {
    pub smart: bool,
    pub default_info_string: Option<String>,
}

Options for parser functions.

Fields

smart: bool

Punctuation (quotes, full-stops and hyphens) are converted into 'smart' punctuation.

let mut options = ComrakOptions::default();
assert_eq!(markdown_to_html("'Hello,' \"world\" ...", &options),
           "<p>'Hello,' &quot;world&quot; ...</p>\n");

options.parse.smart = true;
assert_eq!(markdown_to_html("'Hello,' \"world\" ...", &options),
           "<p>‘Hello,’ “world” …</p>\n");
default_info_string: Option<String>

The default info string for fenced code blocks.

let mut options = ComrakOptions::default();
assert_eq!(markdown_to_html("```\nfn hello();\n```\n", &options),
           "<pre><code>fn hello();\n</code></pre>\n");

options.parse.default_info_string = Some("rust".into());
assert_eq!(markdown_to_html("```\nfn hello();\n```\n", &options),
           "<pre><code class=\"language-rust\">fn hello();\n</code></pre>\n");

Trait Implementations

impl Clone for ComrakParseOptions[src]

impl Debug for ComrakParseOptions[src]

impl Default for ComrakParseOptions[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.