Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

JavaScript syntax highlighting breaks then spreads when using innerHTML = `` #676

@MrSimmmons

Description

@MrSimmmons

Prerequisites

Description

Javascript syntax highlighting breaks by using back ticks with innerHTML which then spreads around the file if edited.

Steps to Reproduce

  1. Open atom and make a new file (You don't need to save it, but if you do save a .js file)
  2. Set the syntax to JavaScript if not already set
  3. Paste in this text
class Testing {
	test(ele) {
		this.testingAgain(ele);
	}
	testingAgain(ele) {
		// ele.innerHTML = ``;
	}
}
  1. First issue: Un-comment line 6. Notice how the syntax highlighting doesn't show up
  2. Second issue Cut all text from the file, then re paste it. Notice how none of the syntax highlighting is working.

Expected behavior:

All syntax highlight should work properly.

Actual behavior:

ele.innerHTML = ``;

Seems to break the syntax highlighting of its own line, but then if you try to edit lines around it, the broken syntax highlighting seems to spread through the rest of the file.
If you open a JS file that already has this line in it, depending on the size of the file will depend on how many lines don't get the syntax highlighting. Its really quite weird.

Reproduces how often:
Every time

Versions

macOS: 10.14.6

Atom: 1.48.0
Electron: 5.0.13
Chrome: 73.0.3683.121
Node: 12.0.0

Additional Information

Video of the syntax highlighting breaking:
issue1

Video of the syntax highlighting issue spreading though the file:
issue2

(Sorry for the low quality)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions