Replace inline links with unique references and a link table.