html: generate an anchor if needed