diff --git a/src/e2h.erl b/src/e2h.erl index 912fb5f..125d1d7 100644 --- a/src/e2h.erl +++ b/src/e2h.erl @@ -9,7 +9,7 @@ %%%----------------------------------------------------------------------------- -module(e2h). --export([render/1, escape/1]). +-export([render_html/1, render/1, escape/1]). -export_type([key/0, attributes/0, elements/0]). %%%============================================================================= @@ -50,6 +50,14 @@ %%% Public functions %%%============================================================================= +%%------------------------------------------------------------------------------ +%% @doc Similar to {@link render/1}, with a DOCTYPE declaration. +%% @end +%%------------------------------------------------------------------------------ +-spec render_html(elements()) -> binary(). +render_html(Elements) when is_list(Elements) -> + encode_elements(Elements, <<"\n">>). + %%------------------------------------------------------------------------------ %% @doc Renders a list of structure into a binary representation of an %% HTML document. @@ -64,7 +72,7 @@ %%------------------------------------------------------------------------------ -spec render(elements()) -> binary(). render(Elements) when is_list(Elements) -> - encode_elements(Elements, <<"\n">>). + encode_elements(Elements, <<>>). %%------------------------------------------------------------------------------ %% @doc Escapes dangerous HTML characters within a binary data input. diff --git a/test/e2h_tests.erl b/test/e2h_tests.erl index 94c2472..1aba609 100644 --- a/test/e2h_tests.erl +++ b/test/e2h_tests.erl @@ -27,5 +27,5 @@ simple_render_test() -> Rendered = e2h:render(Elements), Expected = - <<"\n