Fixes #1138 caret rendering in empty paragraphs, void elements and end of paragraphs