Convert Quill (Slab) Delta document format to HTML.
Use to_html/2 to render rich text for web pages and emails.
See the README for usage, feature support, and alternatives.
Summary
Functions
Convert Quill Delta to HTML.
Functions
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 exampleql-align-*,ql-direction-rtl,ql-indent-*) instead of inline block styles. Defaults to false.:link_sanitization- Link sanitization policy::quill(default) - Allowshttp,https,mailto,tel, andsms. Non-whitelisted or malformed links fallback toabout:blank.:strict- Allows onlyhttp,https, andmailto. 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>"