Prevent empty lines from being added to preview