简体   繁体   中英

VS code default all html files to Django templates & comments them in a wrong way (if I press ctrl + /)

VS code default all html files to Django templates & comments them in a wrong way (if I press ctrl + /)

ie it comments normal html files by adding {% comment %} & {% endcomment %} instead of the correct html comment < !-- -->

Go to: File -> Preferences -> Settings and add this line to your USER SETTINGS

"files.associations": {
    "*.html": "html"
}

对我来说,它是(Djaneiro 和其他一些 Django)扩展,它使 html 文件默认为 django 模板,因此它导致 HTML 中的注释错误(按 ctrl + / 时)(用 {% comment % 注释它们})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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