Reputation: 17185
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?
Thanks!!
Upvotes: 18
Views: 29972
Reputation: 164826
StackOverflow uses Markdown to format user text. Check out PageDown for an editor / preview example.
Other options that produce HTML are TinyMCE and CKEditor.
Upvotes: 15