Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded javascript string with // have unexpected behavrio #113

Open
alexr00 opened this issue Sep 29, 2020 · 3 comments
Open

Embedded javascript string with // have unexpected behavrio #113

alexr00 opened this issue Sep 29, 2020 · 3 comments

Comments

@alexr00
Copy link

alexr00 commented Sep 29, 2020

Original from @Namorzyny in microsoft/vscode#105779

Steps to Reproduce:

  1. Input some code like: <input type="button" value="text" onclick="location.href='https://www.google.com'">
  2. The code will display as a comment:

コメント 2020-09-01 083349

This only occurs if the // is in the string. The character before the // will get invalid.illegal.newline.js.

@alexr00
Copy link
Author

alexr00 commented Sep 29, 2020

This issue doesn't occur with just the javascript grammar, only when its embedded like this.

@alexr00
Copy link
Author

alexr00 commented Dec 30, 2020

Thanks to some investigation from @mjbvz, the issue appears to be here:

<string>string.quoted.double.html</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>source.js</string>
</dict>
</array>
</dict>
</dict>
<key>match</key>
<string>([^\n"/]|/(?![/*]))+</string>

Original comment is microsoft/vscode#112189 (comment)

@rahul3v
Copy link

rahul3v commented Jan 6, 2021

Well, same will happen when you use /* as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants