Floki.raw_html
You're seeing just the function
raw_html
, go back to Floki module for more information.
Specs
Converts HTML tree to raw HTML. Note that the resultant HTML may be different from the original one. Spaces after tags and doctypes are ignored.
Options
:encode
: acceptstrue
orfalse
. Will encode html special characters to html entities. You can also control the encoding behaviour at the application level viaconfig :floki, :encode_raw_html, true | false
:pretty
: acceptstrue
orfalse
. Will format the output, ignoring breaklines and spaces from the input and putting new ones in order to pretty format the html.
Examples
iex> Floki.raw_html({"div", [{"class", "wrapper"}], ["my content"]})
~s(<div class="wrapper">my content</div>)
iex> Floki.raw_html({"div", [{"class", "wrapper"}], ["10 > 5"]}, encode: true)
~s(<div class="wrapper">10 > 5</div>)
iex> Floki.raw_html({"div", [{"class", "wrapper"}], ["10 > 5"]}, encode: false)
~s(<div class="wrapper">10 > 5</div>)
iex> Floki.raw_html({"div", [], ["\n ", {"span", [], "Fully indented"}, " \n"]}, pretty: true)
"""
<div>
<span>
Fully indented
</span>
</div>
"""