fix #547 and escape string when only JS in the live output (first version was on wrong branch)