mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-30 00:45:28 +08:00
Update regexp for smart annotation
This commit is contained in:
parent
e288a1f911
commit
21dcf1157c
1 changed files with 4 additions and 4 deletions
|
@ -104,10 +104,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;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ var SmartAnnotation = (function() {
|
|||
$(field)
|
||||
.on('shown.atwho', function() {
|
||||
var $currentAtWho = $('.atwho-view[style]:not(.old)');
|
||||
var atWhoId = $currentAtWho.find('.atwho-header-res').data('at-who-key')
|
||||
var atWhoId = $currentAtWho.find('.atwho-header-res').data('at-who-key');
|
||||
$currentAtWho.addClass('old').attr('data-at-who-id', atWhoId);
|
||||
$(field).attr('data-smart-annotation', atWhoId);
|
||||
|
||||
|
@ -140,7 +140,7 @@ var SmartAnnotation = (function() {
|
|||
});
|
||||
|
||||
if ($currentAtWho.find('.tab-pane.active').length === 0) {
|
||||
let filterType = DEFAULT_SEARCH_FILTER.tag;
|
||||
let filterType = DEFAULT_SEARCH_FILTER.tag;
|
||||
let teamId = $currentAtWho.find('.atwho-header-res').data('team-id');
|
||||
let remeberedState = localStorage.getItem('smart_annotation_states/teams/' + teamId);
|
||||
if (remeberedState) {
|
||||
|
|
Loading…
Add table
Reference in a new issue