diff --git a/lib/xml_builder.ex b/lib/xml_builder.ex index 61891d7..dbba2ea 100644 --- a/lib/xml_builder.ex +++ b/lib/xml_builder.ex @@ -118,7 +118,10 @@ defmodule XmlBuilder do string |> String.replace(">", ">") |> String.replace("<", "<") - |> fn(s) -> Regex.replace(~r/&(?!lt;|gt;|quot;)/, s, "&") end.() + |> replace_ampersand end + defp replace_ampersand(string) do + Regex.replace(~r/&(?!lt;|gt;|quot;)/, string, "&") + end end