We are trying to create a word document with phpWord. The word file contains html and we are saving the html with tinyeditor (tinyMCE) to db. From an api call, it returns html that is from tinyMCE and we are trying to add it into our phpword file.
We first tested it out with simple html such as p, h1, div. Just simple html and trying to use addHTML() method to add the html elements into docx file but when we try to add tinyMCE content (which happens to be html as well) with addHTML() method, it shows error saying that there are unreadable content inside the file.
We tried echoing out the html content from tinyMCE and it is working. From inspect, we found that there are a lot of classes and lang attribute from span tag. That could potentially be the reason why it is not working but let us know.
Is there any solution that could eliminate this issue so that we can add the html from tinyMCE?