简体   繁体   English

Visual Studio Code上的代码段

[英]Snippet on Visual Studio Code

Hi everyone I've a problem making my snippet on VScode. 大家好,我很难在VScode上创建摘要。

Here is the stippet: 这是提示:

"HTML5":{
    "prefix": "html5",
    "body":[
        "<!DOCTYPE html>",
        "<html lang='es'>",
        "\t<head>",
        "\t\t<meta charset='utf-8'>",
        "<meta name='viewport' content='width=device-width, initial-scale=1.0'>",
        "\t\t<title></title>",
        "\t</head>",
        "\t<body>",
        "\t</body>",
        "</html>"
    ],
    "description": "Basic HTML5 document."
}

I'd like to know how can I make string the attributes such the lang='es' , instead I want lang="es" as result . 我想知道如何使lang ='es'这样的属性成为字符串,而不是lang =“ es”作为结果 Some help? 一些帮助? Thanks! 谢谢!

I believe you just need to escape the double quotes with a backslash, like so: \\" . Your snippet would look something like: 我相信您只需要用反斜杠转义双引号即可,例如: \\" 。您的代码段应类似于:

"body":[
    "<!DOCTYPE html>",
    "<html lang=\"es\">",
    ....

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM