diff --git a/src/languages/r.js b/src/languages/r.js index ec73c1beab..5af79ec058 100644 --- a/src/languages/r.js +++ b/src/languages/r.js @@ -202,9 +202,21 @@ export default function(hljs) { // Operators/punctuation when they're not directly followed by numbers { + // Avoid false detections of other languages. scope: 'operator', + relevance: 0, match: /<-/ }, + { + // Relevance boost for the most common assignment form. + scope: { 3: 'operator' }, + match: [ + IDENT_RE, + /\s+/, + /<-/, + /\s+/ + ] + }, { scope: 'operator', variants: [