pub struct ConversionOptions {Show 38 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 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,
pub link_style: LinkStyle,
pub output_format: OutputFormat,
pub include_document_structure: bool,
pub extract_images: bool,
pub max_image_size: u64,
pub capture_svg: bool,
pub infer_dimensions: bool,
}Expand description
Main conversion options for HTML to Markdown conversion.
Use ConversionOptions::builder() to construct, or Default::default() for defaults.
§Example
use html_to_markdown_rs::ConversionOptions;
let options = ConversionOptions::builder()
.heading_style(HeadingStyle::Atx)
.wrap(true)
.wrap_width(100)
.build();Fields§
§heading_style: HeadingStyleHeading style to use in Markdown output (ATX # or Setext underline).
list_indent_type: ListIndentTypeHow to indent nested list items (spaces or tab).
list_indent_width: usizeNumber of spaces (or tabs) to use for each level of list indentation.
bullets: StringBullet character(s) to use for unordered list items (e.g. "-", "*").
strong_em_symbol: charCharacter used for bold/italic emphasis markers (* or _).
escape_asterisks: boolEscape * characters in plain text to avoid unintended bold/italic.
escape_underscores: boolEscape _ characters in plain text to avoid unintended bold/italic.
escape_misc: boolEscape miscellaneous Markdown metacharacters ([]()# etc.) in plain text.
escape_ascii: boolEscape ASCII characters that have special meaning in certain Markdown dialects.
code_language: StringDefault language annotation for fenced code blocks that have no language hint.
autolinks: boolAutomatically convert bare URLs into Markdown autolinks.
default_title: boolEmit a default title when no <title> tag is present.
br_in_tables: boolRender <br> elements inside table cells as literal line breaks.
highlight_style: HighlightStyleStyle used for <mark> / highlighted text (e.g. ==text==).
extract_metadata: boolExtract <meta> and <head> information into the result metadata.
whitespace_mode: WhitespaceModeControls how whitespace is normalised during conversion.
strip_newlines: boolStrip all newlines from the output, producing a single-line result.
wrap: boolWrap long lines at wrap_width characters.
wrap_width: usizeMaximum line width when wrap is enabled (default 80).
convert_as_inline: boolTreat the entire document as inline content (no block-level wrappers).
sub_symbol: StringMarkdown notation for subscript text (e.g. "~").
sup_symbol: StringMarkdown notation for superscript text (e.g. "^").
newline_style: NewlineStyleHow to encode hard line breaks (<br>) in Markdown.
code_block_style: CodeBlockStyleStyle used for fenced code blocks (backticks or tilde).
keep_inline_images_in: Vec<String>HTML tag names whose <img> children are kept inline instead of block.
preprocessing: PreprocessingOptionsPre-processing options applied to the HTML before conversion.
encoding: StringExpected character encoding of the input HTML (default "utf-8").
debug: boolEmit debug information during conversion.
HTML tag names whose content is stripped from the output entirely.
HTML tag names that are preserved verbatim in the output.
skip_images: boolSkip conversion of <img> elements (omit images from output).
link_style: LinkStyleLink rendering style (inline or reference).
output_format: OutputFormatTarget output format (Markdown, plain text, etc.).
include_document_structure: boolInclude structured document tree in result.
extract_images: boolExtract inline images from data URIs and SVGs.
max_image_size: u64Maximum decoded image size in bytes (default 5MB).
capture_svg: boolCapture SVG elements as images.
infer_dimensions: boolInfer image dimensions from data.
Implementations§
Source§impl ConversionOptions
impl ConversionOptions
Sourcepub fn builder() -> ConversionOptionsBuilder
pub fn builder() -> ConversionOptionsBuilder
Create a new builder with default values.
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.
Sourcepub fn from_update(update: ConversionOptionsUpdate) -> Self
pub fn from_update(update: ConversionOptionsUpdate) -> Self
Create from a partial update, applying 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