Rails 中的其他替代文本助手
我从各种来源获得的文本输入不是 HTML,而是简单的文本。我尝试使用 Redcloth 将其与 HTML 标签相匹配,以便它可以很好地集成到我的网站中,但它没有获得项目符号点或段落...我检查了一下,发现了一些内置的文本帮助程序,但这些也没有'不做这项工作。
http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper。 html
文本看起来基本上是这样的,
Some text
Some more text
-Maybe some point
-Another one
我想用标签来获得它:
<p>Some text</p>
<ul>whatever</ul>
否则它最终看起来就像一个长的连续段落。
有什么建议吗?
I have text input I get from a variety of sources which is not HTML but is simple text. I've tried using Redcloth to fit this with HTML tags to that it integrates nicely into my site, but it doesn't get bullet points or paragraphs... I checked around an found some text helpers built in, but those also didn't do the job.
http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html
The text looks basically like this
Some text
Some more text
-Maybe some point
-Another one
I'd like to get that with tags:
<p>Some text</p>
<ul>whatever</ul>
Other wise it just ends up looking like one long run-on paragraph.
Any recommendations?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我安装了 BlueCloth 并使用了 Markdown 助手,看起来工作正常。现在我只需要弄清楚如何将它与 in_place_editor 一起使用;-(
I installed BlueCloth and used the Markdown helper, that seemed to work ok. Now I just have to figure out how to use it with the in_place_editor ;-(