slightly better wiki template processing for queries