# `DeltaHtml`
[🔗](https://github.com/ftes/delta_html/blob/v0.5.0/lib/delta_html.ex#L1)

Convert Quill (Slab) [Delta](https://quilljs.com/docs/delta) document format to HTML.

Use `to_html/2` to render rich text for web pages and emails.
See the [README](readme.html) for usage, feature support, and alternatives.

# `to_html`

  Convert Quill Delta to HTML.

## Options
  * `:preserve_whitespace` - When true, wraps the output in a div with white-space: pre-wrap to preserve whitespace. Defaults to false.
  * `:quill_css` - When true, emits Quill-style classes (for example `ql-align-*`, `ql-direction-rtl`, `ql-indent-*`) instead of inline block styles.
    Defaults to false.
  * `:link_sanitization` - Link sanitization policy:
    * `:quill` (default) - Allows `http`, `https`, `mailto`, `tel`, and `sms`. Non-whitelisted or malformed links fallback to `about:blank`.
    * `:strict` - Allows only `http`, `https`, and `mailto`. Non-whitelisted or malformed links are removed.

## Examples
    iex> to_html([%{"insert" => "word\n"}])
    "<p>word</p>"

    iex> to_html([%{"insert" => "word\n"}], preserve_whitespace: true)
    "<div style=\"white-space: pre-wrap;\"><p>word</p></div>"

---

*Consult [api-reference.md](api-reference.md) for complete listing*
