Fix links parsing and writing.