首页 > 解决方案 > Commenting html/django template lines in Visual Studio 2017

问题描述

I write a Django website in Visual Studio - but often instead of {# comment #} style I would prefer <!-- comment -->. Problem is, Visual Studio doesn't allow me just to change commenting style. For example, after commenting (Ctrl + K + C) I have this:

    {#<style>
        body { height: 100%; }
        html { height: 100%; }
    </style>#}

and I want to have this:

<!--
<style>
    body { height: 100%; }
    html { height: 100%; }
</style>
-->

That's really frustrating for me - could I get from you any tips how to change it?

标签: htmldjangovisual-studiovisual-studio-2017

解决方案


可能有一个可用于 VS 的插件可以解决这个问题,但是,我认为它本身并不支持块与行注释。但是,在 Visual Studio Code 中,如果您愿意在 VS Code 中进行编辑,则在“编辑”菜单上有单独的块注释和行注释选项,它们的行为有时会有所不同。


推荐阅读