Works better, and the html elements get their attributes.
Extra text representing classes is detected and correctly removed. Adding attributes isn't working yet.