We could use libtidy to validate the html rendered by jinja for the main and detail pages? See http://countergram.github.io/pytidylib/