将包含 class 名称的锚标记的 Haml 代码转换为 Rails 中的 Html?
Converting Haml code consisting anchor tag with class names to Html in Rails?
我有 haml 页面,我需要转换为 html 页面。我正在使用 https://haml2erb.org/ 进行转换。但是我无法转换下面的代码,它在行显示错误:%a.button.dropdown-toggle.on-dark{data: { toggle: 'dropdown' }}
这是我的代码:
.list
.panel-title
.primary
%h2
{{ title }}
.wrapper
.secondary
.dropdown
%a.button.dropdown-toggle.on-dark{data: { toggle: 'dropdown' }}
%fa{name: 'ellipsis-v'}
%b.caret
似乎 haml2erb
难以处理数据属性的嵌套哈希。这是它应该产生的结果:
<div class="list">
<div class="panel-title">
<div class="primary">
<h2>
{{ title }}
</h2>
</div>
<div class="wrapper">
<div class="secondary">
<div class="dropdown">
<a class="button dropdown-toggle on-dark" data-toggle="dropdown">
<fa name="ellipsis-v"></fa>
<b class="caret"></b>
</a>
</div>
</div>
</div>
</div>
</div>
我有 haml 页面,我需要转换为 html 页面。我正在使用 https://haml2erb.org/ 进行转换。但是我无法转换下面的代码,它在行显示错误:%a.button.dropdown-toggle.on-dark{data: { toggle: 'dropdown' }} 这是我的代码:
.list
.panel-title
.primary
%h2
{{ title }}
.wrapper
.secondary
.dropdown
%a.button.dropdown-toggle.on-dark{data: { toggle: 'dropdown' }}
%fa{name: 'ellipsis-v'}
%b.caret
似乎 haml2erb
难以处理数据属性的嵌套哈希。这是它应该产生的结果:
<div class="list">
<div class="panel-title">
<div class="primary">
<h2>
{{ title }}
</h2>
</div>
<div class="wrapper">
<div class="secondary">
<div class="dropdown">
<a class="button dropdown-toggle on-dark" data-toggle="dropdown">
<fa name="ellipsis-v"></fa>
<b class="caret"></b>
</a>
</div>
</div>
</div>
</div>
</div>