Sublime Forum

Bug with commenting <script> tags

#1

I haven’t confirmed that this isn’t some plugin causing the bug, but when I comment the following line

<script src="//code.jquery.com/jquery.js"></script>
Using ctrl+/, I get this

// <script src="//code.jquery.com/jquery.js"></script>
Instead of this

<!-- <script src="//code.jquery.com/jquery.js"></script> -->
0 Likes

#2

A very interesting find. Somehow I have never run into this! However, you’re correct – it’s happening to me as well, and I don’t have hardly any plugins installed (maybe 2, or 3)

I tend to do this, which is probably why I never ran into this issue.

<!-- This is not needed bc of x, y, and z
<script src="/some/file/name.js"></script>
-->

Also, pressing ctrl+/ multiple times will eventually comment the line out properly, but it then leaves stray slashes that have to be manually removed it you ever wish to uncomment that line.

// <script src="/some/file/name.js"></script> ctrl+/ x1
<!-- // <script src="/some/file/name.js"></script> --> ctrl+/ x2
// <script src="/some/file/name.js"></script> ctrl+/ x3
<!-- // <script src="/some/file/name.js"></script> --> ctrl+/ x4
// <script src="/some/file/name.js"></script> ctrl+/ x5
...
0 Likes

#3

Any update on this one?

Driving me crazy.

0 Likes

#4

This is still a valid bug.
The toggle_comment function is being triggered, but the comment is inappropriate.

0 Likes

#5

This bug is also mentioned here:
github.com/SublimeText/Issues/i … ?source=cc

0 Likes