apostrophecms / sanitize-html

Clean up user-submitted HTML, preserving whitelisted elements and whitelisted attributes on a per-element basis. Built on htmlparser2 for speed and tolerance
MIT License
3.69k stars 351 forks source link

Detecting nested media objects inside exclusiveFilter #490

Closed wiscat closed 2 years ago

wiscat commented 2 years ago

Hi,

Similar to this issue #313 , but dealing with nested images, is there any options to detect nested media objects, so to correctly sanitize empty <p> tags using exclusiveFilter and !frame.text.trim()?

<p>
   <a>
      <img />
   </a>
</p>
stale[bot] commented 2 years ago

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.

abea commented 2 years ago

There is the mediaChildren property as documented in the README. That might only apply to immediate children, so I'm not sure if it works for this. It sounds like something we'd be happy to review a PR for.

stale[bot] commented 2 years ago

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.