File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ defmodule Phoenix.HTML do
132132 def raw ( value ) when is_binary ( value ) or is_list ( value ) , do: { :safe , value }
133133
134134 @ doc """
135- Escapes the HTML entities in the given term, returning iodata.
135+ Escapes the HTML entities in the given term, returning safe iodata.
136136
137137 iex> html_escape("<hello>")
138138 {:safe, [[[] | "<"], "hello" | ">"]}
@@ -156,6 +156,11 @@ defmodule Phoenix.HTML do
156156
157157 Fails if the result is not safe. In such cases, you can
158158 invoke `html_escape/1` or `raw/1` accordingly before.
159+
160+ You can combine `html_escape/1` and `safe_to_string/1`
161+ to convert a data structure to a escaped string:
162+
163+ data |> html_escape() |> safe_to_string()
159164 """
160165 @ spec safe_to_string ( safe ) :: String . t ( )
161166 def safe_to_string ( { :safe , iodata } ) do
You can’t perform that action at this time.
0 commit comments