HTML Comment shortcut returns "{#" and not "<!--

Answered

I am working on an html file and use COMMAND+/ to assign comment.

but this  returns "{#" and not "<!--" which is needed for html.

how can i change this behaviour please?

10 comments
Comment actions Permalink

What does your project look like? Is it a Django project by chance? Also, what file type are your HTML files associated with?

0
Comment actions Permalink

What does your project look like? - It only contains HTML, CSS, JS files as far as i am aware

Is it a Django project by chance? - how can i check this?

Also, what file type are your HTML files associated with? - not quite sure what you mean by this.

 

0
Comment actions Permalink

>how can i check this?

Django project is a Python project with Django facet... But, as you don't know what it is, probably it's not:)

Please attach a screenshot of your HTML file (make sure that the editor tab with file icon is visible - I need to see what file type it is)

0
Comment actions Permalink

Ok... Looks as if it is indeed a Django project (I can clearly see templates root in your project directory). Strange that you don't know what your project looks like and what frameworks are being used there...

Please open your Idea module file (project_name.iml, it should be located either in your project root directory or in .idea folder) and paste its content here

-2
Comment actions Permalink

Sure thing

===================

<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_CONFIGURATION" value="Jinja2" />
<option name="TEMPLATE_FOLDERS">
<list>
<option value="$MODULE_DIR$/templates" />
</list>
</module>
</option>
</component>
0
Comment actions Permalink

I see, thanks:) The problem is that your .HTML is treated as Jinja2 template, and comments are generated accordingly.

Please try setting Template Language to 'None' in Settings | Languages & Frameworks | Python Template Languages - does it help?

3
Comment actions Permalink

Yes - that seems to have done the trick - many thanks

0
Comment actions Permalink

I would expect that html files in template directories use {# #} for setting a comment, while html files in the resource directories are treated as pure static content and would use <!-- -->.for comments

Apparently that is not the case

0
Comment actions Permalink

Please see https://youtrack.jetbrains.com/issue/PY-16084 - this feature will be available in 2017.3

1

Please sign in to leave a comment.