raxx v0.15.10 EEx.HTML
Conveniences for generating HTML.
Link to this section Summary
Functions
Escape the HTML content derived from the given term
Escapes the given HTML to string.
iex> EEx.HTML.escape_to_binary("foo")
"foo"
iex> EEx.HTML.escape_to_binary("<foo>")
"<foo>"
iex> EEx.HTML.escape_to_binary("quotes: \" & \'")
"quotes: " & '"
Escapes the given HTML to iodata.
iex> EEx.HTML.escape_to_iodata("foo")
"foo"
iex> EEx.HTML.escape_to_iodata("<foo>")
[[[] | "<"], "foo" | ">"]
iex> EEx.HTML.escape_to_iodata("quotes: \" & \'")
[[[[], "quotes: " | """], " " | "&"], " " | "'"]
Link to this section Functions
Link to this function
escape(content)
Escape the HTML content derived from the given term.
The content is returned wrapped in an EEx.HTML.Safe
struct so it is not reescaped by templates etc.
Escapes the given HTML to string.
iex> EEx.HTML.escape_to_binary("foo")
"foo"
iex> EEx.HTML.escape_to_binary("<foo>")
"<foo>"
iex> EEx.HTML.escape_to_binary("quotes: \" & \'")
"quotes: " & '"
Escapes the given HTML to iodata.
iex> EEx.HTML.escape_to_iodata("foo")
"foo"
iex> EEx.HTML.escape_to_iodata("<foo>")
[[[] | "<"], "foo" | ">"]
iex> EEx.HTML.escape_to_iodata("quotes: \" & \'")
[[[[], "quotes: " | """], " " | "&"], " " | "'"]
Link to this function
raw(content)