-
Notifications
You must be signed in to change notification settings - Fork 236
JavaScript syntax highlighting breaks then spreads when using innerHTML = `` #676
Description
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: https://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: https://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
Javascript syntax highlighting breaks by using back ticks with innerHTML which then spreads around the file if edited.
Steps to Reproduce
- Open atom and make a new file (You don't need to save it, but if you do save a
.jsfile) - Set the syntax to JavaScript if not already set
- Paste in this text
class Testing {
test(ele) {
this.testingAgain(ele);
}
testingAgain(ele) {
// ele.innerHTML = ``;
}
}- First issue: Un-comment line 6. Notice how the syntax highlighting doesn't show up
- 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:

Video of the syntax highlighting issue spreading though the file:

(Sorry for the low quality)