HtmlEntities

Elixir module for decoding HTML entities in a string.

Entity names, codepoints and their corresponding characters are copied from Wikipedia.

Installation

Add the dependency to your mix.exs file, then run mix deps.get.

defp deps do
  [{:html_entities, "~> 0.1"}]
end

Usage

Inside iex:

iex> HtmlEntities.decode("Tom & Jerry")
"Tom & Jerry"
iex> HtmlEntities.decode("¡Ay, caramba!")
"¡Ay, caramba!"

Inside a module:

defmodule EntityTest do
  def non_breaking_space do
    HtmlEntities.decode("¡")
  end
end