Snippets with indentation in Visual Studio Code
The indentation needs to be inside of the strings, not outside (where it's meaningless), so:
" <meta charset='UTF-8'>",
instead of:
"<meta charset='UTF-8'>",
This works as intended:
"HTML structure": {
"prefix": "html",
"body": [
"<!DOCTYPE html>",
"<html lang='fr'>",
"<head>",
" <meta charset='UTF-8'>",
" <meta name='viewport' content='width=device-width, initial-scale=1.0'>",
" <meta http-equiv='X-UA-Compatible' content='ie=edge'>",
" <title>$1</title>",
"</head>",
"<body>",
" $2",
"</body>",
"</html>"
],
"description": "Base template for html file"
}
I think the more appropriate way is to use \t
instead of space to maintain document indentation even.
"\t<meta charset='UTF-8'>",