node-html-parser icon indicating copy to clipboard operation
node-html-parser copied to clipboard

removeWhitespace + outerHTML don't remove meaningless white-spaces inside start and end tags

Open Zhang-Junzhi opened this issue 1 year ago • 0 comments

For example,

<!DOCTYPE html
><html                     lang="en"
><meta charset="UTF-8"
><title>test</title

><p>test</p

></html>

The extra white-spaces between html and lang="en" and the extra newlines inside tags aren't removed, even if I use removeWhitespace. All regular browser implementations remove these meaningless white-spaces.

Zhang-Junzhi avatar Apr 11 '24 16:04 Zhang-Junzhi