atom / language-html

HTML package for Atom
Other
108 stars 142 forks source link

Adding a script tag kills syntax highlighting #242

Open calebmeyer opened 4 years ago

calebmeyer commented 4 years ago

Prerequisites

Description

When you add a script tag (with type, source, or no attributes at all), all syntax highlighting turns off for the current file. Removing the script tag adds it back in.

Steps to Reproduce

  1. Open a new file
  2. Set the syntax as HTML, either by saving the file as HTML or using the syntax selector
  3. Expand the html snippet (this step may be optional, but it's an easy way to see the lack of highlighting)
  4. Type <script></scrip
  5. Type t

test

Expected behavior:

All syntax is highlighted

Actual behavior:

No syntax is highlighted (all becomes gray, syntax classes disappear from the spans)

Reproduces how often:

100% of the time

Versions

image image

Additional Information

No errors in the console

image
Thwarter commented 4 years ago

Saving then reopening the file fixes the issue most of the time...

josemanuelguzman commented 4 years ago

I have the same issue...

elbowdonkey commented 4 years ago

Seeing the same issue.

After turning off Tree Sitter in Settings > Core > Use Tree Sitter Parsers color highlighting works for HTML.

Leaving the Tree Sitter Parser setting on, but switching to an HTML grammar that doesn't use Tree Sitter also fixes the issue.

So, it's the Tree Sitter parser.

jmanuel1 commented 3 years ago

I had this bug months ago, but I was not able to reproduce it today (July 8, 2021), even in safe mode.