haml - 删除 HAML 中的空格

标签 haml removing-whitespace

有没有办法在 HAML 中实现这一点?

<h1>Lorem ip<span class="red">sum</span><span class="subtitle">dolor</span></h1>

我使用了这个在线工具conversor( http://html2haml.heroku.com/ )

%h1
  Lorem ip
  %span.red sum
  %span.subtitle dolor

并以 HTML 形式呈现:

<h1>
  Lorem ip
  <span class='red'>sum</span>
  <span class='subtitle'>dolor</span>
</h1>

我正在尝试删除 ipsum 之间的空格,但无法实现。

最佳答案

这样:

%h1<
  Lorem ip
  %span.red> sum
  %span.subtitle dolor

输出如下:

<h1>Lorem ip<span class="red">sum</span><span class="subtitle">dolor</span></h1>

HAML Whitespace Removal

关于haml - 删除 HAML 中的空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5135239/

相关文章:

ios - substringToIndex 即使在修剪后也没有给出正确的输出

java - 使用 string.split() 时的前导空格

javascript - 分割键 : value; pairs and exclude whitespace in matches

ruby-on-rails-3 - 将 i18n 字符串与 HAML 中的变量连接起来

eclipse - 将 Haml 和 Sass 与 Eclipse 结合使用

ruby-on-rails - Rails 简单表单检查错误 'null' 对于类型推断来说太大了

css - Devise 不加载自定义 CSS

html - 每页页脚边距都不同

templates - 删除 Mako 模板中的前导空格

c++ - 如何清除包含 C 函数声明的字符串中的注释和中间空格?