From a3c1fed3d357b8b1ff9af9536b980ed80df0e0c0 Mon Sep 17 00:00:00 2001
From: Michal Prochazka <michalp@ics.muni.cz>
Date: Thu, 22 Jun 2017 09:52:33 +0200
Subject: [PATCH] Disco suggest algorithm accepts also -_() characters

When IdP has e.g. acronym in the name covered by () or there is dash in the name, then the current suggest algorithm doesn't split the name correctly, so disco doesn't show the name of the organization when you type the acronym or something which is in brackets.
---
 modules/discopower/www/js/suggest.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/discopower/www/js/suggest.js b/modules/discopower/www/js/suggest.js
index 770260ac3..667b35ac9 100644
--- a/modules/discopower/www/js/suggest.js
+++ b/modules/discopower/www/js/suggest.js
@@ -12,7 +12,7 @@ String.prototype.score = function(abbreviation,offset) {
 			suggest_cache['re'][i] = new Array();
 			// /\b<x>/ doesn't work when <x> i a non-ascii - oddly enough \s does ...
 			suggest_cache['re'][i]['initialword'] = new RegExp("^"+words[i], "i");
-			suggest_cache['re'][i]['word'] = new RegExp("\\s"+words[i], "i");
+			suggest_cache['re'][i]['word'] = new RegExp("[\\s-()_]"+words[i], "i");
 		}
 	}
 
@@ -20,4 +20,4 @@ String.prototype.score = function(abbreviation,offset) {
 		if (!(this.match(suggest_cache['re'][i]['initialword']) || this.match(suggest_cache['re'][i]['word']))) return 0;
 	}
 	return 1;
-}
\ No newline at end of file
+}
-- 
GitLab