helper function to strip whitespace in html to make tests easier
fix for text between tags
fixed most of the rendering issues
refactored handler + tests