pub struct ConversionOptions {Show 32 fields
pub heading_style: HeadingStyle,
pub list_indent_type: ListIndentType,
pub list_indent_width: usize,
pub bullets: String,
pub strong_em_symbol: char,
pub escape_asterisks: bool,
pub escape_underscores: bool,
pub escape_misc: bool,
pub escape_ascii: bool,
pub code_language: String,
pub autolinks: bool,
pub default_title: bool,
pub br_in_tables: bool,
pub hocr_spatial_tables: bool,
pub highlight_style: HighlightStyle,
pub extract_metadata: bool,
pub whitespace_mode: WhitespaceMode,
pub strip_newlines: bool,
pub wrap: bool,
pub wrap_width: usize,
pub convert_as_inline: bool,
pub sub_symbol: String,
pub sup_symbol: String,
pub newline_style: NewlineStyle,
pub code_block_style: CodeBlockStyle,
pub keep_inline_images_in: Vec<String>,
pub preprocessing: PreprocessingOptions,
pub encoding: String,
pub debug: bool,
pub strip_tags: Vec<String>,
pub preserve_tags: Vec<String>,
pub skip_images: bool,
}Expand description
Main conversion options for HTML to Markdown conversion.
Fields§
§heading_style: HeadingStyleHeading style (Underlined, Atx, AtxClosed)
list_indent_type: ListIndentTypeList indentation type (Spaces or Tabs)
list_indent_width: usizeList indentation width in spaces (applied if using spaces indentation)
bullets: StringBullet characters for unordered lists (e.g., “-”, “*”, “+”)
strong_em_symbol: charSymbol for strong/emphasis emphasis rendering (* or _)
escape_asterisks: boolEscape asterisks (*) in text to prevent accidental formatting
escape_underscores: boolEscape underscores (_) in text to prevent accidental formatting
escape_misc: boolEscape miscellaneous markdown characters (\ & < ` [ > ~ # = + | -)
escape_ascii: boolEscape all ASCII punctuation characters (for CommonMark spec compliance tests)
code_language: StringDefault code language for fenced code blocks when not specified
autolinks: boolUse autolinks syntax for bare URLs (http://example.com)
default_title: boolAdd default title element to HTML if none exists before conversion
br_in_tables: boolUse HTML
elements in tables instead of spaces for line breaks
hocr_spatial_tables: boolEnable spatial table reconstruction in hOCR documents (via spatial positioning analysis)
highlight_style: HighlightStyleHighlight style for elements (DoubleEqual, Html, Bold, None)
extract_metadata: boolExtract metadata from HTML (title, description, images, links, etc.)
whitespace_mode: WhitespaceModeWhitespace handling mode (Normalized collapses multiple spaces, Strict preserves)
strip_newlines: boolStrip newline characters from HTML before processing
wrap: boolEnable automatic text wrapping at wrap_width
wrap_width: usizeText wrapping width in characters (default 80)
convert_as_inline: boolTreat block-level elements as inline during conversion
sub_symbol: StringCustom symbol for subscript content (e.g., “~”)
sup_symbol: StringCustom symbol for superscript content (e.g., “^”)
newline_style: NewlineStyleNewline style in markdown output (Spaces adds two spaces, Backslash adds )
code_block_style: CodeBlockStyleCode block fence style (Indented, Backticks, Tildes)
keep_inline_images_in: Vec<String>HTML elements where images should remain as markdown links (not converted to alt text)
preprocessing: PreprocessingOptionsHTML preprocessing options (remove nav, forms, etc.)
encoding: StringSource document encoding (informational, typically “utf-8”)
debug: boolEnable debug mode with diagnostic warnings on conversion issues
HTML tags to strip (extract text content, no markdown conversion)
HTML tags to preserve as-is in output (keep original HTML, useful for complex tables)
skip_images: boolSkip all images during conversion.
When enabled, all <img> elements are completely omitted from output.
Useful for text-only extraction or filtering out visual content.
Implementations§
Source§impl ConversionOptions
impl ConversionOptions
Sourcepub fn apply_update(&mut self, update: ConversionOptionsUpdate)
pub fn apply_update(&mut self, update: ConversionOptionsUpdate)
Apply a partial update to these conversion options.
Any specified fields in the update will override the current values. Unspecified fields (None) are left unchanged.
§Arguments
update- Partial options update with fields to override
Sourcepub fn from_update(update: ConversionOptionsUpdate) -> Self
pub fn from_update(update: ConversionOptionsUpdate) -> Self
Create new conversion options from a partial update.
Creates a new ConversionOptions struct with defaults, then applies the update.
Fields not specified in the update keep their default values.
§Arguments
update- Partial options update with fields to set
§Returns
New ConversionOptions with specified updates applied to defaults
Trait Implementations§
Source§impl Clone for ConversionOptions
impl Clone for ConversionOptions
Source§fn clone(&self) -> ConversionOptions
fn clone(&self) -> ConversionOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more