Improved handling of quotes, fixed DOM issues related to linebreaks