Hello,
I am using Aspose.HTML (v. 23.3) for .NET (.NET Framework 4.5.2).
If I try to import an HTML file that contains text/x-template script, the output content is not valid (for example, divoldivdivdivdivadiv 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("error1.html", htmlConfig); doc.Save("output.html");
This is error1.html content:
<!DOCTYPE html> <html> <head> <script type="text/x-template" title="share-content-popup"> <form action="#" method="post" class="aui share-content-popup"> <div class="field-group"> <div class="autocomplete-user-target"> <input class="text autocomplete-sharepage" id="users" data-max="10" data-dropdown-target=".autocomplete-user-target" data-none-message="No matching user or email found" placeholder="User name or email"/> </div> <ol class="recipients"> </ol> </div> <div class="field-group"> <textarea class="textarea" id="note" placeholder="Add an optional note"/> </div> <div class="field-group button-panel"> <div class="progress-messages-icon"></div> <div class="progress-messages"> </div> <input class="button submit" type="submit" value="Share" disabled/> <a class="close-dialog" href="#">Cancel</a> </div> </form> </script> </head> <body> </body> </html>
This is the output file content(Expected same as input):
<!DOCTYPE html><html><head> <script title="share-content-popup"> <form action="#" method="post" class="aui share-content-popup"> <div class="field-group"> <div class="autocomplete-user-target"> <input class="text autocomplete-sharepage" id="users" data-max="10" data-dropdown-target=".autocomplete-user-target" data-none-message="No matching user or email found" placeholder="User name or email"/> </div> <ol class="recipients"> </divol> </divoldiv> <div class="field-group"> <textarea class="textarea" id="note" placeholder="Add an optional note"/> </divoldivdiv> <div class="field-group button-panel"> <div class="progress-messages-icon"></divoldivdivdiv> <div class="progress-messages"> </divoldivdivdivdiv> <input class="button submit" type="submit" value="Share" disabled/> <a class="close-dialog" href="#">Cancel</divoldivdivdivdiva> </divoldivdivdivdivadiv> </divoldivdivdivdivadivform> </script> </head> <body> </body></html>
Thanks for your help.