Email raw text to HTML - Mailing list pgsql-www

From Sahil Harpal
Subject Email raw text to HTML
Date
Msg-id CAKi=nnfbM=F9prUxW386Bizkz8Aw+Wv1CFxpQgaZ1ZjecUNM5A@mail.gmail.com
Whole thread Raw
Responses Re: Email raw text to HTML  (Magnus Hagander <magnus@hagander.net>)
List pgsql-www
Hello,
I am curious about how Gmail converts plain text (Raw data) mail into a beautiful interface. Is there any library or something that will help us to transform plain text into HTML? 
I am aiming to represent text (email message body) as it is being displayed in any mailing services like gmail, yahoo or outlook. The motive is the text should be readable. It is not just about enclosing previous replies in the blockquote tag but we can even handle bold, italic, bullets, tables etc.

For example:
image1 => Gmail interface 
image2 => Mailing list view

Is there any method to do this conversion?

I tried replacing '>' to '| ' [image3]. And I think it is better than what is present. It will look better if we change color and background color for quoted text. But for this we actually need something that will help us to convert raw text to good looking HTML same as markdown does. But in case of markdown the syntax is different. For example it uses **text** for bold and gmail uses *text* for bold.

Thanks,
Sahil Harpal

Attachment

pgsql-www by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Should we have a "Testing" topic in the CF app?
Next
From: Magnus Hagander
Date:
Subject: Re: Email raw text to HTML