How do you handle text in HTML templates?

That’s an app I developed for a couple of clients as part of a Caspar based solution. Is mainly based on this prototype.
Only some libraries are open source, the rest is not.