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™</a>", c: "<a href='http://java.sun.com/webapps/getjava/BrowserRedirect' target=_blank>Java™</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™</aaaa>", c: "<a href='http://java.sun.com/webapps/getjava/BrowserRedirect' target=_blank>Java™</aaaaaa>", }; --> </script> </head> <body> </body></html>
Thanks for your help.