Simplex_format - A plain text to HTML formatter for user content

library
phoenix_html
#1

In case it’s useful for anyone I’ve open sourced simplex_format, a plain text to HTML formatter that extends Phoenix.HTML’s text_to_html with support for links. It’s designed to be safe to use for user content such as comments.

text_to_html("Hello, welcome to http://www.google.com", auto_link: true) |> safe_to_string
"<p>Hello, welcome to <a href=\"http://www.google.com\">http://www.google.com</a></p>\n"

Hex: https://hex.pm/packages/simplex_format
Code: https://github.com/poplarhq/simplex_format
Docs: https://hexdocs.pm/simplex_format

6 Likes