CSS/HTML Parsing Exceptions when rendering Outlook .msg files in GropDocs.Viewer for .NET

Hi Support Team,
We are encountering two fatal parsing errors when attempting to render certain Outlook .msg files. The issues appear to stem from the viewer’s HTML/CSS engine strictly parsing the improperly formatted HTML typically generated by email clients.
Here are the details of the two specific errors we are seeing:

  1. The “CommaToken” Parsing Issue
    The parser fails when reading a font-family declaration that contains encoded HTML quotes ("). It throws the following error:
    “Internal error - Preserved token with type ‘CommaToken’ and content ‘,’ is not permitted in declaration block. Overall content of input Simple block is ‘font-family: “Segoe UI Web (West European)”, “Segoe UI”, -apple-system, BlinkMacSystemFont, Roboto, “Helvetica Neue”, sans-serif; font-size: 16px; color: rgb(0, 0, 0);’.”
  2. The “Invalid Class Name” Issue
    The parser rejects HTML class attributes that start with a number (e.g., class="2"). While this violates standard W3C specifications, it is very common in raw email HTML. The application crashes with this error:
    “Class name ‘2’, which occured on ‘0’ 0-based position in the input class names ‘2’, is invalid: Class name cannot start from the ‘2’ character Parameter name: classNames”

I have attached the screenshots of the errors for your reference. Looking forward to your advice.
Screenshot 2569-07-30 at 18.49.07.png (86.1 KB)

Screenshot 2569-07-30 at 18.49.27.png (61.0 KB)

Best regards,
Prapas

@prapapra

Hi Prapas,

We will fix both these issues by tuning and adjusting our HTML/CSS parser, but we need a sample file, which we can use for reproducing the reported issues.

Thanks and waiting for the file.

With best regards,
Denis Gvardionov