Glentities - HTML entity encoding/decoding for Gleam

I’m working on some web stuff with Gleam, including a small template engine, so I needed HTML entity encoding. Thought I might as well write decoding support too. So, here is…

glentities!

It’s very simple and has some assumptions about what you want to encode (like, not encoding \n into 
). It supports all of the named characters in the WHATWG named characters table.

Currently it works for the Erlang target. JavaScript support is waiting on this bug: Binary matching slices the wrong length in JavaScript target · Issue #2001 · gleam-lang/gleam · GitHub.

2 Likes