-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
fix(basic) - closing quotation marks not required for a PRINT statement #4137
Conversation
src/languages/basic.js
Outdated
hljs.QUOTE_STRING_MODE, | ||
{ | ||
// Match strings that start with " and end with " or a line break | ||
className: 'string', |
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.
className: 'string', | |
scope: 'string', |
src/languages/basic.js
Outdated
{ | ||
// Match strings that start with " and end with " or a line break | ||
className: 'string', | ||
begin: '"', |
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.
Please use regex literals for all the regex, rather than strings.
@joshgoebel the changes for regex literals are made, please review them once. |
src/languages/basic.js
Outdated
scope: 'string', | ||
begin: /"/, | ||
end: /"|$/, | ||
illegal: /\n/, |
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.
I'm not sure this illegal
has any effect at all since the $
should match first (or does it match after)... are you seeing different behavior with/without illegal
?
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.
I added the illegal keyword to ensure the string doesn't span multiple lines. But I can't see a different behavior without it. This can be removed to optimize the code.
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 can't span multiple lines because the $
will match the end of the first line.
Build Size ReportChanges to minified artifacts in 5 files changedTotal change +61 B View Changes
|
Fixed the closing quotations marks considered for string highlighting in basic.
Resolves #3996
Changes
Before
![image](https://private-user-images.githubusercontent.com/77123777/375953854-82bd4742-3762-437d-bb3b-3097816b6948.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3OTMwNTgsIm5iZiI6MTczOTc5Mjc1OCwicGF0aCI6Ii83NzEyMzc3Ny8zNzU5NTM4NTQtODJiZDQ3NDItMzc2Mi00MzdkLWJiM2ItMzA5NzgxNmI2OTQ4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE3VDExNDU1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThlNjMyNWY5ZWY4NWVlM2UxNzJlYmM3ZTgwMmM2NjA2ZDFjNmFjMmZjMGFmNWY1YjZiMWQxYjg0MTZlMDA1ZTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.CkP3hJpV-bgcLZGzTNjdN2KHf_Yx_T31K6Bi_eW398o)
After
![image](https://private-user-images.githubusercontent.com/77123777/375953934-e358b751-5473-4383-8387-861b641c6986.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3OTMwNTgsIm5iZiI6MTczOTc5Mjc1OCwicGF0aCI6Ii83NzEyMzc3Ny8zNzU5NTM5MzQtZTM1OGI3NTEtNTQ3My00MzgzLTgzODctODYxYjY0MWM2OTg2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE3VDExNDU1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTczNGQyZWViYzhlNTY1MzliMWU1ZDBiN2Y1NGJlYjFlM2NlNzQyNzhkNDU5YjkxZmIxMjRkZDNlODdjNDZiZjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Q6-E81XIzO6F99P1BpXVhTrjCVeJojEdGgdOBNNE7ZA)
Checklist
CHANGES.md