Skip to content

Commit

Permalink
Fix template strings problem in javascript lexer (#1878)
Browse files Browse the repository at this point in the history
Backslashes should escape backslashes.
  • Loading branch information
DGCK81LNN authored Dec 3, 2022
1 parent b5843e1 commit b503561
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rouge/lexers/javascript.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def self.id_regex
state :template_string do
rule %r/[$]{/, Punctuation, :template_string_expr
rule %r/`/, Str::Double, :pop!
rule %r/\\[$`]/, Str::Escape
rule %r/\\[$`\\]/, Str::Escape
rule %r/[^$`\\]+/, Str::Double
rule %r/[\\$]/, Str::Double
end
Expand Down

0 comments on commit b503561

Please sign in to comment.