I have an html line that includes a table tag. In the table tag can be all kinds of labels (tr / td, etc.).
How to remove a tag from my line while keeping the rest of the html?
Those:
If my line
"<p>testing<table><tr><td>cell 1</td></tr></table> a table</p>"
then I would like the result to be
"<p>testing a table</p>"
Edit:
Providing some additional information: I have no control over html, and p is just an example, it can be any combination of tags or plain text outside (although there will be only one table)
Edit 2:
See above "How to remove a tag from my string while retaining the rest of the html?" This means that if (outside the table) there is an element highlighted in bold or underlined, then this tag should not stop
source share