Sublime Forum

Sublime syntax highlighter issue

#1

I opened my sublime and found out a bug.

BUG
The syntax highlihligher work in a page but breaks when ever it finds a script tag or a style tag.

So say am writing a html page and i want to embed a JS into it i don’t get the inteli-sense suggestions. Everthing from the end of the script opening tag turns green. or I have a style script at the top of my page, every thing from the end of the opening tag of the style tag to the end of the page shows as green highlight.

I tried wiping, uninstalling, reinstalling, deleting from Sublime app-data folder on windows 8, but nothing worked. Please help me any one. This is my best IDE. Image here. https://i.imgur.com/Nc7jSa8.png

By the way I tried using Atom but it was too slow, and the short-cut keys don’t work and i don’t have the time to start learning them all over again.

#window8SyntaxHighlighterIssue
#SyntaxHighlighterIssue

0 Likes

#2

It would help if you could post an example (in text form) of a complete file that illustrates the issue. A cut-down excerpt would be fine as long as someone could copy-paste it into Sublime and see the undesired behavior.

It’s important to note here that you are using the PHP syntax, not HTML. The PHP syntax should gracefully incorporate HTML, just as the HTML syntax should gracefully incorporate JavaScript, but there could be an unintended difference.

Without trying the file myself, all I can see is that there seems to be an issue with the highlighting of the CSS string on line 80. Are you using the built-in CSS package or a third-party one such as the popular CSS3?

3 Likes

#4

But then the php color syntax will not work

0 Likes

#5

It sounds like the NgxHTML syntax has a bug that was causing your original issue. I would wager that the NgxHTML is configured to supplant the built-in HTML syntax, which would cause the PHP syntax to rely on NgxHTML. This would explain why you would see the bug when using the PHP syntax.

Try uninstalling whatever package is providing the NgxHTML syntax.

3 Likes

#7

Please how do i uninstall NgxHTML??

0 Likes

#8

Open the command palette (Ctrl+Shift+P) and type remove package then select the package NgxHTML.

0 Likes

#9

Thanks I’d try it now

0 Likes

#10

And we are back to normal. Thank you everyone for you help. I can uninstall other IDE now. and continue with my fav.

0 Likes