tidy up source rendering on popup