简体   繁体   English

如何格式化文本区域中的文本

[英]How to format text in a textarea

I am adding some text by default to a textarea 我默认将一些文本添加到文本区域

%textarea.email_copy
    Hi <awesome friend>,

    I am using this site called XXXX, and you should check it out. It is for smart and thoughtful people to share about their experiences and ideas around topics they care about, and I think you are perfect for it.

    I generated a special invite for you:

    http://some_link

    <%= current_user.getFirstName() %>

However, when I look at the loaded page I see this 但是,当我查看加载的页面时,我看到了

在此处输入图片说明

How can I add paragraphings or spacings between the paragraphs? 如何添加段落或段落之间的间距?

Check here: http://cheat.errtheblog.com/s/haml/ 在这里检查: http : //cheat.errtheblog.com/s/haml/

~ - Ruby expression preserving whitespace, e.g. %pre~ @content.body
  Works just like =, but calls the find_and_preserve helper to keep
  line breaks intact in the output.

Hope that helps. 希望能有所帮助。

A textarea cannot contain markup. 一个文本区域不能包含标记。 If you want only presentation and no input, a div should do fine. 如果只想演示而不输入,则div应该可以。 If you want both presentation and input, you should look into a RTE. 如果您既要演示又要输入,则应研究RTE。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM