Apply zlul's enhacements for html.sh