views:

183

answers:

2

I am developing a site and i would like some simple markup. I would need to keep the users newlines (easy enough replace \n with
or use pre), a way to allow links and perhaps bold.

Would it be best to use a markup or to use RTF? i was thinking maybe i want special characters like :username: to create a link to a user or maybe :icon-username: to display a link and the avatar of the user. Maybe other things like that.

Is there a good markup lib i can use or should i find something that allows the user to write in RTF and run a pass before displaying it to output links/new icons and etc?

What libs do you guys like and think i should use?

+1  A: 

My personal preference is markdown/textile, and perhaps something like the open source WMD editor I am using to type in this message.

Sam Saffron
+1  A: 

I am not sure having the users write RTF is a good choice. How many people are comfortable with the syntax?

An HTML/XHTML would be much better. Plus you'd have the choice to use one of the dozens of browser 'editor' components out there for WYSIWYG editing.

Use whatever syntax you want, but include an icon for adding items to the editor. E.g. There can be a 'username' icon, where clicking it would add ':username:' to the editor. Similar to Stack Overflow's editor toolbar.

If you need RTF in the future, HTML/XHTML can be converted to RTF using third-party libraries. I've used XHTML in that capacity before and it actually worked out well. The hardest part was parsing the CSS ( not hard at all ). The XHTML was taken care of with a standard XML Parser.

kervin