defmodule Premailex do @moduledoc """ Documentation for Premailex. """ alias Premailex.HTMLParser @doc """ Adds inline styles to an HTML string. ## Examples iex> Premailex.to_inline_css("

Text

") "

Text

" """ @spec to_inline_css(String.t()) :: String.t() def to_inline_css(html) do Premailex.HTMLInlineStyles.process(html) end @doc """ Turns an HTML string into text. ## Examples iex> Premailex.to_text("

Text

") "Text" """ @spec to_text(String.t()) :: String.t() def to_text(html) do html |> HTMLParser.all("body") |> Premailex.HTMLToPlainText.process() end end