And it’s open source. This file does all the parsing magic to get clean html.
https://github.com/kdzwinel/SnappySnippet/blob/master/js/too...