Plug.HTML
Conveniences for generating HTML.
Summary
Functions
- html_escape(data)
Escapes the given HTML to string.
- html_escape_to_iodata(data)
Escapes the given HTML to iodata.
Functions
html_escape(data)
Specs
html_escape(String.t()) :: String.t()
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: " & '"
html_escape_to_iodata(data)
Specs
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: " | """], " " | "&"], " " | "'"]
© 2013 Plataformatec
Licensed under the Apache License, Version 2.0.
https://hexdocs.pm/plug/Plug.HTML.html