2

I am using handlebar as a templating framework. When the template get compiled, in case it is not well-formed html, there should be exception thrown. Does handlebar have such a feature?

For example the following template is not well-formed as the img tag is not properly closed.

<head>
  <meta charset="utf-8"/>
  <title>Template</title>
</head>
<body>
  <div class="container">
    <div class="row">
      <div class="col">
        <img src="logo.jpg">
      </div>
    </div>
  </div>
</body>
</html>
A.v
  • 734
  • 5
  • 26
  • 1
    I don't know handlebar, but I would use an [HTML parser](https://jsoup.org/) for that - if it can parse the html, it is fine. – Leonardo Alves Machado Oct 07 '21 at 21:35
  • 1
    The answer is **no**. Handlebar (and mustache) will not validate your output. Because they do not ***assume*** it to be html (or xml or xhtml for that matter). – Elliott Frisch Oct 07 '21 at 21:42

0 Answers0