ref-filter: introduce format_ref_array_item()