哈姆尔非法筑巢
这是我的 Haml 代码:
%html
%head
%body
%table {'width' => 638, 'border' => 0, 'cellpadding' => 0, 'cellspacing' => 0}
%tr
%td {'width' => 27, 'height' => 100}
%td {'width' => 582, 'height' => 100}
%td {'width' => 29, 'height' => 100}
当我输入 haml example.haml example.html
时,出现以下错误:
第 5 行语法错误:非法嵌套:内容不能同时在与 %table 相同的行并嵌套在其中。
我做错了什么?
Here's my Haml code:
%html
%head
%body
%table {'width' => 638, 'border' => 0, 'cellpadding' => 0, 'cellspacing' => 0}
%tr
%td {'width' => 27, 'height' => 100}
%td {'width' => 582, 'height' => 100}
%td {'width' => 29, 'height' => 100}
when I enter haml example.haml example.html
, I get the following error:
Syntax error on line 5: Illegal nesting: content can't be both given on the same line as %table and nested within it.
What am I doing incorrectly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要删除标签和大括号之间的空格,如下所示:
You need to remove the spaces between the tags and the braces, like so:
我想帮助其他人避免非法嵌套的情况,如果他们没有意识到他们像我一样犯了错字。
如果你忘记了元素中的%,它会说非法嵌套
这将导致非法嵌套错误。不要忘记你的%s!
I want to help others avoid the illegal nesting situation if they don't realize they made a typo like me.
It will say illegal nesting if you forget the % in an element
That will result in the illegal nesting error. Don't forget your %s!