Email raw text to HTML

From: Sahil Harpal <sahilharpal1234(at)gmail(dot)com>
To: PostgreSQL WWW <pgsql-www(at)postgresql(dot)org>
Subject: Email raw text to HTML
Date: 2022-08-04 09:55:18
Message-ID: CAKi=nnfbM=F9prUxW386Bizkz8Aw+Wv1CFxpQgaZ1ZjecUNM5A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
image1.png image/png 79.0 KB
image/png 63.8 KB
image/png 52.5 KB

Responses

Browse pgsql-www by date

  From Date Subject
Next Message Magnus Hagander 2022-08-04 14:04:12 Re: Email raw text to HTML
Previous Message Daniel Gustafsson 2022-08-04 09:22:45 Re: Should we have a "Testing" topic in the CF app?