You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each test is valid JavaScript, but the parsing is broken by code that handles non-JavaScript syntax:
Highlighting for mustache templates conflicts with JavaScript blocks. This is fundamentally unfixable; the two languages conflict. If we want to maintain mustache embedding in JavaScript code for some reason, we can make a new syntax for it (simply including JavaScript with a with_prototype). Or, if it's not worth having a separate syntax for, it's probably not worth breaking the JavaScript syntax for.
Highlighting for HTML comments conflicts with JavaScript operators. This could conceivably be patched, because <!-- cannot conflict with real JavaScript at top level. But the implementation seems rather pointless to begin with, because it can't cover all uses of HTML comments (e.g. in strings) without breaking JavaScript and the HTML syntax should handle this anyway using with_prototype.
Highlighting for ancient IE conditional compilation breaks JavaScript comments. This is an ill-advised and archaic practice that has long been abandoned by Microsoft, so it should be safe to just cut it.
Fixing these will help to clear the way for #885 and related issues.
The text was updated successfully, but these errors were encountered:
Thom1729
changed the title
[JavaScript] Cruft: Mustache templating, HTML comments, IE conditional compilation
[JavaScript] Cruft causing incorrect highlighting for standard JavaScript: Mustache templating, HTML comments, IE conditional compilation
Apr 10, 2017
Thom1729
changed the title
[JavaScript] Cruft causing incorrect highlighting for standard JavaScript: Mustache templating, HTML comments, IE conditional compilation
[JavaScript] (PR provided) Cruft causing incorrect highlighting for standard JavaScript: Mustache templating, HTML comments, IE conditional compilation
Apr 11, 2017
The following tests fail:
Each test is valid JavaScript, but the parsing is broken by code that handles non-JavaScript syntax:
with_prototype
). Or, if it's not worth having a separate syntax for, it's probably not worth breaking the JavaScript syntax for.<!--
cannot conflict with real JavaScript at top level. But the implementation seems rather pointless to begin with, because it can't cover all uses of HTML comments (e.g. in strings) without breaking JavaScript and the HTML syntax should handle this anyway usingwith_prototype
.Fixing these will help to clear the way for #885 and related issues.
The text was updated successfully, but these errors were encountered: