domtohtml: Changed HTML serialization code to (optionally) pretty print while traversing the tree instead of doing a regexp-based postprocessing.
domtohtml: Changed HTML serialization code to (optionally) pretty print while traversing the tree instead of doing a regexp-based postprocessing.

This approach prevents "false positives", such as HTML tags in string literals in inline scripts, from being indented -- see #173.

Also made the pretty printing a little customizable (see makeHtmlGenerator). Previously the indentation was hardcoded to two spaces and the line endings to CRLF. I took the liberty of changing the latter to LF per default in the hope that the choice of Windows line endings was a bug.

medikoo/jsdom,crealogix/jsdom,isaacs/jsdom,selam/jsdom,Ye-Yong-Chi/jsdom,lcstore/jsdom,mbostock/jsdom,darobin/jsdom,fiftin/jsdom,Ye-Yong-Chi/jsdom,sirbrillig/jsdom,mbostock/jsdom,evanlucas/jsdom,kevinold/jsdom,evdevgit/jsdom,medikoo/jsdom,fiftin/jsdom,dexteryy/jsdom-nogyp,danieljoppi/jsdom,evanlucas/jsdom,sirbrillig/jsdom,papandreou/jsdom,kangax/jsdom,evdevgit/jsdom,kesla/jsdom,darobin/jsdom,susaing/jsdom,mzgol/jsdom,szarouski/jsdom,cpojer/jsdom,sirbrillig/jsdom,nicolashenry/jsdom,kevinold/jsdom,janusnic/jsdom,mbostock/jsdom,Sebmaster/jsdom,kesla/jsdom,AshCoolman/jsdom,evanlucas/jsdom,szarouski/jsdom,robertknight/jsdom,cpojer/jsdom,lcstore/jsdom,janusnic/jsdom,dexteryy/jsdom-nogyp,szarouski/jsdom,danieljoppi/jsdom,susaing/jsdom,kittens/jsdom,zaucy/jsdom,iizukanao/jsdom,evdevgit/jsdom,janusnic/jsdom,fiftin/jsdom,jeffcarp/jsdom,kevinold/jsdom,medikoo/jsdom,susaing/jsdom,jeffcarp/jsdom,beni55/jsdom,danieljoppi/jsdom,Sebmaster/jsdom,godmar/jsdom,Zirro/jsdom,sebmck/jsdom,Joris-van-der-Wel/jsdom,aduyng/jsdom,mzgol/jsdom,robertknight/jsdom,kittens/jsdom,vestineo/jsdom,Joris-van-der-Wel/jsdom,vestineo/jsdom,singlebrook/linkck,jeffcarp/jsdom,godmar/jsdom,nicolashenry/jsdom,aduyng/jsdom,cpojer/jsdom,robertknight/jsdom,crealogix/jsdom,AshCoolman/jsdom,beni55/jsdom,Joris-van-der-Wel/jsdom,vestineo/jsdom,substack/jsdom,mzgol/jsdom,substack/jsdom,kangax/jsdom,beni55/jsdom,sebmck/jsdom,Ye-Yong-Chi/jsdom,snuggs/jsdom,concord-consortium/jsdom,tmpvar/jsdom,darobin/jsdom,brianmcd/cloudbrowser-jsdom,kesla/jsdom,iizukanao/jsdom,kittens/jsdom,concord-consortium/jsdom,snuggs/jsdom,brianmcd/cloudbrowser-jsdom,AshCoolman/jsdom,Zirro/jsdom,lcstore/jsdom,isaacs/jsdom,AVGP/jsdom,zaucy/jsdom,selam/jsdom,Sebmaster/jsdom,selam/jsdom,zaucy/jsdom,papandreou/jsdom,sebmck/jsdom,aduyng/jsdom,tmpvar/jsdom,nicolashenry/jsdom,AVGP/jsdom