code review for b10ac0020da1: fix too rigid field separator

This commit is contained in:
Raymond Hill 2018-03-11 12:52:02 -04:00
parent c2ce20e52c
commit eb789939ca
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 2 additions and 2 deletions

View File

@ -887,7 +887,7 @@ var modifyRuleset = function(details) {
var rule, parts, _; var rule, parts, _;
for ( rule of toRemove ) { for ( rule of toRemove ) {
if ( rule === '' ) { continue; } if ( rule === '' ) { continue; }
parts = rule.split(/\s/); parts = rule.split(/\s+/);
_ = hnRuleset.removeFromRuleParts(parts) || _ = hnRuleset.removeFromRuleParts(parts) ||
swRuleset.removeFromRuleParts(parts) || swRuleset.removeFromRuleParts(parts) ||
urlRuleset.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*/)); var toAdd = new Set(details.toAdd.trim().split(/\s*[\n\r]+\s*/));
for ( rule of toAdd ) { for ( rule of toAdd ) {
if ( rule === '' ) { continue; } if ( rule === '' ) { continue; }
parts = rule.split(/\s/); parts = rule.split(/\s+/);
_ = hnRuleset.addFromRuleParts(parts) || _ = hnRuleset.addFromRuleParts(parts) ||
swRuleset.addFromRuleParts(parts) || swRuleset.addFromRuleParts(parts) ||
urlRuleset.addFromRuleParts(parts); urlRuleset.addFromRuleParts(parts);