Reduce duplicated code in text and list blocks.