Solid.HTML (solid v0.7.1)

Conveniences for generating HTML.

Link to this section Summary

Functions

Escapes the given HTML to string.

Escapes the given HTML to iodata.

Link to this section Functions

Link to this function

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>")
"&lt;foo&gt;"

iex> Plug.HTML.html_escape("quotes: \" & \'")
"quotes: &quot; &amp; &#39;"
Link to this function

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>")
[[[] | "&lt;"], "foo" | "&gt;"]

iex> Plug.HTML.html_escape_to_iodata("quotes: \" & \'")
[[[[], "quotes: " | "&quot;"], " " | "&amp;"], " " | "&#39;"]
Link to this function

replacements(arg)