account for newlines when comparing title, and pick longest string when multiple headers are in the title