-
Notifications
You must be signed in to change notification settings - Fork 236
Highlight unescaped multiline strings as invalid #209
Highlight unescaped multiline strings as invalid #209
Conversation
@@ -31,6 +31,21 @@ describe "Javascript grammar", -> | |||
expect(tokens[2].value).toEqual delim | |||
expect(tokens[2].scopes).toEqual ["source.js", scope, "punctuation.definition.string.end.js"] | |||
|
|||
it "tokenizes invalid multiline strings", -> | |||
lines = grammar.tokenizeLines("'line1\nline2\\\nline3'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if you can span this over multiple lines instead of using \n
(see examples further down)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Thanks a lot for this @pchaigno, tried solving this by myself a few weeks ago but couldn't get it to work. |
You're welcome. That was a tough one. |
Highlight unescaped multiline strings as invalid
⛵ |
🎉 |
👍 |
This pull request implements a change requested in #58.
Currently unescaped multiline strings are highlighted as if they were correct:
This change will highlight such strings as invalid.
Example of an invalid string with this change in Lightshow.
/cc @cydrobolt