Closed gcjbr closed 4 years ago
Maybe you can accomplish this in two passes...in first pass you replace the div tag with matching class with some other tag you invent. You add this new pseudo class to allowed tags.
In second pass you config this pseudo tag as nonTextTag and do not include it in allowed tags.
I have not tried this myself but it may work :)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This should be possible with exclusiveFilter
https://github.com/apostrophecms/sanitize-html/#filters
Let's say I have a big chunk of HTML and I only to remove all divs with the class 'test' from that text. I don't want to keep the div or its content, so I think allowedClasses wouldn't help. Instead, I need to remove it totally.
Is there a way I cn do this with sanitize-html or I'll have to rely on regex?