Plug v1.4.0 Plug.HTML View Source
Conveniences for generating HTML.
Link to this section Summary
Link to this section Functions
Escapes the given HTML to string.
iex> Plug.HTML.html_escape("foo")
"foo"
iex> Plug.HTML.html_escape("<foo>")
"<foo>"
iex> Plug.HTML.html_escape("quotes: \" & \'")
"quotes: " & '"
Link to this function
html_escape_to_iodata(data)
View Source
html_escape_to_iodata(String.t) :: iodata
Escapes the given HTML to iodata.
iex> Plug.HTML.html_escape_to_iodata("foo")
"foo"
iex> Plug.HTML.html_escape_to_iodata("<foo>")
["<", "foo", ">" | ""]
iex> Plug.HTML.html_escape_to_iodata("quotes: \" & \'")
["quotes: ", """, " ", "&", " ", "'" | ""]