If you accept user submitted content containing HTML whats the safest way to generate auto excerpt with valid HTML?
<p>If you are accepting user submitted content which contains HTML how would you generate an auto excerpt (using PHP) but keep the HTML valid? </p>

<p>If you choose the first 200 characters for example you may miss a closing tag, and counting tags isn't very straight forward. </p>

<p>I have seen a few libraries but they are massive as they deal with a multitude of things. I only need it to generate the auto excerpts.</p>
