HtmlEntities (HtmlEntities v0.5.2) View Source

Decode and encode HTML entities in a string.

Examples

Decoding:

iex> "Tom & Jerry" |> HtmlEntities.decode
"Tom & Jerry"
iex> "¡Ay, caramba!" |> HtmlEntities.decode
"¡Ay, caramba!"
iex> "ő ő" |> HtmlEntities.decode
"ő ő"

Encoding:

iex> "Tom & Jerry" |> HtmlEntities.encode
"Tom & Jerry"
iex> "<< KAPOW!! >>" |> HtmlEntities.encode
"&lt;&lt; KAPOW!! &gt;&gt;"

Link to this section Summary

Functions

Decode HTML entities in a string.

Encode HTML entities in a string.

Link to this section Functions

Specs

decode(String.t()) :: String.t()

Decode HTML entities in a string.

Specs

encode(String.t()) :: String.t()

Encode HTML entities in a string.