0

我有以下代码,并且不想在我只想让它保持原样时将代码缩进到同一行?

我必须缩进到:

.content.first
Thank you for taking our Survey, hope you had fun!!!
<!-- Begin MailChimp Signup Form -->
<link href="http://cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
<div id="mc_embed_signup" style="text-align:center">
<form onsubmit="_kmq.push(['record', 'sign up for our newsletter'])" action="http://socialcrunch.us5.list-manage.com/subscribe/post?u=755f44e55d468b9568a7ec9de&amp;id=7f27e118c4" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank">
%label{:style=>"text-align:center"}
  %br
  Like spandex wearing gym freaks, SocialCrunch is in training.
  %br
  %br
  You have been one of the first people to take part in a test which will form the basis of our website.
  %br
  %br
  Input your email below to learn more about SocialCrunch and our launch later this summer!
  %br
  %br
  Thank you for taking part, we hope you had fun.
<input style="margin-left: 21%;text-align:center" type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
<div class="clear"><input style="margin-left:33%" type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
</form>
</div>

我可以通过一些会忽略我的缩进并且不会抱怨的过滤器来运行它吗?

4

1 回答 1

1

HAML 语法对缩进敏感,并且没有“过滤器”会忽略您的缩进。HAML 使用缩进将您的代码正确地转换为相应的 HTML 代码块。

如果您厌倦了手动缩进 haml 代码并使用 emacs 作为编辑器,那么您可以按照此处的说明进行操作

http://emacswiki.org/emacs/HamlMode

并永久解决您的问题

于 2012-05-10T02:09:12.153 回答