I have one textarea
for user to insert html using tinymce
.
And i am using html2pdf
library to print that content in PDF
.
But, sometime user inserts invalid html like this,
<p><span>test</p>
So it cause the error while printing PDF.
So what i want is to check before printing that if HTML is valid or not like this,
if(valid_html)
PRINT_PDF
else
strip_tags(PRINT_PDF); // removing tags from sting
For that i tried this solution also from here. But not working in many cases. I need solution for this to allow users to print pdf.