CONTENTBOX-80: Edit error

Fixed error where content added into the <pre> via main editor wouldn't
be reflected in modal.
Also fixed a JS issue when inserting a pre for the first time