Merge pull request #3197 from KhaledTo/bug/3031

Fixes #3031: Select2 creates multiple tags for tags with spaces
This commit is contained in:
Jeremy Stretch 2019-05-29 10:08:59 -04:00 committed by GitHub
commit 00ffa358b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -267,6 +267,10 @@ $(document).ready(function() {
processResults: function (data) {
var results = $.map(data.results, function (obj) {
// If tag contains space add double quotes
if (/\s/.test(obj.name))
obj.name = '"' + obj.name + '"'
return {
id: obj.name,
text: obj.name