【发布时间】:2015-06-02 07:03:47
【问题描述】:
我正在尝试格式化一个简单的句子,如下所示:
当我的haml看起来像这样时:
%a{:href => "link", :target=> '_blank'} x,
%a{:href => "link", :target=> '_blank'} y,
and
%a{:href => "link", :target=> '_blank'} z.
我明白了
当我的haml看起来有点不同时::
%a{:href => "link", :target=> '_blank'} x
,
%a{:href => "link", :target=> '_blank'} y
, and
%a{:href => "link", :target=> '_blank'} z
.
我明白了
...空格看起来不对。
我怎样才能让它看起来像我想要的那样?
我希望它看起来像
...逗号和句点不是链接,也没有奇怪的额外空格。
【问题讨论】:
-
使用 link_to 标记尝试,添加相同的答案
-
你知道这个技巧吗? Whitespace removal.
-
你真的要在 y 后面加逗号吗?逗号和“和”没有意义
-
@AmitBadhekaPykihStaff:en.wikipedia.org/wiki/Serial_comma
-
Haml 不太擅长这种事情,请参阅haml.info/docs/yardoc/file.FAQ.html#q-punctuation