ametaireau/pelican — pull request #382 by mankyd (2012-06-21 00:07:41+00:00)
Title: New, More Thorough HTMLParser

Included is a new HTMLParser class that more closely mimics HTML style and also uses python's builtin HTMLParser class rather than relying on regexes.

Rather than parsing for metadata in HTML comments, it pulls metadata out of the ```meta``` tag. It also pulls the title out of the ```title``` tag. A summary can either be provided by using a ```summary``` meta tag, or by putting in an html comment into the ```body``` of the page where everything above the comment will become the summary. This last feature I gladly leave open for discussion - it is somewhat fragile, but I have seen it used in other places and should capture the intent of a summary.

I also converted the utils.open function to a proper context manager, as it would silence some errors when __exit__ could not be found.