fix issue with open tags being consumed with no closing tag. Add option to keep tags