Fix problem with popovers introduced by moving the trigger from the li to the document_number link. (wouldn't open properly a second time).
Strip newlines when needed