Closed BlackAsLight closed 10 months ago
Give this HTML which is the default format my IDE gives the html document
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <script type="module" src="/js/main.min.js"></script> </head> <body> <h1>Hello World</h1> </body> </html>
It gets a weird format when stringifying the file as '<!DOCTYPE html>\n' + doc.documentElement!.outerHTML
'<!DOCTYPE html>\n' + doc.documentElement!.outerHTML
<!DOCTYPE html> <html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <script type="module" src="/js/main.min.js"></script> </head> <body> <h1>Hello World</h1> </body></html>
It works fine if there was no extra spacing anywhere, like if the file was minified before being parsed.
It would be much more appreciated if whatever output it did give was consistent, where the input format was irrelevant to the output format.
This is due to deno-dom using a standards-compliant parser among other things. You can view the same output when you run it through a browser
That's unfortunate, but I guess its not a bug...
Give this HTML which is the default format my IDE gives the html document
It gets a weird format when stringifying the file as
'<!DOCTYPE html>\n' + doc.documentElement!.outerHTML
It works fine if there was no extra spacing anywhere, like if the file was minified before being parsed.
It would be much more appreciated if whatever output it did give was consistent, where the input format was irrelevant to the output format.