From eb789939caea450877a5271406bf8a4312866c71 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 11 Mar 2018 12:52:02 -0400 Subject: [PATCH] code review for b10ac0020da1: fix too rigid field separator --- src/js/messaging.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/messaging.js b/src/js/messaging.js index fd1c96568..d4c1dc17d 100644 --- a/src/js/messaging.js +++ b/src/js/messaging.js @@ -887,7 +887,7 @@ var modifyRuleset = function(details) { var rule, parts, _; for ( rule of toRemove ) { if ( rule === '' ) { continue; } - parts = rule.split(/\s/); + parts = rule.split(/\s+/); _ = hnRuleset.removeFromRuleParts(parts) || swRuleset.removeFromRuleParts(parts) || urlRuleset.removeFromRuleParts(parts); @@ -895,7 +895,7 @@ var modifyRuleset = function(details) { var toAdd = new Set(details.toAdd.trim().split(/\s*[\n\r]+\s*/)); for ( rule of toAdd ) { if ( rule === '' ) { continue; } - parts = rule.split(/\s/); + parts = rule.split(/\s+/); _ = hnRuleset.addFromRuleParts(parts) || swRuleset.addFromRuleParts(parts) || urlRuleset.addFromRuleParts(parts);