Sublime Forum

Html Syntax inside of a <script tag...>

#1

Hi everyone, I was wondering if there is a way to have html syntax inside an <script tag…
I have things like:

[code]

[/code]

inside htmls files.
As you can see this is a jquery template (the type attribute). Right now I guess that sublime thinks that everything inside an tag (whatever the type is) is javascript.

So, for instance if I try to comment a block of code with ctrl+/ it will do it as javascript instead of html.

On the other hand I can’t use html snippets.

Thank you very much folks.

0 Likes

#2

After some time i found the solution in an old stackoverflow thread:
stackoverflow.com/questions/5578 … n-textmate

The solution for me was to modify the HTML.tmLanguage instead of:

<string>(?:^\s+)?(&lt;)((?i:script))\b(?!^&gt;]*/&gt;)</string>

i changed to:

<string>(?:^\s+)?(&lt;)((?i:script))\b(?!(^&gt;]*text/x-jquery-tmpl^&gt;]*|^&gt;]*/&gt;))</string>
0 Likes