This is htmlsplit.rb, a Ruby library to split an HTML document into an array of tags and contents. WWW: http://raa.ruby-lang.org/project/htmlsplit