- attributes_string = for {attribute, value} <- attributes do
- "#{attribute}=\"#{value}\""
- end |> Enum.join(" ")
-
- Enum.join([tag, attributes_string], " ") |> String.strip
+ attributes_string =
+ for {attribute, value} <- attributes do
+ value = String.replace(value, "\"", """)
+ "#{attribute}=\"#{value}\""
+ end
+ |> Enum.join(" ")
+
+ [tag, attributes_string] |> Enum.join(" ") |> String.trim()