It looks like you need hide-endtags: yes in config :
Type: Boolean Default: no Example: y/n, yes/no, t/f, true/false, 1/0
This option indicates whether Tidy should omit additional end tags when creating fairly printed markup. This parameter is ignored if you output in XML.
According to the specification associated here , the initial html and body tags are also optional, and my Tidy also removes them, which should not be a problem, the cfg file:
hide-endtags: yes // Don't add optional end tags. Also hides optional start tags like HTML and BODY. tidy-mark: no // Don't add generator meta tag.
However, it still closes the div . This alternative offered here works as intended.
source share