#!/usr/bin/env python3.2

import re, sys

assert len(sys.argv) == 2, "usage: minifyhtml HTMLFILE"

with open(sys.argv[1]) as fh:
    print(re.sub(r'([>;]) ([<a-z])', r'\1\2', re.sub(r'[\s\n\r]+', ' ', fh.read())).strip())
