保持表单输入的分页符
在我的 Rails 应用程序中,我想保留在表单中输入的 \n
。 到目前为止我所做的是使用 simple_format()
输出。 但问题是 simple_format 将文本包装在 < 中。 p>< /p> 如果有 \n
。 这对于我的聊天室日志来说是有问题的,因为我不希望每条消息都出现在新段落中。
我该怎么办?
In my Rails app, I want to keep the \n
that are inputted in the forms. What I've done so far is output with simple_format()
. But the problem is that simple_format wraps the text in < p >< /p > if there is a \n
. This is problematic for my chatroom log as I don't want each message to appear in a new paragraph.
What should I do instead?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)