pub struct Options<'a> {Show 18 fields
pub newlines_after_headline: usize,
pub newlines_after_paragraph: usize,
pub newlines_after_codeblock: usize,
pub newlines_after_htmlblock: usize,
pub newlines_after_table: usize,
pub newlines_after_rule: usize,
pub newlines_after_list: usize,
pub newlines_after_blockquote: usize,
pub newlines_after_rest: usize,
pub newlines_after_metadata: usize,
pub code_block_token_count: usize,
pub code_block_token: char,
pub list_token: char,
pub ordered_list_token: char,
pub increment_ordered_list_bullets: bool,
pub emphasis_token: char,
pub strong_token: &'a str,
pub use_html_for_super_sub_script: bool,
}Expand description
Configuration for the cmark_with_options() and cmark_resume_with_options() functions.
The defaults should provide decent spacing and most importantly, will
provide a faithful rendering of your markdown document particularly when
rendering it to HTML.
It’s best used with its Options::default() implementation.
Fields§
§newlines_after_headline: usizeThe number of newlines to insert after a headline
newlines_after_paragraph: usizeThe number of newlines to insert after a paragraph
newlines_after_codeblock: usizeThe number of newlines to insert after a code block
newlines_after_htmlblock: usizeThe number of newlines to insert after an HTML block
newlines_after_table: usizeThe number of newlines to insert after a table
newlines_after_rule: usizeThe number of newlines to insert after a horizontal rule
newlines_after_list: usizeThe number of newlines to insert after a list
newlines_after_blockquote: usizeThe number of newlines to insert after a block quote
newlines_after_rest: usizeThe number of newlines to insert after other elements
newlines_after_metadata: usizeThe amount of newlines placed after TOML or YAML metadata blocks at the beginning of a document.
code_block_token_count: usizeToken count for fenced code block. An appropriate value of this field can be decided by
calculate_code_block_token_count().
Note that the default value is 4 which allows for one level of nested code-blocks,
which is typically a safe value for common kinds of markdown documents.
code_block_token: charThe character to use for code block fences (backtick or tilde)
list_token: charThe character to use for unordered list items
ordered_list_token: charThe character to use after ordered list numbers (e.g., ‘.’ for 1.)
increment_ordered_list_bullets: boolWhether to increment the number for each ordered list item
emphasis_token: charThe character to use for emphasis (italic)
strong_token: &'a strThe string to use for strong emphasis (bold)
use_html_for_super_sub_script: boolIf true (default) then use HTML tags <sup> and <sub>.
If false, use the Markdown symbols ^ and ~ instead.
If you use ENABLE_SUPERSCRIPT and
ENABLE_SUBSCRIPT when parsing, then
you might need this in order to round-trip Markdown byte-for-byte, with knowledge
of whether the parsed documents use <sub>/<sup> or ^/~ instead.