Constructing a basic document, appending custom HTML and viewing the final document HTML.
import mlreportgen.dom.*;doc=Document('doc','html');htmlObj = HTML('<div><a href="https://www.mathworks.com">Mathworks</a></div>');append(doc, htmlObj);close(doc);rptview(doc.OutputPath)
After appending to the document body we get:
<body onload="outline()"> <div><div><p><a href="https://www.mathworks.com"><span>Mathworks</span></a></p></div></div> %Additional tags.
</body></html>
I understand the HTML object has a wrapper element (the div in this case) which is wrapped around the html object. The main problem is the additional p and span tags. These unknown tags make document styling more difficult.
Is there any way to pass through HTML with the append function and no additional modification?
Thanks.
Best Answer