在Rails中自动添加段落

时间:2014-07-19 23:40:05

标签: ruby-on-rails ruby

WordPress有一个函数wpautop,它会自动将<p>个标记包装在任何输入字符串周围。

例如,用户输入:

This is a paragraph.

I start another paragraph here. I didn't put in paragraph tags.

You'll have to figure it out, WordPress.

传递wpautop后,输出字符串为

<p>This is a paragraph.</p>

<p>I start another paragraph here. I didn't put in paragraph tags.</p>

<p>You'll have to figure it out, WordPress.</p>

Ruby on Rails中是否有类似的功能或插件?

0 个答案:

没有答案