Fix linking attachments when HTML is not used