(Ruby) #{} substitution shouldn't be highlighted in single quotes #3676
Labels
bug
good first issue
Should be easier for first time contributors
help welcome
Could use help from community
language
Describe the issue
In Ruby, single quote and double quote strings work differently:
https://docs.ruby-lang.org/en/3.1/syntax/literals_rdoc.html#label-Strings
But in ruby.js, they are implemented identically
highlight.js/src/languages/ruby.js
Lines 132 to 139 in 9c49a42
which leads it to incorrectly highlight
#{}
substitutions in single quoted strings which actually have no effect, they are just literal#{}
characters (in the "github
" theme):instead of highlighting it as a string, like it does if we remove the
#
:Which language seems to have the issue?
Ruby
Are you using
highlight
orhighlightAuto
?N/A
Expected behavior
Single and double quoted strings should have separate highlighting rules for Ruby.
Additional context
https://docs.ruby-lang.org/en/3.1/syntax/literals_rdoc.html#label-Strings
Unrelated, but for double quoted strings, that page also lists a couple interpolation syntax shorthands that are not implemented in the highlight.js grammar:
The text was updated successfully, but these errors were encountered: