From 4c50e678147ade0489ed9fb037975a7273766c2d Mon Sep 17 00:00:00 2001 From: Dylan Moore Date: Sun, 25 Feb 2018 20:56:33 -0800 Subject: [PATCH] Fix operator regex Since django operators aren't words we should use the negated version of `\b`: `\B`. --- mode/django/django.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mode/django/django.js b/mode/django/django.js index 7b4ef3b566..941db4fb2b 100644 --- a/mode/django/django.js +++ b/mode/django/django.js @@ -40,7 +40,7 @@ keywords = new RegExp("^\\b(" + keywords.join("|") + ")\\b"); filters = new RegExp("^\\b(" + filters.join("|") + ")\\b"); - operators = new RegExp("^\\b(" + operators.join("|") + ")\\b"); + operators = new RegExp("^\\B(" + operators.join("|") + ")\\B"); wordOperators = new RegExp("^\\b(" + wordOperators.join("|") + ")\\b"); // We have to return "null" instead of null, in order to avoid string