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中是否有类似的功能或插件?