erb to haml conversion for text partials导致奇数换行符

时间:2015-02-27 23:34:28

标签: ruby-on-rails ruby haml erb

请查看THIS QUESTION。经过进一步调查,问题不在于HAML转换的问题。

我有一系列.text.erb个文件的邮件程序。作为重构的一部分,我将它们转换为haml。这样做我得到了这些奇怪的换行符......

test.text.erb

Hello <%= @User.name %>,

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras porttitor dui vel justo gravida, at efficitur mauris condimentum. Curabitur lorem tortor, feugiat vel odio a, tristique placerat magna.

test.text.haml

Hello #{@user.name},
\
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras porttitor dui vel justo gravida, at efficitur mauris condimentum. Curabitur lorem tortor, feugiat vel odio a, tristique placerat magna.

使用erb文件,我会得到正常的换行符。当文本到达该区域的边缘时,它将会换行。哈哈,我得到了:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras porttitor d=
ui vel justo gravida, at efficitur mauris condimentum. Curabitur lorem to=
rtor, feugiat vel odio a, tristique placerat magna.

导致=标志出现的原因是什么?

0 个答案:

没有答案