Packages
kirala_markdown
1.0.2
Markdown parser and html renderer written in Gleam language both Erlang and Javascript target.
Current section
Files
Jump to
Current section
Files
src/kirala@markdown@strfmt_ffi.erl
-module(kirala@markdown@strfmt_ffi).
-compile(export_all).
text(Strs) ->
gleam@string:join(Strs, <<"">>).
str(X) when is_binary(X) -> X;
str(X) when is_list(X) ->
Content = gleam@string:join( lists:map(fun str/1, X), <<", ">>),
<<"["/utf8,Content/utf8,"]"/utf8>>;
str(X) when is_tuple(X) ->
Content = gleam@string:join( lists:map(fun str/1, tuple_to_list(X)),<<", ">>),
<<"#("/utf8,Content/utf8,")"/utf8>>;
str(X) when is_integer(X) -> integer_to_binary(X);
str(X) when is_float(X) -> float_to_binary(X);
str(X) when is_atom(X) -> atom_to_binary(X, utf8).