php-htmltruncator
php-htmltruncator copied to clipboard
Non-self-closing tags without text get removed
The library removes non-self-closing tags without text, such as an iframe.
For example:
* string: <div class="media-pull-center media-width-full"><div class="embed-responsive embed-responsive-16by9"><iframe src="https://link.brightcove.com/services/player/" frameborder="0" allowfullscreen></iframe></div><div class="content-item__credit pull-right">Credit</div><div class="content-item__caption clearfix">Caption</div></div>
* length: 500
* result: <div class="media-pull-center media-width-full"><div class="content-item__credit pull-right">Credit</div><div class="content-item__caption clearfix">Caption</div></div>
* desired result: <div class="media-pull-center media-width-full"><div class="embed-responsive embed-responsive-16by9"><iframe src="https://link.brightcove.com/services/player/" frameborder="0" allowfullscreen></iframe></div><div class="content-item__credit pull-right">Credit</div><div class="content-item__caption clearfix">Caption</div></div>