/eex_html

Extension to Embedded Elixir (EEx), that allows content to be safely embedded into HTML.

Primary LanguageElixirApache License 2.0Apache-2.0

EExHTML

Extension to Embedded Elixir (EEx), that allows content to be safely embedded into HTML.

Hex pm Build Status License

Usage

iex> title = "EEx Rocks!"
iex> content = ~E"<h1><%= title %></h1>"
iex> "#{content}"
"<h1>EEx Rocks!</h1>"

iex> title = "<script>"
iex> content = ~E"<h1><%= title %></h1>"
iex> "#{content}"
"<h1>&lt;script&gt;</h1>"

Elixir language proposal

I would like to see this project as part of the Elixir language. The reasons for this are explained in this proposal.