fix broken href parsing when adding a link. fixes #1