Struct comrak::ComrakParseOptions
source · pub struct ComrakParseOptions {
pub smart: bool,
pub default_info_string: Option<String>,
pub relaxed_tasklist_matching: bool,
}
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");
relaxed_tasklist_matching: bool
Whether or not a simple x
or X
is used for tasklist or any other symbol is allowed.
Trait Implementations§
source§impl Clone for ComrakParseOptions
impl Clone for ComrakParseOptions
source§fn clone(&self) -> ComrakParseOptions
fn clone(&self) -> ComrakParseOptions
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ComrakParseOptions
impl Debug for ComrakParseOptions
source§impl Default for ComrakParseOptions
impl Default for ComrakParseOptions
source§fn default() -> ComrakParseOptions
fn default() -> ComrakParseOptions
Returns the “default value” for a type. Read more