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 に答える