EricJWHuang / EmailReplyParser

A .NET clone of github email_reply_parser
24 stars 13 forks source link

Does this parse html emails? #4

Open shyamal890 opened 5 years ago

PaulDMendoza commented 5 years ago

No, I don't think so. The original project doesn't either.

But SigParser's API for parsing emails can handle HTML emails.

EricJWHuang commented 5 years ago

It does @shyamal890 Sorry for the late response. @PaulDMendoza FYI as well :point_up:

PaulDMendoza commented 5 years ago

@EricJWHuang No, it doesn't support HTML emails. I was able to prove this by calling your Nuget package with an HTML string. See the below example. There also isn't any code in this repo which converts HTML to text so I'm not sure how it would be expected to.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DotNetReplyParser2
{
    class Program
    {
        static void Main(string[] args)
        {

            var parser = new EmailReplyParser.Lib.Parser();
            var reply = parser.ParseReply(@"I get proper rendering as well.
<br/>
<br/>
Sent from a magnificent torch of pixels
<br/>
<div>On Dec 16, 2011, at 12:47 PM, Corey Donohoe &lt;reply@reply.github.com&gt; wrote:
<br/>&gt; Was this caching related or fixed already?  I get proper rendering here.
<br/>&gt; <img src=""https://img.skitch.com/20111216-m9munqjsy112yqap5cjee5wr6c.jpg"" />
<br/>&gt; ---
<br/>&gt; Reply to this email directly or view it on GitHub:
<br/>&gt; https://github.com/github/github/issues/2278#issuecomment-3182418
</div>");

            Console.WriteLine(reply);

        }
    }
}

Outputs this which means the library isn't handling HTML emails.

image

shyamal890 commented 5 years ago

@EricJWHuang Can you please confirm if HTML emails would be supported?