This is what I'm doing:
%p
%a{href:'/a'}
%img{src:'/img'}
This is what it looks like in the HTML:
<p>
<a href="/a">
<img src="/img">
</a>
</p>
I need this instead:
<p>
<a href="/a"><img src="/img"></a>
</p>
What should I do to my HAML config or the .haml
code? I'm with Sinatra.
答案 0 :(得分:2)
这看起来像whitespace removal feature:
的情况%p
%a{href:'/a'}<
%img{src:'/img'}
或:
%p
%a{href:'/a'}
%img{src:'/img'}>
都产生相同的输出:
<p>
<a href='/a'><img src='/img'></a>
</p>
答案 1 :(得分:0)
最干净的选择可能包括css
之类的内容:
a > img { display: inline-block }