Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] text to web page, adding <br> ?


On Fri, Feb 11, 2005 at 12:03:12PM +1100, Voytek wrote:
> I need to place contents of word files on a web pages;
> I've sorted catdoc/charset to output correct codepage text files,
> 
> catdoc -scp1250 -d8859-2 381.rtf > 381.php
> 
> but, then I need to insert '<br><br>' after every paragraph

No, you need to wrap <p> </p> around every paragraph, and end up 
with nice compliant xhtml. This is the 21st century, after all. ;-)

> is there any tool that will help me here ?

Do a search for 'text html' on search.cpan.org - there's about a 100
perl modules that do different variants on this. HTML::FromText,
HTML::TextToHTML, and Text::Decorator are probably useful places to
start.

Cheers,
Gavin