raxx v0.15.11 EEx.HTMLEngine
An engine for templating HTML content.
Interpolated values are HTML escaped,
unless the term implements the EEx.HTML.Safe
protocol.
Values returned are io_lists
for performance reasons.
Examples
iex> EEx.eval_string("foo <%= bar %>", [bar: "baz"], engine: EEx.HTMLEngine)
...> |> IO.iodata_to_binary()
"foo baz"
iex> EEx.eval_string("foo <%= bar %>", [bar: "<script>"], engine: EEx.HTMLEngine)
...> |> IO.iodata_to_binary()
"foo <script>"
iex> EEx.eval_string("foo <%= bar %>", [bar: EEx.HTML.raw("<script>")], engine: EEx.HTMLEngine)
...> |> IO.iodata_to_binary()
"foo <script>"
iex> EEx.eval_string("foo <%= @bar %>", [assigns: %{bar: "<script>"}], engine: EEx.HTMLEngine)
...> |> IO.iodata_to_binary()
"foo <script>"
Link to this section Summary
Functions
Callback implementation for EEx.Engine.handle_begin/1
Callback implementation for EEx.Engine.handle_body/1
Callback implementation for EEx.Engine.handle_end/1
Callback implementation for EEx.Engine.handle_expr/3
Callback implementation for EEx.Engine.handle_text/2
Callback implementation for EEx.Engine.init/1
Link to this section Functions
Callback implementation for EEx.Engine.handle_begin/1
.
Callback implementation for EEx.Engine.handle_body/1
.
Callback implementation for EEx.Engine.handle_end/1
.
Callback implementation for EEx.Engine.handle_expr/3
.
Callback implementation for EEx.Engine.handle_text/2
.
Callback implementation for EEx.Engine.init/1
.