[erlang-questions] beginner: Generating HTML with ">" from Erlang

Сергей Прохоров seriy.pr@REDACTED
Thu Feb 13 15:35:02 CET 2014


I'm sure, that embedded Javascript understands > and < instead of >
and < characters, so

<script>
if (a &gt b) alert("a greater than b");
</script>

should work.

You may also try Mochiweb's HTML parser/serializer, which is much simpler
and faster, than xmerl
https://github.com/mochi/mochiweb/blob/master/src/mochiweb_html.erl

Tree = {<<"html">>, [{<<"lang">>, <<"en">>}],
            [...child tags...]},
mochiweb_html:to_html(Tree).

But I'm not sure if it escapes special characters.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140213/78fca89b/attachment.htm>


More information about the erlang-questions mailing list