pub struct ConversionResult {
pub content: Option<String>,
pub document: Option<DocumentStructure>,
pub metadata: HtmlMetadata,
pub tables: Vec<TableData>,
pub warnings: Vec<ProcessingWarning>,
}Expand description
The primary result of HTML conversion and extraction.
Contains the converted text output, optional structured document tree, metadata, extracted tables, images, and processing warnings.
§Example
use html_to_markdown_rs::{convert, ConversionOptions};
let result = convert("<h1>Hello</h1><p>World</p>", None)?;
assert!(result.content.is_some());
assert!(result.warnings.is_empty());Fields§
§content: Option<String>Converted text output in the selected format: Markdown, Djot, or plain text.
document: Option<DocumentStructure>Structured document tree with semantic elements.
Populated when ConversionOptions::include_document_structure is true. None
otherwise (the default), which avoids the overhead of building the tree.
When present, the tree mirrors the converted document: headings open
crate::types::document::NodeContent::Group sections, paragraphs and list items carry
inline crate::types::document::TextAnnotations, and tables reference the same
crate::types::tables::TableGrid data exposed in Self::tables.
Note: this field is independent of the metadata feature flag. Document structure
collection is always available at runtime; it is gated only by the runtime option, not
by a compile-time feature.
metadata: HtmlMetadataExtracted HTML metadata (title, OG, links, images, structured data).
tables: Vec<TableData>Extracted tables with structured cell data and markdown representation.
warnings: Vec<ProcessingWarning>Non-fatal processing warnings.
Trait Implementations§
Source§impl Clone for ConversionResult
impl Clone for ConversionResult
Source§fn clone(&self) -> ConversionResult
fn clone(&self) -> ConversionResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more