Merge pull request #2863 from aignatov-bio/ai-sci-5037-update-regexp-for-smart-annotation

Update regexp for smart annotation [SCI-5037]
This commit is contained in:
aignatov-bio 2020-09-23 16:39:24 +02:00 committed by GitHub
commit b6f038ff09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,10 +106,10 @@ var SmartAnnotation = (function() {
}
a = decodeURI('%C3%80');
y = decodeURI('%C3%BF');
regexp = new RegExp(cleanedFlag + `([A-Za-z${a}-${y}0-9_/:\\s+-]*)$|${cleanedFlag}([^\\x00-\\xff]*)$`, 'gi');
regexp = new RegExp(`${cleanedFlag}$|${cleanedFlag}(\\S[A-Za-z${a}-${y}0-9_/:\\s+-]*)$|${cleanedFlag}(\\S[^\\x00-\\xff]*)$`, 'gi');
match = regexp.exec(subtext);
if (match) {
return match[2] || match[1];
return match[1] || '';
}
return null;
}