-
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(ruby) don't highlight interpolation in single quoted strings #4178
base: main
Are you sure you want to change the base?
Conversation
Build Size ReportChanges to minified artifacts in 3 files changedTotal change +91 B View Changes
|
4925f36
to
ab79bf2
Compare
Build Size ReportChanges to minified artifacts in 4 files changedTotal change +92 B View Changes
|
ab79bf2
to
314bb55
Compare
"<>", | ||
"\\/\\/", | ||
"%%", | ||
"--" |
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.
Would we want to flush this out a fit further while we're here?
Build Size ReportChanges to minified artifacts in 5 files changedTotal change +486 B View Changes
|
I jumped in here on top of your work to organize things a bit nicer and try to DRY it up just a little... any additional thoughts? I left some work for the future, but I think it's broken out a lot clearer now. |
"[]", | ||
"{}", | ||
"<>", | ||
"\\/\\/", |
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.
Did you mean
"\\/\\/", | |
"//", |
d.charAt(1)
won't work because it's 4 characters long.
> d = "\\/\\/"
'\\/\\/'
> d.charAt(0)
'\\'
> d.charAt(1)
'/'
https://docs.ruby-lang.org/en/3.1/syntax/literals_rdoc.html#label-Percent+Literals says
Each of the literals in described in this section may use these paired delimiters
- [...]
- Any other character, as both beginning and ending delimiters.
Which seems like something regex can't handle.
Fixes #3676
Changes
Not all Ruby strings can contain (
contains:
) string substitutions (SUBST
).