诈骗的“非法巢穴"错误 [英] scaml "illegal nesting" error

查看:72
本文介绍了诈骗的“非法巢穴"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个总的Noob,处于鳞片状/诈骗状态(我标记为haml,因为诈骗与犯罪分子是相似的).我有一些看起来像这样的模板:

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

%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

推荐答案

在HAML中,您不能同时在同一行和缩进的位置提供内容.

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

因此,如果您编写%p Contact:,则无法在<p>中添加其他内容.您必须将所有内容移至下一个缩进级别:

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

这篇关于诈骗的“非法巢穴"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆