Fix #1453

Used addslashes() to prevent JS errors (not sure if it's the best
solution, but it was used in misc.php only for some reason).

Also added spaces in misc.php inserter for consistency and listed the
replacements in new lines instead of separating them with space/comma
which looks kinda weird.