mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
html: observe insertFinalNewline (#152446)
This commit is contained in:
committed by
GitHub
parent
223ea2c4b5
commit
630809a1ea
@@ -85,16 +85,12 @@ suite('HTML Embedded Formatting', () => {
|
||||
});
|
||||
|
||||
test('EndWithNewline', async () => {
|
||||
const options = {
|
||||
html: {
|
||||
format: {
|
||||
endWithNewline: 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><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);
|
||||
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><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);
|
||||
});
|
||||
|
||||
test('Inside script', async () => {
|
||||
|
||||
Reference in New Issue
Block a user