2

こんにちは私はscalate/scamlの完全なNoobです(scamlとhamlは似ているのでhamlにタグを付けました)。次のようなテンプレートがあります。

-@ var customer : com.x.model.Customer
!!!
%html
    %body
        %p Contact:
            %a{:href => 'mailto:#{customer.email}'}=customer.contact

%p行には、次のエラーのフラグが付けられます。

org.fusesource.scalate.InvalidSyntaxException: Illegal nesting: content can't be given on the same line as html element or nested within it if the tag is closed at 16.17
4

1 に答える 1

5

HAML では、同じ行とインデントの両方でコンテンツを提供することはできません。

したがって、 と書い%p Contact:た場合、 に他に何も追加することはできません<p>。すべてを次のインデント レベルに移動する必要があります。

    %p
      Contact:
      %a{:href => 'mailto:#{customer.email}'}=customer.contact
于 2011-05-07T07:20:43.410 に答える