Re: Non-trivial task of converting text to HTML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Maybe I'm missing some requirement, but what if you just used HTML "<pre>" tags.  You can still use other HTML for formatting within the <pre> tags but it'll pay attention to carriage returns/line feeds and spaces without having to use <br>s

For example, if you did the following... is it what you need or what's wrong with it still?

<pre>
<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.
==
</pre>

= = = Original message = = =

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?


___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux