An extremely crude way of closing html elements given a string of html