This is not an issue.
If you have a closing tag and then plain text afterwards it will show up as plain-text, similar to HTML.
The focus and idea here is that your HTML tags are properly closed before placing them to be rendered
In the case that you are sent a chunk with both a closing tag and a new opening tag you can simply slice the string to only push the closing tag out the buffer