Sublime Forum

<!-- Commenting Bug -->

#1

Hello,

Noticed today that sublime has an issue if more then two hyphens being used in an HTML comment. If the comment reads:

(Notice the three hyphens, instead of two) Sublime comments out everything underneath the comment. Sure, it’s not proper syntax but try telling your Senior Developer that he needs to learn how to properly comment. :laughing:

I’ve been using sublime for a little over a year now, it’s nothing short of awesome. Just thought I would contribute to its badassery.

0 Likes

#2

I found the following section in HTML.tmLanguage and deleted ‘–’ leaving a blank tag:

<array> <dict> <key>match</key> <string>--</string> <key>name</key> <string>invalid.illegal.bad-comments-or-CDATA.html</string> </dict> <dict> <key>include</key> <string>#embedded-code</string> </dict> </array>
This fixed it. (It’s the closing —> that seems to cause the problem.)

0 Likes

#3

Thanks @agibsonsw! I write in Markdown, which uses the HTML.tmLanguage for comments, and this scope cast en- and em- dashes as invalid. (E.g., <!-- And then something – or other. -->)

That said, won’t this kind of tinkering get replaced by the next Sublime update? In addition, if there’s an issue with the syntax, shouldn’t it be fixed— permanently? (These questions are addressed to the universe in general, not Andy in particular.)

0 Likes

#4

Universe here. I think default packages should be handled similar to how Vintage is handled, especially since they’re just old textmate bundles essentially. Just keep the bundles in github repos so people can submit fixes. Though, Jon might want to have a couple competent moderates so he doesn’t have to review every pull request. But this has already been discussed before in another topic, so I digress…

0 Likes

#5

I seem to recall (vaguely) that —> was considered “wrong”(?). Nevertheless, it shouldn’t continue to comment out following text.

To digress a little further :smile: I suppose part of the problem with maintaining repos might be that people end up submitting *requests *rather than fixes.

0 Likes

#6

Dear Universe,

I’m aware that the subject has been raised before. I just thought it might be a good idea to hijack this thread to stir the pot (and mix some metaphors).

Alex

P.S. @agibsonsw raises a valid point. If (and it’s a big “if”) maintainers can be found, there might be a half-way house of sorts: set up semi-official repos where people can submit fixes (as well as requests – with the understanding that the work is done by nice volunteers). Users can then use the official (old but tested) syntaxes or opt-in to the semi-official (new but untested) ones. It seems to me that various users are already doing this, except for the coordinating part. (Which is why the “if” is a big one.)

P.P.S. I’m half-way through chapter 2.3 of the book Pro Git, which is indicative of my understanding of these matters :unamused:

0 Likes