views:

290

answers:

6

What text to HTML converter for PHP would you recommend?

One of the examples would be Markdown, which is used here at SO. User just types some text into the text-box with some natural formatting: enters at the end of line, empty line at the end of paragraph, asterisk delimited bold text, etc. And this syntax is converted to HTML tags.

The simplicity is the main feature we are looking for, there does not need to be a lot of possibilities but those basic that are there should be very intuitive (automatic URL conversion to link, emoticons, paragraphs).

A big plus would be if there is WYSIWYG editor for it. Half-wysiwig just like here at SO would be even better.

Extra points would be if it would fit with Zend Framework well.

+1  A: 

I will stick with my original idea of adopting Texy.

None of the products mentioned here actually beats it. I had problem with Texys syntax but it seems to be quite standard and is present in other products too.

It is very lightweith, supports very natural syntax and has great "half" wysiwyg editor Texyla (wiki is in Czech only)

Josef Sábl
+4  A: 

Take your pick at http://en.wikipedia.org/wiki/Lightweight_markup_language.

As for Markdown, there's one PHP parser that I've been using called PHP Markdown, and I especially like the Extra extension.

I have actually taken a stab at extending it with my own (undocumented) features. It's available at GitHub (remember that it's the extra branch I've fixed, not the masteR), if you're interested. I've intended on making it a 'proper fork' for a while, but that's another, largely offtopic, story.

Henrik Paul
Very useful link, thanks a lot!
Josef Sábl
+1 for Markdown Extra. Very useful, although I’ve had to patch it quite heavily to fit my purposes.
Konrad Rudolph
+1  A: 

There's always textile. It is widely implemented, and has a few basic similarities with Markdown. However, I have never seen a WYSIWYG editor for Textile.

The Wicked Flea
+3  A: 

The Zend Framework has a WYSIWYG editor bundled with it's Dojo integration.

http://framework.zend.com/manual/en/zend.dojo.form.html#zend.dojo.form.elements.editor

... Bring on the extra points!

Kieran Hall
+1 I was tracking this question for this. Thanks.
karim79
Oh, I meant extra points for the product, not for the one who suggests it :-) And you actually did not suggested the main thing the question is about.
Josef Sábl
Yeah, I was only joking. Seriously though, the Dojo editor within the Zend Framework sounds like a good solution for your requirements.
Kieran Hall
+1  A: 

You might find upflow useful.

troelskn
After testing this I am impressed. Though, you should have a link always at the bottom of the container itself for appending a new "container"/paragraph, so you don't have to insert a paragraph into the previous to get a new block. ;-)
The Wicked Flea
I guess that would be helpful. I'll try adding it in. Thanks for your suggestion.
troelskn
+1  A: 

If you want WYSIWYG, I'm a big fan of FCKeditor. It converts user input to HTML before submitting the form, not after, but has a nice PHP library for using it, and a PHP connector for handling file uploading/browsing (along with several other languages).

If you want something that can be read as plain-text but output as HTML, I vote for Markdown.

James Socol