0

这是我的 nhaml 代码

^ var title=""
!!! XML
!!! Strict
%html{xmlns="http://www.w3.org/1999/xhtml"}
  %head
    %title
      Nhaml Master #{title}
      _styles
    %body
  .page      
        %h1 = "hello world"
        _
        _scripts

生成的 HTML 呈现最后一个标签,如下所示:

    </div>
  </body>
        <script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js" type="text/javascript">
        </script>

</html>

由于_scripts仍然处于%body +1的缩进级别,为什么在渲染_scripts之前关闭body?

4

1 回答 1

1

如果将脚本移到部分上方,它会起作用吗?如果是这样,那么部分可能是罪魁祸首。

   %h1 = "hello world"
    _scripts
    _
于 2009-11-05T14:33:41.447 回答