Struct comrak::ComrakParseOptions
source · [−]Expand description
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,' "world" ...</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
sourceimpl Clone for ComrakParseOptions
impl Clone for ComrakParseOptions
sourcefn clone(&self) -> ComrakParseOptions
fn clone(&self) -> ComrakParseOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ComrakParseOptions
impl Debug for ComrakParseOptions
sourceimpl Default for ComrakParseOptions
impl Default for ComrakParseOptions
sourcefn default() -> ComrakParseOptions
fn default() -> ComrakParseOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for ComrakParseOptions
impl Send for ComrakParseOptions
impl Sync for ComrakParseOptions
impl Unpin for ComrakParseOptions
impl UnwindSafe for ComrakParseOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more