HTML writers: Outsourcing of common code to _html_base.py.