Pakman
Pakman

Reputation: 2210

Intellij IDEA using the wrong comment style

I'm using IDEA 12.1.4, and when I try to insert a line/block comment into an HTML file (*.html), it inserts a jinja2 style comment.

E.g.

<div class="form-group">

becomes...

{# <div class="form-group"> #}

I tried manually setting the Template Data Language to HTML, and jinja files should only be recognized when they have an extension of .jinja. Is there some other setting I'm missing?

Upvotes: 13

Views: 2874

Answers (2)

Sibirsky
Sibirsky

Reputation: 156

Go here to change template language settings:

File -> Settings -> Project Settings -> Python Template Languages -> Template Language -> %set_appropriate%.

Upvotes: 12

Pakman
Pakman

Reputation: 2210

I think the problem occurred because my project was configured as Flask Project. That added the following configuration to my Project.iml file:

<component name="TemplatesService">
    <option name="TEMPLATE_CONFIGURATION" value="Jinja2" />
    <option name="TEMPLATE_FOLDERS">
        <list>
            <option value="$MODULE_DIR$/project/app/assets/partials" />
        </list>
    </option>
</component>

When I manually deleted this section and closed/reopened the project, I was able to insert HTML comments.

Upvotes: 2

Related Questions