Html 在 HAML 工具提示元素的标题属性中

Html in Title attribute of an element for tooltip in HAML

我正在开发使用 ruby 和 haml 开发的应用程序,现在我需要在元素上显示工具提示,并且工具提示也将包含图像,因此此工具提示将是 HTML。

我的 html 工具提示结构就像

<li><a href="www.example.com" class='empty-space-tooltip' title='<img src="images/info.png" width="300" height="150" alt="Info" />'>
    <img src="images/info.png" width="16" height="16" alt="Info" /></a>
    <a href="www.example.com" class="main-link" title='<img src="images/info.png" width="300" height="150" alt="Info" />'><span>Title</span></a></li>

如何在HAML中写入 我正在尝试遵循代码

%li 
   %a{:href => "#/", :title => '%img{alt: "", height: "150", src: "images/info.png", width: "300"}/'} Send
   %a{:href => "#/", :title => '%img{alt: "", height: "150", src: "images/info.png", width: "300"}/'} Title

使用 htmltohaml.com 并删除所有反斜杠:

%li
  %a.empty-space-tooltip{:href => "www.example.com", :title => "<img src="images/info.png" width="300" height="150" alt="Info" />"}
    %img{:alt => "Info", :height => "16", :src => "images/info.png", :width => "16"}/
  %a.main-link{:href => "www.example.com", :title => "<img src="images/info.png" width="300" height="150" alt="Info" />"}
    %span Title