fix(ruby) don't highlight interpolation in single quoted strings#4178
fix(ruby) don't highlight interpolation in single quoted strings#4178verhovsky wants to merge 3 commits intohighlightjs:mainfrom
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.
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.
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).