Re: Non-trivial task of converting text to HTML

From: Date: Thu, 08 Dec 2005 15:47:06 +0000
Subject: Re: Non-trivial task of converting text to HTML
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-227147@lists.php.net to get a copy of this message
Hi Roman, Check out this: http://www.michelf.com/projects/php-markdown/ Would this help you? Cheers, David Roman Ivanov wrote: > Task: > Create a script that converts text into HTML with paragraphs. > > Problem: > Input text could use the book notation, as well as the web notation, > plus it can contain HTML. > > == > <h1>This is a title</h1> > > This is a Book paragraph. > This is another book paragraph. > This is yet another book paragraph, but it's not indented with spaces, > because user wrote it in OpenOffice. > == > > == > This is a web paragraph. > > This is another web paragraph. > > This is yet another web paragraph, which is indented with spaces for > some unknown reason. > == > > Output text should be correctly formatted without using lots of br's and > &nbsp;'s. Doing so manually is not a problem, I would just use <p> for > web paragraphs, and <p class="book"> for book paragraphs. However, > formatting such text with a scrip is very difficult. Does anyone knows a > good exaple of such script? > -- David Grant http://www.grant.org.uk/

« previous php.general (#227147) next »