如何在 HAML 中应用指向多行文本字符串的链接?
我有一个像这样的多行块:
%li
=link_to image_tag("image.jpg", :size => "48x48", :alt => "Something", :title => "Something", :class => "some-class"), some_path
%p.testi
"Some text right here that is divided up onto multiple lines &
%br
and just won't stop running on!”
我需要一个链接来包围图像和文本。目前图像链接工作正常,但是在文本链接上,我相信我必须从 link_to 块开始,但我没有看到我应该遵循的语法。
如何正确完成此操作,以便所有多行文本也应用了链接?
I have a multiline chunk such as this:
%li
=link_to image_tag("image.jpg", :size => "48x48", :alt => "Something", :title => "Something", :class => "some-class"), some_path
%p.testi
"Some text right here that is divided up onto multiple lines &
%br
and just won't stop running on!”
I need a link to surround both the image and the text. Presently the image link works fine, however on the text link, I believe I have to start with a link_to block, but I'm not seeing the syntax that I should follow there.
How is this correctly done so that all of the multiple lines of text also have a link applied?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 slim 中(应该类似):
In slim (wich should be similar):
参阅HAML 中的多行字符串
请 在您换行的每一行的末尾。
See Multiline string in HAML
You want to use the | at the end of each line you are wrapping.