Fixing the line number counting in HtmlParser

In the current version the message from the TemplateCompilationException was totally useless as the lineNumberCounting has some bugs in the HtmlParse. Fixed with a short commit, and tested with two unit tests.