Current section

Files

Jump to
html_to_markdown lib html_to_markdown link_metadata.ex
Raw

lib/html_to_markdown/link_metadata.ex

# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:b66e63bedbe733cdfecdde47f2dd4d3e56c53a31eafbcf1e90f990a2eeeed9ab
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
defmodule HtmlToMarkdown.LinkMetadata do
@moduledoc """
Hyperlink metadata with categorization and attributes.
Represents `<a>` elements with parsed href values, text content, and link type classification.
# Examples
```
let link = LinkMetadata {
href: "https://example.com".to_string(),
text: "Example".to_string(),
title: Some("Visit Example".to_string()),
link_type: LinkType::External,
rel: vec!["nofollow".to_string()],
attributes: Default::default(),
};
assert_eq!(link.link_type, LinkType::External);
assert_eq!(link.text, "Example");
```
"""
@typedoc "Hyperlink metadata with categorization and attributes."
@type t :: %__MODULE__{
href: String.t() | nil,
text: String.t() | nil,
title: String.t() | nil,
link_type: String.t() | nil,
rel: [String.t()],
attributes: map()
}
defstruct href: nil,
text: nil,
title: nil,
link_type: :anchor,
rel: [],
attributes: %{}
end