Fix empty text-only block case

#1743

`parseTextBlock()` can return undefined sometimes, so we need to handle that