开发者

scaml "illegal nesting" error

Hi I'm a total Noob at scalate/scaml (I tagged haml since scaml & haml are similar). I have some template that looks like 开发者_高级运维this:

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

The %p line is flagged with this error:

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


In HAML, you can't provide content both on the same line and indented.

So, if you write %p Contact:, you can't add anything else to the <p>. You have to move everything to the next indentation level:

    %p
      Contact:
      %a{:href => 'mailto:#{customer.email}'}=customer.contact
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜