An immense thanks to Ger Hobbelt who had already done this in his github.com/GerHobbelt/htmltidy fork. The two sources have diverges so was not a simple cut an paste. But again thanks Ger for this.