in reply to Clipping text in the middle of an open HTML tag

I think you need Perl solution. First you create list of tags that needs closing tag. Second you don't clip until current open tag is closed or you may clip text and close tag by yourself. Also there is situation when you need to close more than one tags (for example li+ul).

  • Comment on Re: Clipping text in the middle of an open HTML tag