Limit the number of sublinks outputted in Scala