HtmlToMarkdown.ImageMetadata (html_to_markdown v3.6.0-rc.3)

Copy Markdown

Image metadata with source and dimensions.

Captures <img> elements and inline <svg> elements with metadata for image analysis and optimization.

Examples

let img = ImageMetadata {
    src: "https://example.com/image.jpg".to_string(),
    alt: Some("An example image".to_string()),
    title: Some("Example".to_string()),
    dimensions: Some((800, 600)),
    image_type: ImageType::External,
    attributes: Default::default(),
};

assert_eq!(img.image_type, ImageType::External);

Summary

Types

t()

Image metadata with source and dimensions.

Types

t()

@type t() :: %HtmlToMarkdown.ImageMetadata{
  alt: String.t() | nil,
  attributes: map(),
  dimensions: [non_neg_integer()] | nil,
  image_type: String.t() | nil,
  src: String.t() | nil,
  title: String.t() | nil
}

Image metadata with source and dimensions.