Content rendering utilities for newsletters.
Converts markdown to HTML and HTML to plain text for email delivery.
Summary
Functions
Renders markdown to HTML. Returns the HTML string on both success and partial-error (Earmark may produce HTML even with warnings/errors).
Renders markdown to HTML, returning an ok/error tuple.
Converts HTML to plain text for the text/plain part of emails.
Functions
Renders markdown to HTML. Returns the HTML string on both success and partial-error (Earmark may produce HTML even with warnings/errors).
Renders markdown to HTML, returning an ok/error tuple.
Returns {:ok, html} on success or {:error, errors} when Earmark
cannot produce valid output.
Converts HTML to plain text for the text/plain part of emails.
Converts <br> tags to newlines, </p> to double newlines,
and strips all remaining HTML tags.