[html] files.insertFinalNewline affects embedded styles (#179118)

This commit is contained in:
Martin Aeschlimann
2023-04-04 12:55:17 +02:00
committed by GitHub
parent f481836a89
commit 92b87b0fd5
3 changed files with 8 additions and 6 deletions

View File

@@ -85,11 +85,12 @@ suite('HTML Embedded Formatting', () => {
});
test('EndWithNewline', async () => {
const options : FormattingOptions = FormattingOptions.create(2, true);
const options: FormattingOptions = FormattingOptions.create(2, true);
options.insertFinalNewline = true;
await assertFormat('<html><body><p>Hello</p></body></html>', '<html>\n\n<body>\n <p>Hello</p>\n</body>\n\n</html>\n', {}, options);
await assertFormat('<html>|<body><p>Hello</p></body>|</html>', '<html><body>\n <p>Hello</p>\n</body></html>', {}, options);
await assertFormat('<html>|<body><p>Hello</p></body></html>|', '<html><body>\n <p>Hello</p>\n</body>\n\n</html>\n', {}, options);
await assertFormat('<html><head><script>\nvar x=1;\n</script></head></html>', '<html>\n\n<head>\n <script>\n var x = 1;\n </script>\n</head>\n\n</html>\n', {}, options);
});