I need to split html document on two parts. First part, should contain N(30) words, and next one should contain everything else. And the main problem, is to prevent splitting tags (description and body of tags).
<a **<=>** href="text" > text </a>
<a href="text" > **<=>** text </a>
<a href="text" > text </ **<=>** a>
Give me please suggestions (or if you have already written such function, please share your code), how to realize it! Thanks.