Skip to content

Commit 96abb73

Browse files
committed
fix(rust) emoji supported in single quote strings
1 parent a7685d2 commit 96abb73

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/languages/rust.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,19 @@ export default function(hljs) {
199199
illegal: null
200200
}),
201201
{
202-
className: 'string',
202+
scope: 'string',
203203
variants: [
204204
{ begin: /b?r(#*)"(.|\n)*?"\1(?!#)/ },
205-
{ begin: /b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/ }
205+
{
206+
begin: /b?'/,
207+
end: /'/,
208+
contains: [
209+
{
210+
scope: "char.escape",
211+
match: /\\(\w|x\w{2}|u\w{4}|U\w{8})/
212+
}
213+
]
214+
}
206215
]
207216
},
208217
{

0 commit comments

Comments
 (0)