Fix premature HTML encoding

Fixes #254 and possibly others.