TemplateParser: fixed a bug that occurs on Travis, related to empty text nodes