如何创建像*这样的富文本输入框字段?

时间:2021-12-31 08:41:57

I am working on a site that depends on user generated content, and it would be very nice to also have a way to let the users enter rich text.

我正在开发一个依赖于用户生成内容的网站,如果能让用户输入富文本,那将是非常好的。

How do they accomplish the rich text like they do on this site to post questions?

他们如何像在本网站上一样完成富文本发布问题?

I understand that I can make arbitrary signs above the text area and when something is highlighted and one of the control buttons is pressed, make some jQuery call to see what is highlighted, and wrap that in some html tags like for bold text for example...and then just add the text into my database with the HTML. Is that how these kinds of rich-text things are done?

我知道我可以在文本区域上方创建任意符号,当某些内容突出显示并按下其中一个控制按钮时,进行一些jQuery调用以查看突出显示的内容,并将其包含在某些html标记中,例如粗体文本。 ..然后只需使用HTML将文本添加到我的数据库中。是这样的富文本事情是怎么做的?

Thanks!!

谢谢!!

2 个解决方案

#1


13  

* uses Markdown to format user text. Check out PageDown for an editor / preview example.

*使用Markdown格式化用户文本。查看PageDown以获取编辑器/预览示例。

Other options that produce HTML are TinyMCE and CKEditor.

产生HTML的其他选项是TinyMCE和CKEditor。

#2


3  

Check out TinyMCE. It's a great rich text input library.

查看TinyMCE。这是一个很棒的富文本输入库。

http://www.tinymce.com/

http://www.tinymce.com/

#1


13  

* uses Markdown to format user text. Check out PageDown for an editor / preview example.

*使用Markdown格式化用户文本。查看PageDown以获取编辑器/预览示例。

Other options that produce HTML are TinyMCE and CKEditor.

产生HTML的其他选项是TinyMCE和CKEditor。

#2


3  

Check out TinyMCE. It's a great rich text input library.

查看TinyMCE。这是一个很棒的富文本输入库。

http://www.tinymce.com/

http://www.tinymce.com/