prevent stack trace for HTML templates containing CDATA section
memory optimization

• don't toLowerCase the same string multiple times
• create original string only if really needed
Merge pull request #433 from darkv/template_parser_patch

Template parser patch