fix bug: can't strip white spaces before doctype and after html close tag