diff --git a/src/languages/rust.js b/src/languages/rust.js index d0e36fa6bf..7c88d6045b 100644 --- a/src/languages/rust.js +++ b/src/languages/rust.js @@ -199,10 +199,19 @@ export default function(hljs) { illegal: null }), { - className: 'string', + scope: 'string', variants: [ { begin: /b?r(#*)"(.|\n)*?"\1(?!#)/ }, - { begin: /b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/ } + { + begin: /b?'/, + end: /'/, + contains: [ + { + scope: "char.escape", + match: /\\(\w|x\w{2}|u\w{4}|U\w{8})/ + } + ] + } ] }, {