PhoenixKitEcommerce.HtmlText (PhoenixKitEcommerce v0.4.2)

Copy Markdown View Source

Plain-text extraction from HTML.

Shared between the Shopify CSV importer (Import.ProductTransformer) and the Shopify Admin API sync (Shopify.ProductDiff), so both derive a product's description from body_html the same way.

Summary

Functions

Strips tags from html, collapses whitespace, and truncates to limit characters (default 500). Returns nil for nil/"" input.

Functions

extract_description(html, limit \\ 500)

@spec extract_description(String.t() | nil, pos_integer()) :: String.t() | nil

Strips tags from html, collapses whitespace, and truncates to limit characters (default 500). Returns nil for nil/"" input.