HAML:在"link_to"后删除空格
问题描述:
以下代码在HTML中留有空白:
The following code leaves a white space in HTML:
= link_to "Login", "#"
通常,HAML允许通过在行末添加>"来删除它,例如:
Normally, HAML allows to remove it by putting ">" at the end of the line, for example:
%input#query{:type => "text", :value => "Search"}>
但是,当插入Rails代码时,这似乎是不可能的.
However, that seems to be impossible, when Rails code is inserted.
我该如何解决?
答
如何?
%span>= link_to "Login", "#"
它在链接周围增加了一个额外的跨度,但这些无害.
It adds an extra span around the link, but those are pretty harmless.
我发现haml对于其中一些极端情况可能会有些问题:(
I find haml can have a bit of a problem with some of these corner cases :(