manuel-serrano / hop

Multitier JavaScript
Other
142 stars 18 forks source link

Compilation of empty <title>. #65

Closed vprunet closed 5 years ago

vprunet commented 5 years ago

Hi,

The following example is not compiled as expected. The missing title is replaced by what should be the body. I found this issue by copying a third party html example.

Vincent

service foo() {
  return <html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <div> coucou</div>
  </body>
</html>;
}
manuel-serrano commented 5 years ago

Hi Vincent,

Which branch are you using? With 3.2.0 it seems correct. I will check with 3.1.0 (it is currently being compiled :-)

manuel-serrano commented 5 years ago

Forget about my last message. I have understood what's going wrong. Hop generates , which is why I though the generated code was correct. This is apparently not a well formed HTML fragment and then browsers interpret this form as if the following was indeed the body of the title. I will fix this right away...</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/manuel-serrano"><img src="https://avatars.githubusercontent.com/u/8651934?v=4" />manuel-serrano</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>I have fixed the problem and I have pushed a new 3.1.x version. I will push the patch for 3.2.x no later than tomorrow. </p> <p>Thanks again for the report.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/vprunet"><img src="https://avatars.githubusercontent.com/u/5165447?v=4" />vprunet</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>Thank you. </p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>