fix wl_replace_item_id_with_uri to deal with unknown entities