reintroduce escaping, fix preexisting issues with line terminators in chat.ui.js