Try html-mode in favour of nxhtml-mode, which is bloated and broken.
Have auto-indent-mode do whitespace cleanup.