fix broken href parsing when adding a link