Html element inside comment triggers an invalid output file

Hello,
I am using Aspose.HTML (v. 23.9) for .NET (.NET Framework 4.6.2).
If I try to import an HTML file that contains html element inside comment inside string, the output content is not valid (for example, aaaaaa tag).

This is an example code:

    //load license
    Aspose.Html.License htmlLicense = new Aspose.Html.License();
    htmlLicense.SetLicense("Aspose.Total.lic");

    //import file config
    Aspose.Html.Configuration htmlConfig = new Aspose.Html.Configuration();
    htmlConfig.Security |= Sandbox.Scripts | Sandbox.Images;

    var doc = new HTMLDocument("error2.html", htmlConfig);
    if(doc.Body == null)
    {
        Console.WriteLine("HTMLDocument Body is null");
    }

    doc.Save("output2.html");

This is error2.html content:

<!DOCTYPE html>

<html>

  <head>

    <script type="text/javascript" language="javascript">

      <!--

      var url = {

        a: "<a href="{1}" target="_blank">Cisco Business Class Email</a>",

        b: "<a href="http://java.sun.com/webapps/getjava/BrowserRedirect" target=_blank>Java&trade;</a>",

        c: "<a href='http://java.sun.com/webapps/getjava/BrowserRedirect' target=_blank>Java&trade;</a>",

      };

      -->

    </script>

  </head>

  <body></body>

</html>

This is the output file content(Expected same as input):

<!DOCTYPE html><html><head>

    <script type="text/javascript" language="javascript">

      <!--

      var url = {

        a: "<a href="{1}" target="_blank">Cisco Business Class Email</aa>",

        b: "<a href="http://java.sun.com/webapps/getjava/BrowserRedirect" target=_blank>Java&trade;</aaaa>",

        c: "<a href='http://java.sun.com/webapps/getjava/BrowserRedirect' target=_blank>Java&trade;</aaaaaa>",

      };

      -->

    </script>

  </head>

  <body>

</body></html>

Thanks for your help.

@ork

Aspose.HTML no longer support .NET Framework 4.x or lower versions. It only works with .NET Core now. This could also be the reason of not getting correct or desired results. Can you please try in .NET Core environment and let us know if issue still persists?

As mention on this page -
https://products.aspose.com/html/net/

Aspose support .NET Standard and .NET Framework, we upgrade our product to 4.6.2 so we can use .NET Standard.

@ork

Yes, sorry for the confusion. You are right and we were able to notice the issue in our environment as well.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): HTMLNET-4940

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as HTMLNET-4940) have been fixed in this update. This message was posted using Bugs notification tool by avpavlysh