[core] fix generateParagraph when empty text